diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6fd570acb..fd8e89b23 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: 32980ab2e16f23834a021f4a0220f18a - docVersion: 10.21.17 - speakeasyVersion: 1.660.0 - generationVersion: 2.760.2 - releaseVersion: 0.27.8 - configChecksum: 1f65afec567b61163e7f2cf3b065062e + docChecksum: fbc79de1908ef8470cee0e8ac97f3d4b + docVersion: 10.21.18 + speakeasyVersion: 1.661.3 + generationVersion: 2.763.3 + releaseVersion: 0.27.9 + configChecksum: 7b37d7d128984d7847b3a1bcea3566af repoURL: https://github.com/apideck-libraries/sdk-java.git published: true features: @@ -15,7 +15,7 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.0.1 constsAndDefaults: 0.1.1 - core: 3.55.3 + core: 3.55.5 deprecations: 2.81.1 downloadStreams: 0.1.1 errors: 1.0.0 @@ -4711,7 +4711,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "status": "active", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} + application/json: {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "country": "US", "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "status": "active", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} responses: "201": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "tax-rates", "operation": "add", "data": {"id": "12345"}} @@ -4767,7 +4767,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "tax-rates", "operation": "one", "data": {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "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"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "tax-rates", "operation": "one", "data": {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "country": "US", "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "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"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]}} "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": @@ -4819,7 +4819,7 @@ examples: x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" requestBody: - application/json: {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "status": "active", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} + application/json: {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "country": "US", "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "status": "active", "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]} responses: "200": application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "tax-rates", "operation": "update", "data": {"id": "12345"}} @@ -7060,7 +7060,7 @@ examples: x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "company-info", "operation": "one", "data": {"id": "12345", "company_name": "SpaceX", "status": "active", "legal_name": "SpaceX Inc.", "country": "US", "sales_tax_number": "111.222.333", "default_sales_tax": {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "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"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]}, "currency": "USD", "language": "EN", "fiscal_year_start_month": "January", "company_start_date": "2015-06-05", "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "tracking_categories_mode": "disabled", "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"}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "company-info", "operation": "one", "data": {"id": "12345", "company_name": "SpaceX", "status": "active", "legal_name": "SpaceX Inc.", "country": "US", "sales_tax_number": "111.222.333", "default_sales_tax": {"id": "1234", "display_id": "12345", "name": "GST on Purchases", "code": "ABN", "description": "Reduced rate GST Purchases", "effective_tax_rate": 10, "country": "US", "total_tax_rate": 10, "tax_payable_account_id": "123456", "tax_remitted_account_id": "123456", "components": [{"id": "10", "name": "GST", "rate": 10, "compound": true}], "type": "NONE", "report_tax_type": "NONE", "original_tax_rate_id": "12345", "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"}}}]}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}]}, "currency": "USD", "language": "EN", "fiscal_year_start_month": "January", "company_start_date": "2015-06-05", "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "tracking_categories_mode": "disabled", "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"}} "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": @@ -20068,3 +20068,4 @@ examples: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Java SDK Changes Detected:\n* `apideck.accounting.taxRates.list()`: `response.data.[].country` **Added**\n* `apideck.accounting.taxRates.create()`: \n * `request.taxRate.country` **Added**\n* `apideck.accounting.taxRates.get()`: `response.data.country` **Added**\n* `apideck.accounting.taxRates.update()`: \n * `request.taxRate.country` **Added**\n* `apideck.accounting.companyInfo.get()`: `response.data.defaultSalesTax.country` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f62e9be25..812ee153a 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -25,7 +25,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.27.8 + version: 0.27.9 additionalDependencies: [] additionalPlugins: [] artifactID: unify @@ -52,6 +52,7 @@ java: operations: models/operations shared: models/components webhooks: models/webhooks + inferUnionDiscriminators: false inputModelSuffix: input languageVersion: 11 license: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 65a42f0dd..ae15b2eb2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.660.0 +speakeasyVersion: 1.661.3 sources: Apideck-OAS: sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:de306d872a1c680564d7ffaca595bf65ca646d4451327091bfc15653cbe5f8d7 - sourceBlobDigest: sha256:5ec5d4ac95acd9164fc9a23aeed2a0a045c66059261d98c186f59d559d9d743c + sourceRevisionDigest: sha256:f06d45c8093c174ccfbc9c5d83c1360f03c87489b57b6161a53f7cb310d0b2cb + sourceBlobDigest: sha256:ded010a987213606a40ad118f6bd177d5c3b54461d6b10a7bc98d24c26237ce4 tags: - latest - - speakeasy-sdk-regen-1764064770 - - 10.21.17 + - speakeasy-sdk-regen-1764155629 + - 10.21.18 targets: apideck: source: Apideck-OAS sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:de306d872a1c680564d7ffaca595bf65ca646d4451327091bfc15653cbe5f8d7 - sourceBlobDigest: sha256:5ec5d4ac95acd9164fc9a23aeed2a0a045c66059261d98c186f59d559d9d743c + sourceRevisionDigest: sha256:f06d45c8093c174ccfbc9c5d83c1360f03c87489b57b6161a53f7cb310d0b2cb + sourceBlobDigest: sha256:ded010a987213606a40ad118f6bd177d5c3b54461d6b10a7bc98d24c26237ce4 codeSamplesNamespace: apideck-oas-java-code-samples - codeSamplesRevisionDigest: sha256:d5cee4709a43897fbc3a56eb02d120dbb2c030a5c906dca4c02a724f0e6e9d45 + codeSamplesRevisionDigest: sha256:5c52513665b1825c4af28590fafdfa70f7dbc414ee552f215c5abe90cce06da4 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 8bd96d382..488016f80 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.apideck:unify:0.27.8' +implementation 'com.apideck:unify:0.27.9' ``` Maven: @@ -58,7 +58,7 @@ Maven: com.apideck unify - 0.27.8 + 0.27.9 ``` diff --git a/RELEASES.md b/RELEASES.md index 5cd09876b..9d5744fd2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -638,4 +638,14 @@ Based on: ### Generated - [java v0.27.8] . ### Releases -- [Maven Central v0.27.8] https://central.sonatype.com/artifact/com.apideck/unify/0.27.8 - . \ No newline at end of file +- [Maven Central v0.27.8] https://central.sonatype.com/artifact/com.apideck/unify/0.27.8 - . + +## 2025-11-26 11:13:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.661.3 (2.763.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.27.9] . +### Releases +- [Maven Central v0.27.9] https://central.sonatype.com/artifact/com.apideck/unify/0.27.9 - . \ No newline at end of file diff --git a/docs/models/components/TaxRate.md b/docs/models/components/TaxRate.md index fb451269e..09afc9255 100644 --- a/docs/models/components/TaxRate.md +++ b/docs/models/components/TaxRate.md @@ -11,6 +11,7 @@ | `code` | *JsonNullable\* | :heavy_minus_sign: | Tax code assigned to identify this tax rate. | ABN | | `description` | *JsonNullable\* | :heavy_minus_sign: | Description of tax rate | Reduced rate GST Purchases | | `effectiveTaxRate` | *JsonNullable\* | :heavy_minus_sign: | Effective tax rate | 10 | +| `country` | *JsonNullable\* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | | `totalTaxRate` | *JsonNullable\* | :heavy_minus_sign: | Not compounded sum of the components of a tax rate | 10 | | `taxPayableAccountId` | *JsonNullable\* | :heavy_minus_sign: | Unique identifier for the account for tax collected. | 123456 | | `taxRemittedAccountId` | *JsonNullable\* | :heavy_minus_sign: | Unique identifier for the account for tax remitted. | 123456 | diff --git a/docs/models/components/TaxRateInput.md b/docs/models/components/TaxRateInput.md index f9c1b4ff1..ddfd727db 100644 --- a/docs/models/components/TaxRateInput.md +++ b/docs/models/components/TaxRateInput.md @@ -11,6 +11,7 @@ | `code` | *JsonNullable\* | :heavy_minus_sign: | Tax code assigned to identify this tax rate. | ABN | | `description` | *JsonNullable\* | :heavy_minus_sign: | Description of tax rate | Reduced rate GST Purchases | | `effectiveTaxRate` | *JsonNullable\* | :heavy_minus_sign: | Effective tax rate | 10 | +| `country` | *JsonNullable\* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | | `totalTaxRate` | *JsonNullable\* | :heavy_minus_sign: | Not compounded sum of the components of a tax rate | 10 | | `taxPayableAccountId` | *JsonNullable\* | :heavy_minus_sign: | Unique identifier for the account for tax collected. | 123456 | | `taxRemittedAccountId` | *JsonNullable\* | :heavy_minus_sign: | Unique identifier for the account for tax remitted. | 123456 | diff --git a/gradle.properties b/gradle.properties index 3a08560d3..51870dd7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.apideck artifactId=unify -version=0.27.8 +version=0.27.9 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/apideck/unify/SDKConfiguration.java b/src/main/java/com/apideck/unify/SDKConfiguration.java index 9029e9cf0..4eeddf4a9 100644 --- a/src/main/java/com/apideck/unify/SDKConfiguration.java +++ b/src/main/java/com/apideck/unify/SDKConfiguration.java @@ -20,9 +20,9 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; - public static final String OPENAPI_DOC_VERSION = "10.21.17"; - public static final String SDK_VERSION = "0.27.8"; - public static final String GEN_VERSION = "2.760.2"; + public static final String OPENAPI_DOC_VERSION = "10.21.18"; + public static final String SDK_VERSION = "0.27.9"; + public static final String GEN_VERSION = "2.763.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/models/components/TaxRate.java b/src/main/java/com/apideck/unify/models/components/TaxRate.java index eda4cf2b5..8147ff38f 100644 --- a/src/main/java/com/apideck/unify/models/components/TaxRate.java +++ b/src/main/java/com/apideck/unify/models/components/TaxRate.java @@ -64,6 +64,13 @@ public class TaxRate { @JsonProperty("effective_tax_rate") private JsonNullable effectiveTaxRate; + /** + * Country code according to ISO 3166-1 alpha-2. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private JsonNullable country; + /** * Not compounded sum of the components of a tax rate */ @@ -190,6 +197,7 @@ public TaxRate( @JsonProperty("code") JsonNullable code, @JsonProperty("description") JsonNullable description, @JsonProperty("effective_tax_rate") JsonNullable effectiveTaxRate, + @JsonProperty("country") JsonNullable country, @JsonProperty("total_tax_rate") JsonNullable totalTaxRate, @JsonProperty("tax_payable_account_id") JsonNullable taxPayableAccountId, @JsonProperty("tax_remitted_account_id") JsonNullable taxRemittedAccountId, @@ -213,6 +221,7 @@ public TaxRate( Utils.checkNotNull(code, "code"); Utils.checkNotNull(description, "description"); Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + Utils.checkNotNull(country, "country"); Utils.checkNotNull(totalTaxRate, "totalTaxRate"); Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); @@ -236,6 +245,7 @@ public TaxRate( this.code = code; this.description = description; this.effectiveTaxRate = effectiveTaxRate; + this.country = country; this.totalTaxRate = totalTaxRate; this.taxPayableAccountId = taxPayableAccountId; this.taxRemittedAccountId = taxRemittedAccountId; @@ -262,8 +272,8 @@ public TaxRate() { 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(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -314,6 +324,14 @@ public JsonNullable effectiveTaxRate() { return effectiveTaxRate; } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + @JsonIgnore + public JsonNullable country() { + return country; + } + /** * Not compounded sum of the components of a tax rate */ @@ -567,6 +585,24 @@ public TaxRate withEffectiveTaxRate(JsonNullable effectiveTaxRate) { return this; } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public TaxRate withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = JsonNullable.of(country); + return this; + } + + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public TaxRate withCountry(JsonNullable country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + /** * Not compounded sum of the components of a tax rate */ @@ -886,6 +922,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.code, other.code) && Utils.enhancedDeepEquals(this.description, other.description) && Utils.enhancedDeepEquals(this.effectiveTaxRate, other.effectiveTaxRate) && + Utils.enhancedDeepEquals(this.country, other.country) && Utils.enhancedDeepEquals(this.totalTaxRate, other.totalTaxRate) && Utils.enhancedDeepEquals(this.taxPayableAccountId, other.taxPayableAccountId) && Utils.enhancedDeepEquals(this.taxRemittedAccountId, other.taxRemittedAccountId) && @@ -910,12 +947,12 @@ public int hashCode() { return Utils.enhancedHash( id, displayId, name, code, description, effectiveTaxRate, - totalTaxRate, taxPayableAccountId, taxRemittedAccountId, - components, type, reportTaxType, - originalTaxRateId, status, customMappings, - rowVersion, updatedBy, createdBy, - updatedAt, createdAt, passThrough, - subsidiaries, customFields); + country, totalTaxRate, taxPayableAccountId, + taxRemittedAccountId, components, type, + reportTaxType, originalTaxRateId, status, + customMappings, rowVersion, updatedBy, + createdBy, updatedAt, createdAt, + passThrough, subsidiaries, customFields); } @Override @@ -927,6 +964,7 @@ public String toString() { "code", code, "description", description, "effectiveTaxRate", effectiveTaxRate, + "country", country, "totalTaxRate", totalTaxRate, "taxPayableAccountId", taxPayableAccountId, "taxRemittedAccountId", taxRemittedAccountId, @@ -961,6 +999,8 @@ public final static class Builder { private JsonNullable effectiveTaxRate = JsonNullable.undefined(); + private JsonNullable country = JsonNullable.undefined(); + private JsonNullable totalTaxRate = JsonNullable.undefined(); private JsonNullable taxPayableAccountId = JsonNullable.undefined(); @@ -1114,6 +1154,25 @@ public Builder effectiveTaxRate(JsonNullable effectiveTaxRate) { } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public Builder country(String country) { + Utils.checkNotNull(country, "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; + } + + /** * Not compounded sum of the components of a tax rate */ @@ -1435,12 +1494,12 @@ public TaxRate build() { return new TaxRate( id, displayId, name, code, description, effectiveTaxRate, - totalTaxRate, taxPayableAccountId, taxRemittedAccountId, - components, type, reportTaxType, - originalTaxRateId, status, customMappings, - rowVersion, updatedBy, createdBy, - updatedAt, createdAt, passThrough, - subsidiaries, customFields); + country, totalTaxRate, taxPayableAccountId, + taxRemittedAccountId, components, type, + reportTaxType, originalTaxRateId, status, + customMappings, rowVersion, updatedBy, + createdBy, updatedAt, createdAt, + passThrough, subsidiaries, customFields); } } 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 5679a15b7..974b647cc 100644 --- a/src/main/java/com/apideck/unify/models/components/TaxRateInput.java +++ b/src/main/java/com/apideck/unify/models/components/TaxRateInput.java @@ -61,6 +61,13 @@ public class TaxRateInput { @JsonProperty("effective_tax_rate") private JsonNullable effectiveTaxRate; + /** + * Country code according to ISO 3166-1 alpha-2. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("country") + private JsonNullable country; + /** * Not compounded sum of the components of a tax rate */ @@ -152,6 +159,7 @@ public TaxRateInput( @JsonProperty("code") JsonNullable code, @JsonProperty("description") JsonNullable description, @JsonProperty("effective_tax_rate") JsonNullable effectiveTaxRate, + @JsonProperty("country") JsonNullable country, @JsonProperty("total_tax_rate") JsonNullable totalTaxRate, @JsonProperty("tax_payable_account_id") JsonNullable taxPayableAccountId, @JsonProperty("tax_remitted_account_id") JsonNullable taxRemittedAccountId, @@ -170,6 +178,7 @@ public TaxRateInput( Utils.checkNotNull(code, "code"); Utils.checkNotNull(description, "description"); Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + Utils.checkNotNull(country, "country"); Utils.checkNotNull(totalTaxRate, "totalTaxRate"); Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); @@ -188,6 +197,7 @@ public TaxRateInput( this.code = code; this.description = description; this.effectiveTaxRate = effectiveTaxRate; + this.country = country; this.totalTaxRate = totalTaxRate; this.taxPayableAccountId = taxPayableAccountId; this.taxRemittedAccountId = taxRemittedAccountId; @@ -208,7 +218,8 @@ public TaxRateInput() { 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(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -259,6 +270,14 @@ public JsonNullable effectiveTaxRate() { return effectiveTaxRate; } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + @JsonIgnore + public JsonNullable country() { + return country; + } + /** * Not compounded sum of the components of a tax rate */ @@ -471,6 +490,24 @@ public TaxRateInput withEffectiveTaxRate(JsonNullable effectiveTaxRate) return this; } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public TaxRateInput withCountry(String country) { + Utils.checkNotNull(country, "country"); + this.country = JsonNullable.of(country); + return this; + } + + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public TaxRateInput withCountry(JsonNullable country) { + Utils.checkNotNull(country, "country"); + this.country = country; + return this; + } + /** * Not compounded sum of the components of a tax rate */ @@ -700,6 +737,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.code, other.code) && Utils.enhancedDeepEquals(this.description, other.description) && Utils.enhancedDeepEquals(this.effectiveTaxRate, other.effectiveTaxRate) && + Utils.enhancedDeepEquals(this.country, other.country) && Utils.enhancedDeepEquals(this.totalTaxRate, other.totalTaxRate) && Utils.enhancedDeepEquals(this.taxPayableAccountId, other.taxPayableAccountId) && Utils.enhancedDeepEquals(this.taxRemittedAccountId, other.taxRemittedAccountId) && @@ -719,10 +757,11 @@ public int hashCode() { return Utils.enhancedHash( id, displayId, name, code, description, effectiveTaxRate, - totalTaxRate, taxPayableAccountId, taxRemittedAccountId, - components, type, reportTaxType, - originalTaxRateId, status, rowVersion, - passThrough, subsidiaries, customFields); + country, totalTaxRate, taxPayableAccountId, + taxRemittedAccountId, components, type, + reportTaxType, originalTaxRateId, status, + rowVersion, passThrough, subsidiaries, + customFields); } @Override @@ -734,6 +773,7 @@ public String toString() { "code", code, "description", description, "effectiveTaxRate", effectiveTaxRate, + "country", country, "totalTaxRate", totalTaxRate, "taxPayableAccountId", taxPayableAccountId, "taxRemittedAccountId", taxRemittedAccountId, @@ -763,6 +803,8 @@ public final static class Builder { private JsonNullable effectiveTaxRate = JsonNullable.undefined(); + private JsonNullable country = JsonNullable.undefined(); + private JsonNullable totalTaxRate = JsonNullable.undefined(); private JsonNullable taxPayableAccountId = JsonNullable.undefined(); @@ -906,6 +948,25 @@ public Builder effectiveTaxRate(JsonNullable effectiveTaxRate) { } + /** + * Country code according to ISO 3166-1 alpha-2. + */ + public Builder country(String country) { + Utils.checkNotNull(country, "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; + } + + /** * Not compounded sum of the components of a tax rate */ @@ -1132,10 +1193,11 @@ public TaxRateInput build() { return new TaxRateInput( id, displayId, name, code, description, effectiveTaxRate, - totalTaxRate, taxPayableAccountId, taxRemittedAccountId, - components, type, reportTaxType, - originalTaxRateId, status, rowVersion, - passThrough, subsidiaries, customFields); + country, totalTaxRate, taxPayableAccountId, + taxRemittedAccountId, components, type, + reportTaxType, originalTaxRateId, status, + rowVersion, passThrough, subsidiaries, + customFields); } } diff --git a/src/main/java/com/apideck/unify/utils/SpeakeasyHTTPClient.java b/src/main/java/com/apideck/unify/utils/SpeakeasyHTTPClient.java index cf8d581dc..db21352b6 100644 --- a/src/main/java/com/apideck/unify/utils/SpeakeasyHTTPClient.java +++ b/src/main/java/com/apideck/unify/utils/SpeakeasyHTTPClient.java @@ -39,15 +39,20 @@ public class SpeakeasyHTTPClient implements HTTPClient { private final HttpClient client = HttpClient.newHttpClient(); /** - * Experimental, may be changed anytime. Sets debug logging on or off for - * requests and responses including bodies for JSON content. WARNING: this - * setting may expose sensitive information in logs (like Authorization - * headers), and should only be enabled temporarily for local debugging - * purposes. By default, Authorization headers are redacted in the logs - * ( printed with a value of {@code [*******]}). Header suppression is controlled - * with the {@link #setRedactedHeaders(Collection)} method. + * Sets debug logging on or off for requests and responses including bodies for JSON content. + *

+ * WARNING: This setting may expose sensitive information in logs (such as + * {@code Authorization} headers) and should only be enabled temporarily for local debugging + * purposes. + *

+ * By default, {@code Authorization} headers are redacted in the logs (printed with a value + * of {@code [*******]}). Header suppression can be controlled with the + * {@link #setRedactedHeaders(Collection)} method. * - * @param enabled true to enable debug logging, false to disable it + * @param enabled {@code true} to enable debug logging, {@code false} to disable it + * @see #setRedactedHeaders(Collection) + * @see #addRedactedHeader(String) + * @see #getDebugLoggingEnabled() */ public static void setDebugLogging(boolean enabled) { debugEnabled = enabled; @@ -68,14 +73,14 @@ public void enableDebugLogging(boolean enabled) { } /** - * Experimental, may be changed anytime. When debug logging is enabled this - * method controls the suppression of header values in the logs. By default, - * Authorization headers are redacted in the logs (printed with a value - * of {@code [*******]}). Header suppression is controlled with the - * {@link #setRedactedHeaders(Collection)} method. - * - * @param headerNames the names (case-insensitive) of the headers whose values - * will be redacted in the logs + * When debug logging is enabled, this method controls the suppression of header values in the logs. + *

+ * By default, {@code Authorization} headers are redacted in the logs (printed with a value + * of {@code [*******]}). + * + * @param headerNames the names (case-insensitive) of the headers whose values + * will be redacted in the logs + * @see #setDebugLogging(boolean) */ public static void setRedactedHeaders(Collection headerNames) { redactedHeaders = headerNames.stream() // @@ -83,6 +88,24 @@ public static void setRedactedHeaders(Collection headerNames) { .collect(Collectors.toSet()); } + /** + * When debug logging is enabled, this method adds a single header to the list of headers + * whose values will be redacted in the logs. + *

+ * By default, {@code Authorization} headers are redacted in the logs (printed with a value + * of {@code [*******]}). + * + * @param headerName the name (case-insensitive) of the header whose value + * will be redacted in the logs + * @see #setDebugLogging(boolean) + * @see #setRedactedHeaders(Collection) + */ + public static void addRedactedHeader(String headerName) { + Set updated = new java.util.HashSet<>(redactedHeaders); + updated.add(headerName.toUpperCase(Locale.ENGLISH)); + redactedHeaders = Set.copyOf(updated); + } + public static void setLogger(Consumer logger) { SpeakeasyHTTPClient.logger = logger; }