diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67bccf0d..24ea7198 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -16,14 +18,14 @@ jobs: lint: timeout-minutes: 15 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/m3ter-sdk-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Java - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: temurin java-version: | @@ -32,7 +34,7 @@ jobs: cache: gradle - name: Set up Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 - name: Run lints run: ./scripts/lint @@ -43,14 +45,14 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/m3ter-sdk-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Java - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: temurin java-version: | @@ -59,20 +61,24 @@ jobs: cache: gradle - name: Set up Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 - name: Build SDK run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/m3ter-sdk-java' + if: |- + github.repository == 'stainless-sdks/m3ter-sdk-java' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Build and upload Maven artifacts - if: github.repository == 'stainless-sdks/m3ter-sdk-java' + if: |- + github.repository == 'stainless-sdks/m3ter-sdk-java' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -82,13 +88,13 @@ jobs: test: timeout-minutes: 15 name: test - runs-on: ${{ github.repository == 'stainless-sdks/m3ter-sdk-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Java - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: temurin java-version: | @@ -97,7 +103,7 @@ jobs: cache: gradle - name: Set up Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0 - name: Run tests run: ./scripts/test diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index e16cf0d6..cb6d035a 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Java - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: temurin java-version: | @@ -26,7 +26,7 @@ jobs: cache: gradle - name: Set up Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0 - name: Publish to Sonatype run: |- diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 45b2a3fc..bf0d0bef 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'm3ter-com/m3ter-sdk-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | diff --git a/.gitignore b/.gitignore index b1346e6d..90b85e94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log .gradle .idea .kotlin diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35ae..4208b5cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.6.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 03f6cdbe..ba1032d6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 286 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/rg%2Fm3ter-sdk-9518109ea0b24bfbc86fe686fc43cab13182b93d174928a28dcd367eb73fce30.yml -openapi_spec_hash: dba933943876f28268bd8220d9af8ffe -config_hash: 10410ec7acfbc33ee5116775c6714440 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/rg/m3ter-sdk-8ed00aff39e19053e35301d739d96ff2bafb352273d647c86073ca879a1dad3f.yml +openapi_spec_hash: 3e75a21276e7cd06944188f512a7a4e3 +config_hash: 5de7039a6202fb360a3970934cffb50e diff --git a/CHANGELOG.md b/CHANGELOG.md index 38bcda28..471f8be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,75 @@ # Changelog +## 0.6.0 (2026-07-17) + +Full Changelog: [v0.5.0...v0.6.0](https://github.com/m3ter-com/m3ter-sdk-java/compare/v0.5.0...v0.6.0) + +### Features + +* **api:** switch to TypeScript SDK ([00e3a4d](https://github.com/m3ter-com/m3ter-sdk-java/commit/00e3a4ddcf414578153e20a76bb0c46aebd3f631)) +* **api:** Updating OpenAPI Spec ([6bfc0b0](https://github.com/m3ter-com/m3ter-sdk-java/commit/6bfc0b03dcbfa6e32ae1931db999acdd606e5996)) +* **client:** add connection pooling option ([4431d4b](https://github.com/m3ter-com/m3ter-sdk-java/commit/4431d4b3819146e68ace77675ab5ae66d7122f7e)) +* **client:** add more convenience service method overloads ([0600cd9](https://github.com/m3ter-com/m3ter-sdk-java/commit/0600cd95034d92b2916278a25d21e85e8d5cbd1c)) +* **client:** improve logging ([bf27118](https://github.com/m3ter-com/m3ter-sdk-java/commit/bf27118dac6cb0fd1747d50fe14c743f2c13ea9d)) +* **client:** more robust error parsing ([1245a24](https://github.com/m3ter-com/m3ter-sdk-java/commit/1245a244af0d73a59f3a935f17b00cd29d0bc029)) +* **client:** support proxy authentication ([29f8806](https://github.com/m3ter-com/m3ter-sdk-java/commit/29f88060572361f97d0bdcef4460a7b4105fbaa1)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([445ed24](https://github.com/m3ter-com/m3ter-sdk-java/commit/445ed24dcc6f9fae32962670a5bed0241998b53e)) +* support setting headers via env ([6e61838](https://github.com/m3ter-com/m3ter-sdk-java/commit/6e61838b8e2b70f18d8d5c046c95f557061a763f)) + + +### Bug Fixes + +* **client:** allow updating header/query affecting fields in `toBuilder()` ([23e28b9](https://github.com/m3ter-com/m3ter-sdk-java/commit/23e28b93c743ee33084c61ddf28d1835c2035989)) +* **client:** incorrect `Retry-After` parsing ([98eb243](https://github.com/m3ter-com/m3ter-sdk-java/commit/98eb243707f436021e407af224c6ee8b5cef68a7)) +* fix request delays for retrying to be more respectful of high requested delays ([4d30cf2](https://github.com/m3ter-com/m3ter-sdk-java/commit/4d30cf223b7fafed53efeefb8d71f6e16ba1e85c)) + + +### Performance Improvements + +* **client:** create one json mapper ([cc8caef](https://github.com/m3ter-com/m3ter-sdk-java/commit/cc8caef47f1f23bdb9148430a3d03c1d9f2be218)) + + +### Chores + +* **api:** minor updates ([772bc48](https://github.com/m3ter-com/m3ter-sdk-java/commit/772bc48f2a9baeba9b44a4ba82019dbd958536e3)) +* **ci:** skip lint on metadata-only changes ([51d499d](https://github.com/m3ter-com/m3ter-sdk-java/commit/51d499dbfbf91560bb9189f065af734e47db79a8)) +* **ci:** skip uploading artifacts on stainless-internal branches ([f2bbdf2](https://github.com/m3ter-com/m3ter-sdk-java/commit/f2bbdf2812298cda533417925fd5dee2a510c33a)) +* **docs:** add missing descriptions ([5f93a31](https://github.com/m3ter-com/m3ter-sdk-java/commit/5f93a31105cda6fe6fb174477d21ba8d1611ec9c)) +* drop apache dependency ([d009b12](https://github.com/m3ter-com/m3ter-sdk-java/commit/d009b1246a2a8bec2488a48a43bce4f8613834fa)) +* **internal:** allow passing args to `./scripts/test` ([8fe5d12](https://github.com/m3ter-com/m3ter-sdk-java/commit/8fe5d12d621bb65422e5986710c416a2a1c148c7)) +* **internal:** bump palantir-java-format ([d6c4fe1](https://github.com/m3ter-com/m3ter-sdk-java/commit/d6c4fe1d68920d0611108b9cc18b482e6efe44f6)) +* **internal:** codegen related update ([c542fc1](https://github.com/m3ter-com/m3ter-sdk-java/commit/c542fc1081f666d1b960614c97bd96664adcaf11)) +* **internal:** expand imports ([f21304b](https://github.com/m3ter-com/m3ter-sdk-java/commit/f21304b3bf5818a6b3780fd67f1e0eb714e1b72f)) +* **internal:** make `OkHttp` constructor internal ([4b5dd36](https://github.com/m3ter-com/m3ter-sdk-java/commit/4b5dd368200a2cde70f188942870496bb6751a98)) +* **internal:** tweak CI branches ([fafe209](https://github.com/m3ter-com/m3ter-sdk-java/commit/fafe209aac854fbf41b6505261ee9f5336116e32)) +* **internal:** update `TestServerExtension` comment ([ad05532](https://github.com/m3ter-com/m3ter-sdk-java/commit/ad0553241adc7bda3de9496b0bba3f22c1352150)) +* **internal:** update gitignore ([ba55586](https://github.com/m3ter-com/m3ter-sdk-java/commit/ba55586df3020053f77e852e8fb3fe230e05a1fd)) +* **internal:** update multipart form array serialization ([9547be4](https://github.com/m3ter-com/m3ter-sdk-java/commit/9547be40bc79fa2d261df2c4f2ece9e99c24e017)) +* **internal:** update retry delay tests ([2a9bbb0](https://github.com/m3ter-com/m3ter-sdk-java/commit/2a9bbb0136b800a4b79a41993c0e919f1899438f)) +* **internal:** upgrade AssertJ ([fea9d8f](https://github.com/m3ter-com/m3ter-sdk-java/commit/fea9d8f96052af844b1e0ff2901cb7c42a7f8e8e)) +* make `Properties` more resilient to `null` ([8edff6d](https://github.com/m3ter-com/m3ter-sdk-java/commit/8edff6d5b98722338fc7e9ac73e27327b2f168e5)) +* redact api-key headers in debug logs ([b4b1d00](https://github.com/m3ter-com/m3ter-sdk-java/commit/b4b1d00b21e00cbd38d4d2f2cb75c4e201a0a50a)) +* remove duplicated dokka setup ([15f81b8](https://github.com/m3ter-com/m3ter-sdk-java/commit/15f81b8f347c9f99eb47ba6acc7cc8c0bb2a9a7d)) +* **test:** do not count install time for mock server timeout ([16c7b01](https://github.com/m3ter-com/m3ter-sdk-java/commit/16c7b015ff0e76b7e74797156d627dd616e00131)) +* **tests:** bump steady to v0.19.4 ([c3e395b](https://github.com/m3ter-com/m3ter-sdk-java/commit/c3e395be4903bb486ccbf7aaaf871b8703e1d97a)) +* **tests:** bump steady to v0.19.5 ([59e2eef](https://github.com/m3ter-com/m3ter-sdk-java/commit/59e2eefaa12334d4880f4c79afbe6e163594dca7)) +* **tests:** bump steady to v0.19.6 ([8dbf4e9](https://github.com/m3ter-com/m3ter-sdk-java/commit/8dbf4e9963758678d779028fd42d813efd18caea)) +* **tests:** bump steady to v0.19.7 ([688e7f5](https://github.com/m3ter-com/m3ter-sdk-java/commit/688e7f5c117cb3aa6d3673cb624cee90f40fe10d)) +* **tests:** bump steady to v0.20.1 ([861f3b1](https://github.com/m3ter-com/m3ter-sdk-java/commit/861f3b1b1e6b3bd0ce23200363d9aebad2af402c)) +* **tests:** bump steady to v0.20.2 ([9b44f27](https://github.com/m3ter-com/m3ter-sdk-java/commit/9b44f279868a9da1de2be05b4f9254cf6a2d0bc4)) +* **tests:** bump steady to v0.22.1 ([d433325](https://github.com/m3ter-com/m3ter-sdk-java/commit/d43332544992320a0735fbbb3b9a2e507dbc6b0b)) + + +### Documentation + +* clarify forwards compat behavior ([d606f57](https://github.com/m3ter-com/m3ter-sdk-java/commit/d606f57d6f2d736abc4c3924765f49b8d48763ee)) +* simplify examples ([d36ba16](https://github.com/m3ter-com/m3ter-sdk-java/commit/d36ba162328c19f7083747dc9243992fbeea4dab)) + + +### Refactors + +* **tests:** switch from prism to steady ([84e83ad](https://github.com/m3ter-com/m3ter-sdk-java/commit/84e83adb56128782908a5d218c94c664173b16f8)) + ## 0.5.0 (2026-01-29) Full Changelog: [v0.4.0...v0.5.0](https://github.com/m3ter-com/m3ter-sdk-java/compare/v0.4.0...v0.5.0) diff --git a/README.md b/README.md index ceb13a6f..38188c6a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.m3ter/sdk-java)](https://central.sonatype.com/artifact/com.m3ter/sdk-java/0.5.0) -[![javadoc](https://javadoc.io/badge2/com.m3ter/sdk-java/0.5.0/javadoc.svg)](https://javadoc.io/doc/com.m3ter/sdk-java/0.5.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.m3ter/sdk-java)](https://central.sonatype.com/artifact/com.m3ter/sdk-java/0.6.0) +[![javadoc](https://javadoc.io/badge2/com.m3ter/sdk-java/0.6.0/javadoc.svg)](https://javadoc.io/doc/com.m3ter/sdk-java/0.6.0) @@ -11,18 +11,9 @@ The M3ter Java SDK provides convenient access to the [M3ter REST API](https://ww It is generated with [Stainless](https://www.stainless.com/). -## MCP Server - -Use the M3ter MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. - -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=m3ter-sdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm0zdGVyLXNkay1tY3AiXSwiZW52Ijp7Ik0zVEVSX0FQSV9LRVkiOiJNeSBBUEkgS2V5IiwiTTNURVJfQVBJX1NFQ1JFVCI6Ik15IEFQSSBTZWNyZXQiLCJNM1RFUl9BUElfVE9LRU4iOiJNeSBUb2tlbiIsIk0zVEVSX09SR19JRCI6Ik15IE9yZyBJRCJ9fQ) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22m3ter-sdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22m3ter-sdk-mcp%22%5D%2C%22env%22%3A%7B%22M3TER_API_KEY%22%3A%22My%20API%20Key%22%2C%22M3TER_API_SECRET%22%3A%22My%20API%20Secret%22%2C%22M3TER_API_TOKEN%22%3A%22My%20Token%22%2C%22M3TER_ORG_ID%22%3A%22My%20Org%20ID%22%7D%7D) - -> Note: You may need to set environment variables in your MCP client. - -The REST API documentation can be found on [www.m3ter.com](https://www.m3ter.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.m3ter/sdk-java/0.5.0). +The REST API documentation can be found on [www.m3ter.com](https://www.m3ter.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.m3ter/sdk-java/0.6.0). @@ -33,7 +24,7 @@ The REST API documentation can be found on [www.m3ter.com](https://www.m3ter.com ### Gradle ```kotlin -implementation("com.m3ter:sdk-java:0.5.0") +implementation("com.m3ter:sdk-java:0.6.0") ``` ### Maven @@ -42,7 +33,7 @@ implementation("com.m3ter:sdk-java:0.5.0") com.m3ter sdk-java - 0.5.0 + 0.6.0 ``` @@ -64,10 +55,7 @@ import com.m3ter.models.ProductListParams; // Or configures using the `M3TER_API_KEY`, `M3TER_API_SECRET`, `M3TER_API_TOKEN`, `M3TER_ORG_ID` and `M3TER_BASE_URL` environment variables M3terClient client = M3terOkHttpClient.fromEnv(); -ProductListParams params = ProductListParams.builder() - .orgId("My Org ID") - .build(); -ProductListPage page = client.products().list(params); +ProductListPage page = client.products().list(); ``` ## Client configuration @@ -170,10 +158,7 @@ import java.util.concurrent.CompletableFuture; // Or configures using the `M3TER_API_KEY`, `M3TER_API_SECRET`, `M3TER_API_TOKEN`, `M3TER_ORG_ID` and `M3TER_BASE_URL` environment variables M3terClient client = M3terOkHttpClient.fromEnv(); -ProductListParams params = ProductListParams.builder() - .orgId("My Org ID") - .build(); -CompletableFuture page = client.async().products().list(params); +CompletableFuture page = client.async().products().list(); ``` Or create an asynchronous client from the beginning: @@ -189,10 +174,7 @@ import java.util.concurrent.CompletableFuture; // Or configures using the `M3TER_API_KEY`, `M3TER_API_SECRET`, `M3TER_API_TOKEN`, `M3TER_ORG_ID` and `M3TER_BASE_URL` environment variables M3terClientAsync client = M3terOkHttpClientAsync.fromEnv(); -ProductListParams params = ProductListParams.builder() - .orgId("My Org ID") - .build(); -CompletableFuture page = client.products().list(params); +CompletableFuture page = client.products().list(); ``` The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s. @@ -353,8 +335,6 @@ while (true) { ## Logging -The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). - Enable logging by setting the `M3TER_LOG` environment variable to `info`: ```sh @@ -367,6 +347,19 @@ Or to `debug` for more verbose logging: export M3TER_LOG=debug ``` +Or configure the client manually using the `logLevel` method: + +```java +import com.m3ter.client.M3terClient; +import com.m3ter.client.okhttp.M3terOkHttpClient; +import com.m3ter.core.LogLevel; + +M3terClient client = M3terOkHttpClient.builder() + .fromEnv() + .logLevel(LogLevel.INFO) + .build(); +``` + ## ProGuard and R8 Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `sdk-java-core` is published with a [configuration file](sdk-java-core/src/main/resources/META-INF/proguard/sdk-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). @@ -459,6 +452,40 @@ M3terClient client = M3terOkHttpClient.builder() .build(); ``` +If the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`: + +```java +import com.m3ter.client.M3terClient; +import com.m3ter.client.okhttp.M3terOkHttpClient; +import com.m3ter.core.http.ProxyAuthenticator; + +M3terClient client = M3terOkHttpClient.builder() + .fromEnv() + .proxy(...) + // Or a custom implementation of `ProxyAuthenticator`. + .proxyAuthenticator(ProxyAuthenticator.basic("username", "password")) + .build(); +``` + +### Connection pooling + +To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods: + +```java +import com.m3ter.client.M3terClient; +import com.m3ter.client.okhttp.M3terOkHttpClient; +import java.time.Duration; + +M3terClient client = M3terOkHttpClient.builder() + .fromEnv() + // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa. + .maxIdleConnections(10) + .keepAliveDuration(Duration.ofMinutes(2)) + .build(); +``` + +If both options are unset, OkHttp's default connection pool settings are used. + ### HTTPS > [!NOTE] @@ -676,7 +703,9 @@ In rare cases, the API may return a response that doesn't match the expected typ By default, the SDK will not throw an exception in this case. It will throw [`M3terInvalidDataException`](sdk-java-core/src/main/kotlin/com/m3ter/errors/M3terInvalidDataException.kt) only if you directly access the property. -If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: +Validating the response is _not_ forwards compatible with new types from the API for existing fields. + +If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java import com.m3ter.models.AuthenticationGetBearerTokenResponse; diff --git a/build.gradle.kts b/build.gradle.kts index b03c5bff..12a47af9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ repositories { allprojects { group = "com.m3ter" - version = "0.5.0" // x-release-please-version + version = "0.6.0" // x-release-please-version } subprojects { @@ -22,7 +22,6 @@ subprojects { group = "Verification" description = "Verifies all source files are formatted." } - apply(plugin = "org.jetbrains.dokka") } subprojects { diff --git a/buildSrc/src/main/kotlin/m3ter.java.gradle.kts b/buildSrc/src/main/kotlin/m3ter.java.gradle.kts index 70fc33f4..8f4f902a 100644 --- a/buildSrc/src/main/kotlin/m3ter.java.gradle.kts +++ b/buildSrc/src/main/kotlin/m3ter.java.gradle.kts @@ -45,7 +45,7 @@ tasks.withType().configureEach { val palantir by configurations.creating dependencies { - palantir("com.palantir.javaformat:palantir-java-format:2.73.0") + palantir("com.palantir.javaformat:palantir-java-format:2.89.0") } fun registerPalantir( diff --git a/buildSrc/src/main/kotlin/m3ter.kotlin.gradle.kts b/buildSrc/src/main/kotlin/m3ter.kotlin.gradle.kts index 5d32ad69..e708588c 100644 --- a/buildSrc/src/main/kotlin/m3ter.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/m3ter.kotlin.gradle.kts @@ -40,7 +40,7 @@ tasks.withType().configureEach { val ktfmt by configurations.creating dependencies { - ktfmt("com.facebook:ktfmt:0.56") + ktfmt("com.facebook:ktfmt:0.61") } fun registerKtfmt( diff --git a/scripts/build b/scripts/build index f4063482..16a2b00d 100755 --- a/scripts/build +++ b/scripts/build @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Building classes" -./gradlew build testClasses -x test +./gradlew build testClasses "$@" -x test diff --git a/scripts/fast-format b/scripts/fast-format index 1b3bc473..35a1dee2 100755 --- a/scripts/fast-format +++ b/scripts/fast-format @@ -24,8 +24,8 @@ if [ ! -f "$FILE_LIST" ]; then exit 1 fi -if ! command -v ktfmt-fast-format &> /dev/null; then - echo "Error: ktfmt-fast-format not found" +if ! command -v ktfmt &> /dev/null; then + echo "Error: ktfmt not found" exit 1 fi @@ -36,7 +36,7 @@ echo "==> Done looking for Kotlin files" if [[ -n "$kt_files" ]]; then echo "==> will format Kotlin files" - echo "$kt_files" | tr '\n' '\0' | xargs -0 ktfmt-fast-format --kotlinlang-style "$@" + echo "$kt_files" | tr '\n' '\0' | xargs -0 ktfmt --kotlinlang-style "$@" else echo "No Kotlin files to format -- expected outcome during incremental formatting" fi diff --git a/scripts/mock b/scripts/mock index 0b28f6ea..feebe5ed 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,23 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stdy/cli@0.22.1 -- steady --version - # Wait for server to come online + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=0 + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Steady server to start" + cat .stdy.log + exit 1 + fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 047bc1db..7d7f08e3 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/sdk-java-client-okhttp/build.gradle.kts b/sdk-java-client-okhttp/build.gradle.kts index 9f4bcb92..b382f77e 100644 --- a/sdk-java-client-okhttp/build.gradle.kts +++ b/sdk-java-client-okhttp/build.gradle.kts @@ -7,9 +7,8 @@ dependencies { api(project(":sdk-java-core")) implementation("com.squareup.okhttp3:okhttp:4.12.0") - implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") testImplementation(kotlin("test")) - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") } diff --git a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClient.kt b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClient.kt index 6ed7a701..4be72191 100644 --- a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClient.kt +++ b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClient.kt @@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.m3ter.client.M3terClient import com.m3ter.client.M3terClientImpl import com.m3ter.core.ClientOptions +import com.m3ter.core.LogLevel import com.m3ter.core.Sleeper import com.m3ter.core.Timeout import com.m3ter.core.http.AsyncStreamResponse import com.m3ter.core.http.Headers import com.m3ter.core.http.HttpClient +import com.m3ter.core.http.ProxyAuthenticator import com.m3ter.core.http.QueryParams import com.m3ter.core.jsonMapper import java.net.Proxy @@ -49,6 +51,9 @@ class M3terOkHttpClient private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null + private var maxIdleConnections: Int? = null + private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null private var trustManager: X509TrustManager? = null private var hostnameVerifier: HostnameVerifier? = null @@ -77,6 +82,60 @@ class M3terOkHttpClient private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + + /** + * The maximum number of idle connections kept by the underlying OkHttp connection pool. + * + * If this is set, then [keepAliveDuration] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun maxIdleConnections(maxIdleConnections: Int?) = apply { + this.maxIdleConnections = maxIdleConnections + } + + /** + * Alias for [Builder.maxIdleConnections]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun maxIdleConnections(maxIdleConnections: Int) = + maxIdleConnections(maxIdleConnections as Int?) + + /** + * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`. + */ + fun maxIdleConnections(maxIdleConnections: Optional) = + maxIdleConnections(maxIdleConnections.getOrNull()) + + /** + * The keep-alive duration for idle connections in the underlying OkHttp connection pool. + * + * If this is set, then [maxIdleConnections] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun keepAliveDuration(keepAliveDuration: Duration?) = apply { + this.keepAliveDuration = keepAliveDuration + } + + /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */ + fun keepAliveDuration(keepAliveDuration: Optional) = + keepAliveDuration(keepAliveDuration.getOrNull()) + /** * The socket factory used to secure HTTPS connections. * @@ -188,6 +247,9 @@ class M3terOkHttpClient private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -229,6 +291,15 @@ class M3terOkHttpClient private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun apiSecret(apiSecret: String) = apply { clientOptions.apiSecret(apiSecret) } @@ -339,6 +410,9 @@ class M3terOkHttpClient private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) + .maxIdleConnections(maxIdleConnections) + .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) .sslSocketFactory(sslSocketFactory) .trustManager(trustManager) diff --git a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClientAsync.kt b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClientAsync.kt index 949642e6..cda41a1f 100644 --- a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClientAsync.kt +++ b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/M3terOkHttpClientAsync.kt @@ -6,11 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.m3ter.client.M3terClientAsync import com.m3ter.client.M3terClientAsyncImpl import com.m3ter.core.ClientOptions +import com.m3ter.core.LogLevel import com.m3ter.core.Sleeper import com.m3ter.core.Timeout import com.m3ter.core.http.AsyncStreamResponse import com.m3ter.core.http.Headers import com.m3ter.core.http.HttpClient +import com.m3ter.core.http.ProxyAuthenticator import com.m3ter.core.http.QueryParams import com.m3ter.core.jsonMapper import java.net.Proxy @@ -49,6 +51,9 @@ class M3terOkHttpClientAsync private constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var dispatcherExecutorService: ExecutorService? = null private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null + private var maxIdleConnections: Int? = null + private var keepAliveDuration: Duration? = null private var sslSocketFactory: SSLSocketFactory? = null private var trustManager: X509TrustManager? = null private var hostnameVerifier: HostnameVerifier? = null @@ -77,6 +82,60 @@ class M3terOkHttpClientAsync private constructor() { /** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */ fun proxy(proxy: Optional) = proxy(proxy.getOrNull()) + /** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication + * Required`. + */ + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Alias for calling [Builder.proxyAuthenticator] with `proxyAuthenticator.orElse(null)`. + */ + fun proxyAuthenticator(proxyAuthenticator: Optional) = + proxyAuthenticator(proxyAuthenticator.getOrNull()) + + /** + * The maximum number of idle connections kept by the underlying OkHttp connection pool. + * + * If this is set, then [keepAliveDuration] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun maxIdleConnections(maxIdleConnections: Int?) = apply { + this.maxIdleConnections = maxIdleConnections + } + + /** + * Alias for [Builder.maxIdleConnections]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun maxIdleConnections(maxIdleConnections: Int) = + maxIdleConnections(maxIdleConnections as Int?) + + /** + * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`. + */ + fun maxIdleConnections(maxIdleConnections: Optional) = + maxIdleConnections(maxIdleConnections.getOrNull()) + + /** + * The keep-alive duration for idle connections in the underlying OkHttp connection pool. + * + * If this is set, then [maxIdleConnections] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun keepAliveDuration(keepAliveDuration: Duration?) = apply { + this.keepAliveDuration = keepAliveDuration + } + + /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */ + fun keepAliveDuration(keepAliveDuration: Optional) = + keepAliveDuration(keepAliveDuration.getOrNull()) + /** * The socket factory used to secure HTTPS connections. * @@ -188,6 +247,9 @@ class M3terOkHttpClientAsync private constructor() { /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -229,6 +291,15 @@ class M3terOkHttpClientAsync private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { clientOptions.logLevel(logLevel) } + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun apiSecret(apiSecret: String) = apply { clientOptions.apiSecret(apiSecret) } @@ -339,6 +410,9 @@ class M3terOkHttpClientAsync private constructor() { OkHttpClient.builder() .timeout(clientOptions.timeout()) .proxy(proxy) + .proxyAuthenticator(proxyAuthenticator) + .maxIdleConnections(maxIdleConnections) + .keepAliveDuration(keepAliveDuration) .dispatcherExecutorService(dispatcherExecutorService) .sslSocketFactory(sslSocketFactory) .trustManager(trustManager) diff --git a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/OkHttpClient.kt b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/OkHttpClient.kt index 28b81636..e70819cd 100644 --- a/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/OkHttpClient.kt +++ b/sdk-java-client-okhttp/src/main/kotlin/com/m3ter/client/okhttp/OkHttpClient.kt @@ -8,20 +8,26 @@ import com.m3ter.core.http.HttpMethod import com.m3ter.core.http.HttpRequest import com.m3ter.core.http.HttpRequestBody import com.m3ter.core.http.HttpResponse +import com.m3ter.core.http.ProxyAuthenticator import com.m3ter.errors.M3terIoException import java.io.IOException import java.io.InputStream +import java.io.OutputStream import java.net.Proxy import java.time.Duration import java.util.concurrent.CancellationException import java.util.concurrent.CompletableFuture import java.util.concurrent.ExecutorService +import java.util.concurrent.TimeUnit import javax.net.ssl.HostnameVerifier import javax.net.ssl.SSLSocketFactory import javax.net.ssl.X509TrustManager +import kotlin.jvm.optionals.getOrNull import okhttp3.Call import okhttp3.Callback +import okhttp3.ConnectionPool import okhttp3.Dispatcher +import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.MediaType import okhttp3.MediaType.Companion.toMediaType @@ -29,17 +35,18 @@ import okhttp3.Request import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response -import okhttp3.logging.HttpLoggingInterceptor import okio.BufferedSink +import okio.buffer +import okio.sink class OkHttpClient -private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient { +internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient { override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { val call = newCall(request, requestOptions) return try { - call.execute().toResponse() + call.execute().toHttpResponse() } catch (e: IOException) { throw M3terIoException("Request failed", e) } finally { @@ -57,7 +64,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien call.enqueue( object : Callback { override fun onResponse(call: Call, response: Response) { - future.complete(response.toResponse()) + future.complete(response.toHttpResponse()) } override fun onFailure(call: Call, e: IOException) { @@ -85,18 +92,6 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call { val clientBuilder = okHttpClient.newBuilder() - val logLevel = - when (System.getenv("M3TER_LOG")?.lowercase()) { - "info" -> HttpLoggingInterceptor.Level.BASIC - "debug" -> HttpLoggingInterceptor.Level.BODY - else -> null - } - if (logLevel != null) { - clientBuilder.addNetworkInterceptor( - HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } - ) - } - requestOptions.timeout?.let { clientBuilder .connectTimeout(it.connect()) @@ -109,89 +104,6 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien return client.newCall(request.toRequest(client)) } - private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { - var body: RequestBody? = body?.toRequestBody() - if (body == null && requiresBody(method)) { - body = "".toRequestBody() - } - - val builder = Request.Builder().url(toUrl()).method(method.name, body) - headers.names().forEach { name -> - headers.values(name).forEach { builder.addHeader(name, it) } - } - - if ( - !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 - ) { - builder.addHeader( - "X-Stainless-Read-Timeout", - Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), - ) - } - if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { - builder.addHeader( - "X-Stainless-Timeout", - Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), - ) - } - - return builder.build() - } - - /** `OkHttpClient` always requires a request body for some methods. */ - private fun requiresBody(method: HttpMethod): Boolean = - when (method) { - HttpMethod.POST, - HttpMethod.PUT, - HttpMethod.PATCH -> true - else -> false - } - - private fun HttpRequest.toUrl(): String { - val builder = baseUrl.toHttpUrl().newBuilder() - pathSegments.forEach(builder::addPathSegment) - queryParams.keys().forEach { key -> - queryParams.values(key).forEach { builder.addQueryParameter(key, it) } - } - - return builder.toString() - } - - private fun HttpRequestBody.toRequestBody(): RequestBody { - val mediaType = contentType()?.toMediaType() - val length = contentLength() - - return object : RequestBody() { - override fun contentType(): MediaType? = mediaType - - override fun contentLength(): Long = length - - override fun isOneShot(): Boolean = !repeatable() - - override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) - } - } - - private fun Response.toResponse(): HttpResponse { - val headers = headers.toHeaders() - - return object : HttpResponse { - override fun statusCode(): Int = code - - override fun headers(): Headers = headers - - override fun body(): InputStream = body!!.byteStream() - - override fun close() = body!!.close() - } - } - - private fun okhttp3.Headers.toHeaders(): Headers { - val headersBuilder = Headers.builder() - forEach { (name, value) -> headersBuilder.put(name, value) } - return headersBuilder.build() - } - companion object { @JvmStatic fun builder() = Builder() } @@ -200,6 +112,9 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien private var timeout: Timeout = Timeout.default() private var proxy: Proxy? = null + private var proxyAuthenticator: ProxyAuthenticator? = null + private var maxIdleConnections: Int? = null + private var keepAliveDuration: Duration? = null private var dispatcherExecutorService: ExecutorService? = null private var sslSocketFactory: SSLSocketFactory? = null private var trustManager: X509TrustManager? = null @@ -211,6 +126,32 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien fun proxy(proxy: Proxy?) = apply { this.proxy = proxy } + fun proxyAuthenticator(proxyAuthenticator: ProxyAuthenticator?) = apply { + this.proxyAuthenticator = proxyAuthenticator + } + + /** + * Sets the maximum number of idle connections kept by the underlying [ConnectionPool]. + * + * If this is set, then [keepAliveDuration] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun maxIdleConnections(maxIdleConnections: Int?) = apply { + this.maxIdleConnections = maxIdleConnections + } + + /** + * Sets the keep-alive duration for idle connections in the underlying [ConnectionPool]. + * + * If this is set, then [maxIdleConnections] must also be set. + * + * If unset, then OkHttp's default is used. + */ + fun keepAliveDuration(keepAliveDuration: Duration?) = apply { + this.keepAliveDuration = keepAliveDuration + } + fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply { this.dispatcherExecutorService = dispatcherExecutorService } @@ -238,8 +179,37 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien .callTimeout(timeout.request()) .proxy(proxy) .apply { + proxyAuthenticator?.let { auth -> + proxyAuthenticator { route, response -> + auth + .authenticate( + route?.proxy ?: Proxy.NO_PROXY, + response.request.toHttpRequest(), + response.toHttpResponse(), + ) + .getOrNull() + ?.toRequest(client = null) + } + } + dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) } + val maxIdleConnections = maxIdleConnections + val keepAliveDuration = keepAliveDuration + if (maxIdleConnections != null && keepAliveDuration != null) { + connectionPool( + ConnectionPool( + maxIdleConnections, + keepAliveDuration.toNanos(), + TimeUnit.NANOSECONDS, + ) + ) + } else { + check((maxIdleConnections != null) == (keepAliveDuration != null)) { + "Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set" + } + } + val sslSocketFactory = sslSocketFactory val trustManager = trustManager if (sslSocketFactory != null && trustManager != null) { @@ -261,3 +231,126 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien ) } } + +private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient?): Request { + var body: RequestBody? = body?.toRequestBody() + if (body == null && requiresBody(method)) { + body = "".toRequestBody() + } + + val builder = Request.Builder().url(toUrl()).method(method.name, body) + headers.names().forEach { name -> headers.values(name).forEach { builder.addHeader(name, it) } } + + if (client != null) { + if ( + !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 + ) { + builder.addHeader( + "X-Stainless-Read-Timeout", + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), + ) + } + if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { + builder.addHeader( + "X-Stainless-Timeout", + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), + ) + } + } + + return builder.build() +} + +/** `OkHttpClient` always requires a request body for some methods. */ +private fun requiresBody(method: HttpMethod): Boolean = + when (method) { + HttpMethod.POST, + HttpMethod.PUT, + HttpMethod.PATCH -> true + else -> false + } + +private fun HttpRequest.toUrl(): String { + val builder = baseUrl.toHttpUrl().newBuilder() + pathSegments.forEach(builder::addPathSegment) + queryParams.keys().forEach { key -> + queryParams.values(key).forEach { builder.addQueryParameter(key, it) } + } + + return builder.toString() +} + +private fun HttpRequestBody.toRequestBody(): RequestBody { + val mediaType = contentType()?.toMediaType() + val length = contentLength() + + return object : RequestBody() { + override fun contentType(): MediaType? = mediaType + + override fun contentLength(): Long = length + + override fun isOneShot(): Boolean = !repeatable() + + override fun writeTo(sink: BufferedSink) = writeTo(sink.outputStream()) + } +} + +private fun Request.toHttpRequest(): HttpRequest { + val builder = HttpRequest.builder().method(HttpMethod.valueOf(method)).baseUrl(url.toBaseUrl()) + url.pathSegments.forEach(builder::addPathSegment) + url.queryParameterNames.forEach { name -> + url.queryParameterValues(name).filterNotNull().forEach { builder.putQueryParam(name, it) } + } + headers.forEach { (name, value) -> builder.putHeader(name, value) } + body?.let { builder.body(it.toHttpRequestBody()) } + return builder.build() +} + +private fun HttpUrl.toBaseUrl(): String = buildString { + append(scheme).append("://").append(host) + if (port != HttpUrl.defaultPort(scheme)) { + append(":").append(port) + } +} + +private fun RequestBody.toHttpRequestBody(): HttpRequestBody { + val mediaType = contentType()?.toString() + val length = contentLength() + val isOneShot = isOneShot() + val source = this + return object : HttpRequestBody { + override fun contentType(): String? = mediaType + + override fun contentLength(): Long = length + + override fun repeatable(): Boolean = !isOneShot + + override fun writeTo(outputStream: OutputStream) { + val sink = outputStream.sink().buffer() + source.writeTo(sink) + sink.flush() + } + + override fun close() {} + } +} + +private fun Response.toHttpResponse(): HttpResponse { + val headers = headers.toHeaders() + + return object : HttpResponse { + override fun statusCode(): Int = code + + override fun headers(): Headers = headers + + override fun body(): InputStream = body!!.byteStream() + + override fun close() = body!!.close() + } +} + +private fun okhttp3.Headers.toHeaders(): Headers { + val headersBuilder = Headers.builder() + forEach { (name, value) -> headersBuilder.put(name, value) } + return headersBuilder.build() +} diff --git a/sdk-java-core/build.gradle.kts b/sdk-java-core/build.gradle.kts index ee0a27c2..342e4823 100644 --- a/sdk-java-core/build.gradle.kts +++ b/sdk-java-core/build.gradle.kts @@ -27,13 +27,11 @@ dependencies { implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2") implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2") implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2") - implementation("org.apache.httpcomponents.core5:httpcore5:5.2.4") - implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1") testImplementation(kotlin("test")) testImplementation(project(":sdk-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3") testImplementation("org.junit-pioneer:junit-pioneer:1.9.1") diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClient.kt b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClient.kt index 20f7e134..0f407417 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClient.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClient.kt @@ -82,86 +82,937 @@ interface M3terClient { */ fun withOptions(modifier: Consumer): M3terClient + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ fun authentication(): AuthenticationService + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than + * one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but + * not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can + * then set up billing for the Parent/Child Account usage to have the end-customer billed once + * for the Parent Account, instead of having separate bills issued for usage against each of + * their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that only the ``name``, ``address``, or ``emailAddress`` fields contain any + * end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ fun accounts(): AccountService + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, + * list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create + * an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create + * the Plan Group, you define an overall minimum spend and then add any priced Plans you want to + * include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account + * that consumes the separate Products which are priced using the included Plans. At billing, + * the minimum spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product + * can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of + * the Plan Groups contain a Plan belonging to the same Product. If you try to attach a + * Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would + * overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ fun accountPlans(): AccountPlanService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted + * Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical or + * business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation + * to them to derive pricing metrics needed to serve more complex usage-based pricing + * scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing + * and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ fun aggregations(): AggregationService + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ fun balances(): BalanceService + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun bills(): BillService + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - + * any Bill with a service period end date on or before the set date will be locked and cannot + * be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the + * specified lock date, then you'll receive an error. + */ fun billConfig(): BillConfigService + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed + * to pay a fixed minimum amount throughout the contract period. ***The commitment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use + * them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming + * your product or services across a full contract term. A customer might pay the entire or only + * part of the agreed amount upfront, but ***the prepayment amount is payable regardless of the + * actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit on + * an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the + * customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ fun commitments(): CommitmentService + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the Bill + * is showing correctly for the charges due on the new usage data. + */ fun billJobs(): BillJobService + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill + * date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ fun charges(): ChargeService + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures can + * then be used as pricing metrics to price your Product Plans, enabling you to implement a wide + * range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and + * any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the + * same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any + * Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity + * per unit** defined or a **Rounding** defined, these will not be factored into the value used + * by the calculation. For example, if the simple Aggregation referenced has a base value of 100 + * and has **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the + * base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ fun compoundAggregations(): CompoundAggregationService + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used + * for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ fun contracts(): ContractService + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or Plan + * Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ fun counters(): CounterService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to ensure + * the Account is billed according to the number of Counter units the Account subscribes to in a + * given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ fun counterAdjustments(): CounterAdjustmentService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ fun counterPricings(): CounterPricingService + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit + * line item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ fun creditReasons(): CreditReasonService + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities + * such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides + * any currency settings in your pricing Plans. For example, if the Organization currency is set + * to USD and a pricing Plan used for an Account is set to GBP, the bill for an Account using + * that Plan is calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ fun currencies(): CurrencyService + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of + * the m3ter platform. Having this capability to store data in a free-hand fashion can prove + * very useful in helping you to meet specific usage-based pricing and other operational + * business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key role + * these calculations can play when implementing usage-based pricing schema, any Custom Fields + * you reference will then affect how the platform behaves. Referencing Custom Field values in + * your calculations offers a much wider scope of options when it comes to resolving complex + * usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to + * also add a Custom Field of the same name at the corresponding individual entity level. If + * you reference the Custom Field in a calculation, the value for the individual entity level + * field is used. If no field is defined at individual entity level, then the Organization + * level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization + * level Meter Custom Field will always be used*, even if you have defined a corresponding field + * at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ fun customFields(): CustomFieldService + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports + * to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun dataExports(): DataExportService + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit + * line item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ fun debitReasons(): DebitReasonService + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation + * of a new Prepayment/Commitment for an Account. Each Event is classified under an Event Type + * framework, providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated + * for a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to create + * and configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, + * which you can set up by referencing Date/Time fields on configuration and billing entities. + * See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent + * out via webhooks when the Event occurs and any conditions you've built into the Notification + * rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by + * the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ fun events(): EventService + /** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities + * in the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the + * local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at + * a later date, edit or delete them. + */ fun externalMappings(): ExternalMappingService + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun integrationConfigurations(): IntegrationConfigurationService + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. + * Use them for currency conversion, pricing tiers, discount rates, and similar scenarios where + * you require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables + * have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTables(): LookupTableService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that any fields you configure for Meters, such as Data Fields or Derived Fields, do + * not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ fun meters(): MeterService + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base + * a Notification on a specific Event type, you can include a calculation that references the + * fields available on that Event type to define precise conditions that must be met for the + * Notification to be triggered when an Event of that type occurs. In this way, you can set up + * highly customized Notifications that act as timely alerts to inform you about significant + * occurrences within your Organization. For instance, if you provide a sign-up bonus to new + * end-customer Accounts, you can set up a Notification to alert you when an end-customer + * Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ fun notificationConfigurations(): NotificationConfigurationService + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ fun organizationConfig(): OrganizationConfigService + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables you + * to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ fun permissionPolicies(): PermissionPolicyService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure from + * its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or more + * of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ fun plans(): PlanService + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach + * to efficiently handle various uses cases across different plans. For example applying a + * minimum spend amount at billing, across several of your products or features that are each + * priced separately. + */ fun planGroups(): PlanGroupService + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ fun planGroupLinks(): PlanGroupLinkService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ only in + * the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ fun planTemplates(): PlanTemplateService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ fun pricings(): PricingService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act + * as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ fun products(): ProductService + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who + * has been given access to your Organization can and cannot do. For example, you might want to + * create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned + * to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is + * useful for cases where you want to create Permission Policies which allow or deny access to a + * specific subset of resources. For example, grant a user access to only some of the Plans in + * your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies of + * groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs to. + * For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ fun resourceGroups(): ResourceGroupService + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ fun scheduledEventConfigurations(): ScheduledEventConfigurationService + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun statements(): StatementService + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating + * and updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ fun transactionTypes(): TransactionTypeService fun usage(): UsageService fun users(): UserService + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun webhooks(): WebhookService /** @@ -187,86 +1038,945 @@ interface M3terClient { */ fun withOptions(modifier: Consumer): M3terClient.WithRawResponse + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ fun authentication(): AuthenticationService.WithRawResponse + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more + * than one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount + * but not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You + * can then set up billing for the Parent/Child Account usage to have the end-customer + * billed once for the Parent Account, instead of having separate bills issued for usage + * against each of their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that only the ``name``, ``address``, or ``emailAddress`` fields + * contain any end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + */ fun accounts(): AccountService.WithRawResponse + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, + * update, list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is + * for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create + * separate AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to + * create an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount + * at billing across several of your Products each of which are priced separately - when you + * create the Plan Group, you define an overall minimum spend and then add any priced Plans + * you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan + * Group to an Account that consumes the separate Products which are priced using the + * included Plans. At billing, the minimum spend you've defined for the Plan Group is + * applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which + * the Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for + * more details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can + * only be attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan + * where a `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account + * to create multiple AccountPlanGroups, but the rule that *only one attached Plan per + * Product can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none + * of the Plan Groups contain a Plan belonging to the same Product. If you try to + * attach a Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account + * would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ fun accountPlans(): AccountPlanService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. + * You define the method of aggregation used to convert the usage data collected by the + * targeted Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical + * or business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted + * with [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A + * Compound Aggregation typically references one or more simple Aggregations and applies a + * calculation to them to derive pricing metrics needed to serve more complex usage-based + * pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some + * pricing and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ fun aggregations(): AggregationService.WithRawResponse + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ fun balances(): BalanceService.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun bills(): BillService.WithRawResponse + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** + * Bills - any Bill with a service period end date on or before the set date will be locked + * and cannot be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when + * there remains Bills in a *Pending* state whose service period end date is on or before + * the specified lock date, then you'll receive an error. + */ fun billConfig(): BillConfigService.WithRawResponse + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of + * usage-based pricing and billing. A Commitment represents an agreement where the + * end-customer has agreed to pay a fixed minimum amount throughout the contract period. + * ***The commitment amount is payable regardless of the actual usage by the customer of + * your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. + * Use them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account + * at billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed + * the agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for + * consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the prepayment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit + * on an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer + * contract period, you can choose one of two options for billing the outstanding fees due + * on the customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ fun commitments(): CommitmentService.WithRawResponse + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous + * mechanisms to calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the + * Bill is showing correctly for the charges due on the new usage data. + */ fun billJobs(): BillJobService.WithRawResponse + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge + * bill date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ fun charges(): ChargeService.WithRawResponse + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures + * can then be used as pricing metrics to price your Product Plans, enabling you to + * implement a wide range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to + * any Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations + * and any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to + * the same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and + * any Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a + * **Quantity per unit** defined or a **Rounding** defined, these will not be factored into + * the value used by the calculation. For example, if the simple Aggregation referenced has + * a base value of 100 and has **Quantity per unit** set at 10, the Compound Aggregation + * calculation *will use the base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ fun compoundAggregations(): CompoundAggregationService.WithRawResponse + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be + * used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you + * can report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked + * to Contracts on the Account to meet your specific Contract billing use cases. + */ fun contracts(): ContractService.WithRawResponse + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or + * Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ fun counters(): CounterService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to + * ensure the Account is billed according to the number of Counter units the Account + * subscribes to in a given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ fun counterAdjustments(): CounterAdjustmentService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a + * unit-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ fun counterPricings(): CounterPricingService.WithRawResponse + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a + * credit line item on a bill, or applying a product credit to a bill. CreditReasons provide + * contextual information as to why a credit was applied. + */ fun creditReasons(): CreditReasonService.WithRawResponse + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies + * are stored for your Organization, and can then be used to specify currencies on various + * entities such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and + * overrides any currency settings in your pricing Plans. For example, if the Organization + * currency is set to USD and a pricing Plan used for an Account is set to GBP, the bill for + * an Account using that Plan is calculated in GBP, and then each bill line item converted + * to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ fun currencies(): CurrencyService.WithRawResponse + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string + * values against m3ter entities in a way that does not directly affect the normal working + * operation of the m3ter platform. Having this capability to store data in a free-hand + * fashion can prove very useful in helping you to meet specific usage-based pricing and + * other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key + * role these calculations can play when implementing usage-based pricing schema, any Custom + * Fields you reference will then affect how the platform behaves. Referencing Custom Field + * values in your calculations offers a much wider scope of options when it comes to + * resolving complex usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual + * entity level. + * - The Organizational level field provides a default value and *must be added* if you want + * to also add a Custom Field of the same name at the corresponding individual entity + * level. If you reference the Custom Field in a calculation, the value for the individual + * entity level field is used. If no field is defined at individual entity level, then the + * Organization level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at + * the Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the + * *Organization level Meter Custom Field will always be used*, even if you have defined a + * corresponding field at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ fun customFields(): CustomFieldService.WithRawResponse + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc + * Exports to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun dataExports(): DataExportService.WithRawResponse + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a + * debit line item on a bill, or applying a product debit to a bill. DebitReasons provide + * contextual information as to why a debit was applied. + */ fun debitReasons(): DebitReasonService.WithRawResponse + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the + * creation of a new Prepayment/Commitment for an Account. Each Event is classified under an + * Event Type framework, providing context about what kind of change occurred to generate + * the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is + * generated for a state change of one of these objects - for when the configuration or + * billing object is **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to + * create and configure *Scheduled Event Configurations*. Scheduled Events are custom Event + * types, which you can set up by referencing Date/Time fields on configuration and billing + * entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be + * sent out via webhooks when the Event occurs and any conditions you've built into the + * Notification rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for + * more details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered + * by the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ fun events(): EventService.WithRawResponse + /** + * Endpoints for managing External Mapping related operations such as creation, update, list + * and delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between + * entities in the local system *(m3ter)* and external systems is constructed. This + * *External Mapping* is crucial in scenarios where data from external systems is consumed + * or where data from the local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually + * and, at a later date, edit or delete them. + */ fun externalMappings(): ExternalMappingService.WithRawResponse + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun integrationConfigurations(): IntegrationConfigurationService.WithRawResponse + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations + * reference. Use them for currency conversion, pricing tiers, discount rates, and similar + * scenarios where you require values to change operationally but for calculation logic to + * remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTables(): LookupTableService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for + * your products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields + * for Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values + * or non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter + * as name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that any fields you configure for Meters, such as Data Fields or + * Derived Fields, do not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ fun meters(): MeterService.WithRawResponse + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you + * base a Notification on a specific Event type, you can include a calculation that + * references the fields available on that Event type to define precise conditions that must + * be met for the Notification to be triggered when an Event of that type occurs. In this + * way, you can set up highly customized Notifications that act as timely alerts to inform + * you about significant occurrences within your Organization. For instance, if you provide + * a sign-up bonus to new end-customer Accounts, you can set up a Notification to alert you + * when an end-customer Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ fun notificationConfigurations(): NotificationConfigurationService.WithRawResponse + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge + * amounts, minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following + * sections in this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ fun organizationConfig(): OrganizationConfigService.WithRawResponse + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables + * you to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ fun permissionPolicies(): PermissionPolicyService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure + * from its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or + * more of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ fun plans(): PlanService.WithRawResponse + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified + * approach to efficiently handle various uses cases across different plans. For example + * applying a minimum spend amount at billing, across several of your products or features + * that are each priced separately. + */ fun planGroups(): PlanGroupService.WithRawResponse + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ fun planGroupLinks(): PlanGroupLinkService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ + * only in the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ fun planTemplates(): PlanTemplateService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ fun pricings(): PricingService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products + * act as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ fun products(): ProductService.WithRawResponse + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User + * who has been given access to your Organization can and cannot do. For example, you might + * want to create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be + * assigned to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so + * on. This is useful for cases where you want to create Permission Policies which allow or + * deny access to a specific subset of resources. For example, grant a user access to only + * some of the Plans in your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies + * of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs + * to. For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ fun resourceGroups(): ResourceGroupService.WithRawResponse + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ fun scheduledEventConfigurations(): ScheduledEventConfigurationService.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun statements(): StatementService.WithRawResponse + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when + * creating and updating Balances. Example TransactionTypes: "Balance Amount" or "Add + * Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ fun transactionTypes(): TransactionTypeService.WithRawResponse fun usage(): UsageService.WithRawResponse fun users(): UserService.WithRawResponse + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun webhooks(): WebhookService.WithRawResponse } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsync.kt index 0f16a4f6..89e50b40 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsync.kt @@ -82,86 +82,937 @@ interface M3terClientAsync { */ fun withOptions(modifier: Consumer): M3terClientAsync + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ fun authentication(): AuthenticationServiceAsync + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than + * one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but + * not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can + * then set up billing for the Parent/Child Account usage to have the end-customer billed once + * for the Parent Account, instead of having separate bills issued for usage against each of + * their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that only the ``name``, ``address``, or ``emailAddress`` fields contain any + * end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ fun accounts(): AccountServiceAsync + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, + * list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create + * an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create + * the Plan Group, you define an overall minimum spend and then add any priced Plans you want to + * include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account + * that consumes the separate Products which are priced using the included Plans. At billing, + * the minimum spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product + * can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of + * the Plan Groups contain a Plan belonging to the same Product. If you try to attach a + * Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would + * overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ fun accountPlans(): AccountPlanServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted + * Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical or + * business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation + * to them to derive pricing metrics needed to serve more complex usage-based pricing + * scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing + * and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ fun aggregations(): AggregationServiceAsync + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ fun balances(): BalanceServiceAsync + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun bills(): BillServiceAsync + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - + * any Bill with a service period end date on or before the set date will be locked and cannot + * be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the + * specified lock date, then you'll receive an error. + */ fun billConfig(): BillConfigServiceAsync + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed + * to pay a fixed minimum amount throughout the contract period. ***The commitment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use + * them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming + * your product or services across a full contract term. A customer might pay the entire or only + * part of the agreed amount upfront, but ***the prepayment amount is payable regardless of the + * actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit on + * an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the + * customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ fun commitments(): CommitmentServiceAsync + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the Bill + * is showing correctly for the charges due on the new usage data. + */ fun billJobs(): BillJobServiceAsync + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill + * date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ fun charges(): ChargeServiceAsync + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures can + * then be used as pricing metrics to price your Product Plans, enabling you to implement a wide + * range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and + * any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the + * same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any + * Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity + * per unit** defined or a **Rounding** defined, these will not be factored into the value used + * by the calculation. For example, if the simple Aggregation referenced has a base value of 100 + * and has **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the + * base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ fun compoundAggregations(): CompoundAggregationServiceAsync + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used + * for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ fun contracts(): ContractServiceAsync + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or Plan + * Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ fun counters(): CounterServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to ensure + * the Account is billed according to the number of Counter units the Account subscribes to in a + * given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ fun counterAdjustments(): CounterAdjustmentServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ fun counterPricings(): CounterPricingServiceAsync + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit + * line item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ fun creditReasons(): CreditReasonServiceAsync + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities + * such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides + * any currency settings in your pricing Plans. For example, if the Organization currency is set + * to USD and a pricing Plan used for an Account is set to GBP, the bill for an Account using + * that Plan is calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ fun currencies(): CurrencyServiceAsync + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of + * the m3ter platform. Having this capability to store data in a free-hand fashion can prove + * very useful in helping you to meet specific usage-based pricing and other operational + * business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key role + * these calculations can play when implementing usage-based pricing schema, any Custom Fields + * you reference will then affect how the platform behaves. Referencing Custom Field values in + * your calculations offers a much wider scope of options when it comes to resolving complex + * usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to + * also add a Custom Field of the same name at the corresponding individual entity level. If + * you reference the Custom Field in a calculation, the value for the individual entity level + * field is used. If no field is defined at individual entity level, then the Organization + * level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization + * level Meter Custom Field will always be used*, even if you have defined a corresponding field + * at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ fun customFields(): CustomFieldServiceAsync + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports + * to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun dataExports(): DataExportServiceAsync + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit + * line item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ fun debitReasons(): DebitReasonServiceAsync + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation + * of a new Prepayment/Commitment for an Account. Each Event is classified under an Event Type + * framework, providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated + * for a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to create + * and configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, + * which you can set up by referencing Date/Time fields on configuration and billing entities. + * See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent + * out via webhooks when the Event occurs and any conditions you've built into the Notification + * rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by + * the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ fun events(): EventServiceAsync + /** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities + * in the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the + * local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at + * a later date, edit or delete them. + */ fun externalMappings(): ExternalMappingServiceAsync + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun integrationConfigurations(): IntegrationConfigurationServiceAsync + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. + * Use them for currency conversion, pricing tiers, discount rates, and similar scenarios where + * you require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables + * have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTables(): LookupTableServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that any fields you configure for Meters, such as Data Fields or Derived Fields, do + * not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ fun meters(): MeterServiceAsync + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base + * a Notification on a specific Event type, you can include a calculation that references the + * fields available on that Event type to define precise conditions that must be met for the + * Notification to be triggered when an Event of that type occurs. In this way, you can set up + * highly customized Notifications that act as timely alerts to inform you about significant + * occurrences within your Organization. For instance, if you provide a sign-up bonus to new + * end-customer Accounts, you can set up a Notification to alert you when an end-customer + * Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ fun notificationConfigurations(): NotificationConfigurationServiceAsync + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ fun organizationConfig(): OrganizationConfigServiceAsync + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables you + * to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ fun permissionPolicies(): PermissionPolicyServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure from + * its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or more + * of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ fun plans(): PlanServiceAsync + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach + * to efficiently handle various uses cases across different plans. For example applying a + * minimum spend amount at billing, across several of your products or features that are each + * priced separately. + */ fun planGroups(): PlanGroupServiceAsync + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ fun planGroupLinks(): PlanGroupLinkServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ only in + * the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ fun planTemplates(): PlanTemplateServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ fun pricings(): PricingServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act + * as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ fun products(): ProductServiceAsync + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who + * has been given access to your Organization can and cannot do. For example, you might want to + * create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned + * to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is + * useful for cases where you want to create Permission Policies which allow or deny access to a + * specific subset of resources. For example, grant a user access to only some of the Plans in + * your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies of + * groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs to. + * For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ fun resourceGroups(): ResourceGroupServiceAsync + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ fun scheduledEventConfigurations(): ScheduledEventConfigurationServiceAsync + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun statements(): StatementServiceAsync + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating + * and updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ fun transactionTypes(): TransactionTypeServiceAsync fun usage(): UsageServiceAsync fun users(): UserServiceAsync + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun webhooks(): WebhookServiceAsync /** @@ -187,86 +1038,945 @@ interface M3terClientAsync { */ fun withOptions(modifier: Consumer): M3terClientAsync.WithRawResponse + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ fun authentication(): AuthenticationServiceAsync.WithRawResponse + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more + * than one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount + * but not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You + * can then set up billing for the Parent/Child Account usage to have the end-customer + * billed once for the Parent Account, instead of having separate bills issued for usage + * against each of their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that only the ``name``, ``address``, or ``emailAddress`` fields + * contain any end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + */ fun accounts(): AccountServiceAsync.WithRawResponse + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, + * update, list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is + * for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create + * separate AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to + * create an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount + * at billing across several of your Products each of which are priced separately - when you + * create the Plan Group, you define an overall minimum spend and then add any priced Plans + * you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan + * Group to an Account that consumes the separate Products which are priced using the + * included Plans. At billing, the minimum spend you've defined for the Plan Group is + * applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which + * the Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for + * more details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can + * only be attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan + * where a `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account + * to create multiple AccountPlanGroups, but the rule that *only one attached Plan per + * Product can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none + * of the Plan Groups contain a Plan belonging to the same Product. If you try to + * attach a Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account + * would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ fun accountPlans(): AccountPlanServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. + * You define the method of aggregation used to convert the usage data collected by the + * targeted Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical + * or business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted + * with [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A + * Compound Aggregation typically references one or more simple Aggregations and applies a + * calculation to them to derive pricing metrics needed to serve more complex usage-based + * pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some + * pricing and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ fun aggregations(): AggregationServiceAsync.WithRawResponse + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ fun balances(): BalanceServiceAsync.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun bills(): BillServiceAsync.WithRawResponse + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** + * Bills - any Bill with a service period end date on or before the set date will be locked + * and cannot be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when + * there remains Bills in a *Pending* state whose service period end date is on or before + * the specified lock date, then you'll receive an error. + */ fun billConfig(): BillConfigServiceAsync.WithRawResponse + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of + * usage-based pricing and billing. A Commitment represents an agreement where the + * end-customer has agreed to pay a fixed minimum amount throughout the contract period. + * ***The commitment amount is payable regardless of the actual usage by the customer of + * your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. + * Use them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account + * at billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed + * the agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for + * consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the prepayment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit + * on an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer + * contract period, you can choose one of two options for billing the outstanding fees due + * on the customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ fun commitments(): CommitmentServiceAsync.WithRawResponse + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous + * mechanisms to calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the + * Bill is showing correctly for the charges due on the new usage data. + */ fun billJobs(): BillJobServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge + * bill date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ fun charges(): ChargeServiceAsync.WithRawResponse + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures + * can then be used as pricing metrics to price your Product Plans, enabling you to + * implement a wide range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to + * any Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations + * and any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to + * the same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and + * any Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a + * **Quantity per unit** defined or a **Rounding** defined, these will not be factored into + * the value used by the calculation. For example, if the simple Aggregation referenced has + * a base value of 100 and has **Quantity per unit** set at 10, the Compound Aggregation + * calculation *will use the base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ fun compoundAggregations(): CompoundAggregationServiceAsync.WithRawResponse + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be + * used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you + * can report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked + * to Contracts on the Account to meet your specific Contract billing use cases. + */ fun contracts(): ContractServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or + * Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ fun counters(): CounterServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to + * ensure the Account is billed according to the number of Counter units the Account + * subscribes to in a given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ fun counterAdjustments(): CounterAdjustmentServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a + * unit-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ fun counterPricings(): CounterPricingServiceAsync.WithRawResponse + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a + * credit line item on a bill, or applying a product credit to a bill. CreditReasons provide + * contextual information as to why a credit was applied. + */ fun creditReasons(): CreditReasonServiceAsync.WithRawResponse + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies + * are stored for your Organization, and can then be used to specify currencies on various + * entities such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and + * overrides any currency settings in your pricing Plans. For example, if the Organization + * currency is set to USD and a pricing Plan used for an Account is set to GBP, the bill for + * an Account using that Plan is calculated in GBP, and then each bill line item converted + * to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ fun currencies(): CurrencyServiceAsync.WithRawResponse + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string + * values against m3ter entities in a way that does not directly affect the normal working + * operation of the m3ter platform. Having this capability to store data in a free-hand + * fashion can prove very useful in helping you to meet specific usage-based pricing and + * other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key + * role these calculations can play when implementing usage-based pricing schema, any Custom + * Fields you reference will then affect how the platform behaves. Referencing Custom Field + * values in your calculations offers a much wider scope of options when it comes to + * resolving complex usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual + * entity level. + * - The Organizational level field provides a default value and *must be added* if you want + * to also add a Custom Field of the same name at the corresponding individual entity + * level. If you reference the Custom Field in a calculation, the value for the individual + * entity level field is used. If no field is defined at individual entity level, then the + * Organization level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at + * the Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the + * *Organization level Meter Custom Field will always be used*, even if you have defined a + * corresponding field at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ fun customFields(): CustomFieldServiceAsync.WithRawResponse + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc + * Exports to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun dataExports(): DataExportServiceAsync.WithRawResponse + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a + * debit line item on a bill, or applying a product debit to a bill. DebitReasons provide + * contextual information as to why a debit was applied. + */ fun debitReasons(): DebitReasonServiceAsync.WithRawResponse + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the + * creation of a new Prepayment/Commitment for an Account. Each Event is classified under an + * Event Type framework, providing context about what kind of change occurred to generate + * the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is + * generated for a state change of one of these objects - for when the configuration or + * billing object is **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to + * create and configure *Scheduled Event Configurations*. Scheduled Events are custom Event + * types, which you can set up by referencing Date/Time fields on configuration and billing + * entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be + * sent out via webhooks when the Event occurs and any conditions you've built into the + * Notification rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for + * more details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered + * by the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ fun events(): EventServiceAsync.WithRawResponse + /** + * Endpoints for managing External Mapping related operations such as creation, update, list + * and delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between + * entities in the local system *(m3ter)* and external systems is constructed. This + * *External Mapping* is crucial in scenarios where data from external systems is consumed + * or where data from the local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually + * and, at a later date, edit or delete them. + */ fun externalMappings(): ExternalMappingServiceAsync.WithRawResponse + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun integrationConfigurations(): IntegrationConfigurationServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations + * reference. Use them for currency conversion, pricing tiers, discount rates, and similar + * scenarios where you require values to change operationally but for calculation logic to + * remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTables(): LookupTableServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for + * your products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields + * for Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values + * or non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter + * as name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that any fields you configure for Meters, such as Data Fields or + * Derived Fields, do not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ fun meters(): MeterServiceAsync.WithRawResponse + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you + * base a Notification on a specific Event type, you can include a calculation that + * references the fields available on that Event type to define precise conditions that must + * be met for the Notification to be triggered when an Event of that type occurs. In this + * way, you can set up highly customized Notifications that act as timely alerts to inform + * you about significant occurrences within your Organization. For instance, if you provide + * a sign-up bonus to new end-customer Accounts, you can set up a Notification to alert you + * when an end-customer Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ fun notificationConfigurations(): NotificationConfigurationServiceAsync.WithRawResponse + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge + * amounts, minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following + * sections in this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ fun organizationConfig(): OrganizationConfigServiceAsync.WithRawResponse + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables + * you to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ fun permissionPolicies(): PermissionPolicyServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure + * from its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or + * more of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ fun plans(): PlanServiceAsync.WithRawResponse + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified + * approach to efficiently handle various uses cases across different plans. For example + * applying a minimum spend amount at billing, across several of your products or features + * that are each priced separately. + */ fun planGroups(): PlanGroupServiceAsync.WithRawResponse + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ fun planGroupLinks(): PlanGroupLinkServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ + * only in the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ fun planTemplates(): PlanTemplateServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ fun pricings(): PricingServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products + * act as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ fun products(): ProductServiceAsync.WithRawResponse + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User + * who has been given access to your Organization can and cannot do. For example, you might + * want to create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be + * assigned to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so + * on. This is useful for cases where you want to create Permission Policies which allow or + * deny access to a specific subset of resources. For example, grant a user access to only + * some of the Plans in your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies + * of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs + * to. For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ fun resourceGroups(): ResourceGroupServiceAsync.WithRawResponse + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ fun scheduledEventConfigurations(): ScheduledEventConfigurationServiceAsync.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun statements(): StatementServiceAsync.WithRawResponse + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when + * creating and updating Balances. Example TransactionTypes: "Balance Amount" or "Add + * Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ fun transactionTypes(): TransactionTypeServiceAsync.WithRawResponse fun usage(): UsageServiceAsync.WithRawResponse fun users(): UserServiceAsync.WithRawResponse + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ fun webhooks(): WebhookServiceAsync.WithRawResponse } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsyncImpl.kt index b56b2ad9..cca68b66 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientAsyncImpl.kt @@ -270,89 +270,940 @@ class M3terClientAsyncImpl(private val clientOptions: ClientOptions) : M3terClie override fun withOptions(modifier: Consumer): M3terClientAsync = M3terClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ override fun authentication(): AuthenticationServiceAsync = authentication + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than + * one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but + * not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can + * then set up billing for the Parent/Child Account usage to have the end-customer billed once + * for the Parent Account, instead of having separate bills issued for usage against each of + * their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that only the ``name``, ``address``, or ``emailAddress`` fields contain any + * end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ override fun accounts(): AccountServiceAsync = accounts + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, + * list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create + * an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create + * the Plan Group, you define an overall minimum spend and then add any priced Plans you want to + * include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account + * that consumes the separate Products which are priced using the included Plans. At billing, + * the minimum spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product + * can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of + * the Plan Groups contain a Plan belonging to the same Product. If you try to attach a + * Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would + * overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ override fun accountPlans(): AccountPlanServiceAsync = accountPlans + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted + * Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical or + * business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation + * to them to derive pricing metrics needed to serve more complex usage-based pricing + * scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing + * and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ override fun aggregations(): AggregationServiceAsync = aggregations + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ override fun balances(): BalanceServiceAsync = balances + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun bills(): BillServiceAsync = bills + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - + * any Bill with a service period end date on or before the set date will be locked and cannot + * be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the + * specified lock date, then you'll receive an error. + */ override fun billConfig(): BillConfigServiceAsync = billConfig + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed + * to pay a fixed minimum amount throughout the contract period. ***The commitment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use + * them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming + * your product or services across a full contract term. A customer might pay the entire or only + * part of the agreed amount upfront, but ***the prepayment amount is payable regardless of the + * actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit on + * an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the + * customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ override fun commitments(): CommitmentServiceAsync = commitments + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the Bill + * is showing correctly for the charges due on the new usage data. + */ override fun billJobs(): BillJobServiceAsync = billJobs + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill + * date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ override fun charges(): ChargeServiceAsync = charges + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures can + * then be used as pricing metrics to price your Product Plans, enabling you to implement a wide + * range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and + * any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the + * same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any + * Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity + * per unit** defined or a **Rounding** defined, these will not be factored into the value used + * by the calculation. For example, if the simple Aggregation referenced has a base value of 100 + * and has **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the + * base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ override fun compoundAggregations(): CompoundAggregationServiceAsync = compoundAggregations + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used + * for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ override fun contracts(): ContractServiceAsync = contracts + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or Plan + * Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ override fun counters(): CounterServiceAsync = counters + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to ensure + * the Account is billed according to the number of Counter units the Account subscribes to in a + * given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ override fun counterAdjustments(): CounterAdjustmentServiceAsync = counterAdjustments + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ override fun counterPricings(): CounterPricingServiceAsync = counterPricings + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit + * line item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ override fun creditReasons(): CreditReasonServiceAsync = creditReasons + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities + * such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides + * any currency settings in your pricing Plans. For example, if the Organization currency is set + * to USD and a pricing Plan used for an Account is set to GBP, the bill for an Account using + * that Plan is calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ override fun currencies(): CurrencyServiceAsync = currencies + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of + * the m3ter platform. Having this capability to store data in a free-hand fashion can prove + * very useful in helping you to meet specific usage-based pricing and other operational + * business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key role + * these calculations can play when implementing usage-based pricing schema, any Custom Fields + * you reference will then affect how the platform behaves. Referencing Custom Field values in + * your calculations offers a much wider scope of options when it comes to resolving complex + * usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to + * also add a Custom Field of the same name at the corresponding individual entity level. If + * you reference the Custom Field in a calculation, the value for the individual entity level + * field is used. If no field is defined at individual entity level, then the Organization + * level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization + * level Meter Custom Field will always be used*, even if you have defined a corresponding field + * at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ override fun customFields(): CustomFieldServiceAsync = customFields + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports + * to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun dataExports(): DataExportServiceAsync = dataExports + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit + * line item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ override fun debitReasons(): DebitReasonServiceAsync = debitReasons + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation + * of a new Prepayment/Commitment for an Account. Each Event is classified under an Event Type + * framework, providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated + * for a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to create + * and configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, + * which you can set up by referencing Date/Time fields on configuration and billing entities. + * See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent + * out via webhooks when the Event occurs and any conditions you've built into the Notification + * rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by + * the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ override fun events(): EventServiceAsync = events + /** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities + * in the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the + * local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at + * a later date, edit or delete them. + */ override fun externalMappings(): ExternalMappingServiceAsync = externalMappings + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun integrationConfigurations(): IntegrationConfigurationServiceAsync = integrationConfigurations + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. + * Use them for currency conversion, pricing tiers, discount rates, and similar scenarios where + * you require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables + * have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTables(): LookupTableServiceAsync = lookupTables + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that any fields you configure for Meters, such as Data Fields or Derived Fields, do + * not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ override fun meters(): MeterServiceAsync = meters + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base + * a Notification on a specific Event type, you can include a calculation that references the + * fields available on that Event type to define precise conditions that must be met for the + * Notification to be triggered when an Event of that type occurs. In this way, you can set up + * highly customized Notifications that act as timely alerts to inform you about significant + * occurrences within your Organization. For instance, if you provide a sign-up bonus to new + * end-customer Accounts, you can set up a Notification to alert you when an end-customer + * Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ override fun notificationConfigurations(): NotificationConfigurationServiceAsync = notificationConfigurations + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ override fun organizationConfig(): OrganizationConfigServiceAsync = organizationConfig + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables you + * to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ override fun permissionPolicies(): PermissionPolicyServiceAsync = permissionPolicies + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure from + * its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or more + * of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ override fun plans(): PlanServiceAsync = plans + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach + * to efficiently handle various uses cases across different plans. For example applying a + * minimum spend amount at billing, across several of your products or features that are each + * priced separately. + */ override fun planGroups(): PlanGroupServiceAsync = planGroups + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ override fun planGroupLinks(): PlanGroupLinkServiceAsync = planGroupLinks + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ only in + * the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ override fun planTemplates(): PlanTemplateServiceAsync = planTemplates + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ override fun pricings(): PricingServiceAsync = pricings + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act + * as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ override fun products(): ProductServiceAsync = products + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who + * has been given access to your Organization can and cannot do. For example, you might want to + * create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned + * to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is + * useful for cases where you want to create Permission Policies which allow or deny access to a + * specific subset of resources. For example, grant a user access to only some of the Plans in + * your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies of + * groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs to. + * For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ override fun resourceGroups(): ResourceGroupServiceAsync = resourceGroups + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ override fun scheduledEventConfigurations(): ScheduledEventConfigurationServiceAsync = scheduledEventConfigurations + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun statements(): StatementServiceAsync = statements + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating + * and updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ override fun transactionTypes(): TransactionTypeServiceAsync = transactionTypes override fun usage(): UsageServiceAsync = usage override fun users(): UserServiceAsync = users + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun webhooks(): WebhookServiceAsync = webhooks override fun close() = clientOptions.close() @@ -534,88 +1385,928 @@ class M3terClientAsyncImpl(private val clientOptions: ClientOptions) : M3terClie clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ override fun authentication(): AuthenticationServiceAsync.WithRawResponse = authentication + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more + * than one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount + * but not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You + * can then set up billing for the Parent/Child Account usage to have the end-customer + * billed once for the Parent Account, instead of having separate bills issued for usage + * against each of their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that only the ``name``, ``address``, or ``emailAddress`` fields + * contain any end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + */ override fun accounts(): AccountServiceAsync.WithRawResponse = accounts + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, + * update, list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is + * for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create + * separate AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to + * create an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount + * at billing across several of your Products each of which are priced separately - when you + * create the Plan Group, you define an overall minimum spend and then add any priced Plans + * you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan + * Group to an Account that consumes the separate Products which are priced using the + * included Plans. At billing, the minimum spend you've defined for the Plan Group is + * applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which + * the Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for + * more details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can + * only be attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan + * where a `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account + * to create multiple AccountPlanGroups, but the rule that *only one attached Plan per + * Product can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none + * of the Plan Groups contain a Plan belonging to the same Product. If you try to + * attach a Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account + * would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ override fun accountPlans(): AccountPlanServiceAsync.WithRawResponse = accountPlans + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. + * You define the method of aggregation used to convert the usage data collected by the + * targeted Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical + * or business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted + * with [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A + * Compound Aggregation typically references one or more simple Aggregations and applies a + * calculation to them to derive pricing metrics needed to serve more complex usage-based + * pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some + * pricing and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ override fun aggregations(): AggregationServiceAsync.WithRawResponse = aggregations + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ override fun balances(): BalanceServiceAsync.WithRawResponse = balances + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun bills(): BillServiceAsync.WithRawResponse = bills + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** + * Bills - any Bill with a service period end date on or before the set date will be locked + * and cannot be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when + * there remains Bills in a *Pending* state whose service period end date is on or before + * the specified lock date, then you'll receive an error. + */ override fun billConfig(): BillConfigServiceAsync.WithRawResponse = billConfig + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of + * usage-based pricing and billing. A Commitment represents an agreement where the + * end-customer has agreed to pay a fixed minimum amount throughout the contract period. + * ***The commitment amount is payable regardless of the actual usage by the customer of + * your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. + * Use them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account + * at billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed + * the agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for + * consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the prepayment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit + * on an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer + * contract period, you can choose one of two options for billing the outstanding fees due + * on the customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ override fun commitments(): CommitmentServiceAsync.WithRawResponse = commitments + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous + * mechanisms to calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the + * Bill is showing correctly for the charges due on the new usage data. + */ override fun billJobs(): BillJobServiceAsync.WithRawResponse = billJobs + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge + * bill date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ override fun charges(): ChargeServiceAsync.WithRawResponse = charges + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures + * can then be used as pricing metrics to price your Product Plans, enabling you to + * implement a wide range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to + * any Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations + * and any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to + * the same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and + * any Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a + * **Quantity per unit** defined or a **Rounding** defined, these will not be factored into + * the value used by the calculation. For example, if the simple Aggregation referenced has + * a base value of 100 and has **Quantity per unit** set at 10, the Compound Aggregation + * calculation *will use the base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ override fun compoundAggregations(): CompoundAggregationServiceAsync.WithRawResponse = compoundAggregations + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be + * used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you + * can report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked + * to Contracts on the Account to meet your specific Contract billing use cases. + */ override fun contracts(): ContractServiceAsync.WithRawResponse = contracts + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or + * Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ override fun counters(): CounterServiceAsync.WithRawResponse = counters + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to + * ensure the Account is billed according to the number of Counter units the Account + * subscribes to in a given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ override fun counterAdjustments(): CounterAdjustmentServiceAsync.WithRawResponse = counterAdjustments + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a + * unit-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ override fun counterPricings(): CounterPricingServiceAsync.WithRawResponse = counterPricings + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a + * credit line item on a bill, or applying a product credit to a bill. CreditReasons provide + * contextual information as to why a credit was applied. + */ override fun creditReasons(): CreditReasonServiceAsync.WithRawResponse = creditReasons + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies + * are stored for your Organization, and can then be used to specify currencies on various + * entities such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and + * overrides any currency settings in your pricing Plans. For example, if the Organization + * currency is set to USD and a pricing Plan used for an Account is set to GBP, the bill for + * an Account using that Plan is calculated in GBP, and then each bill line item converted + * to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ override fun currencies(): CurrencyServiceAsync.WithRawResponse = currencies + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string + * values against m3ter entities in a way that does not directly affect the normal working + * operation of the m3ter platform. Having this capability to store data in a free-hand + * fashion can prove very useful in helping you to meet specific usage-based pricing and + * other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key + * role these calculations can play when implementing usage-based pricing schema, any Custom + * Fields you reference will then affect how the platform behaves. Referencing Custom Field + * values in your calculations offers a much wider scope of options when it comes to + * resolving complex usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual + * entity level. + * - The Organizational level field provides a default value and *must be added* if you want + * to also add a Custom Field of the same name at the corresponding individual entity + * level. If you reference the Custom Field in a calculation, the value for the individual + * entity level field is used. If no field is defined at individual entity level, then the + * Organization level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at + * the Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the + * *Organization level Meter Custom Field will always be used*, even if you have defined a + * corresponding field at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ override fun customFields(): CustomFieldServiceAsync.WithRawResponse = customFields + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc + * Exports to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun dataExports(): DataExportServiceAsync.WithRawResponse = dataExports + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a + * debit line item on a bill, or applying a product debit to a bill. DebitReasons provide + * contextual information as to why a debit was applied. + */ override fun debitReasons(): DebitReasonServiceAsync.WithRawResponse = debitReasons + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the + * creation of a new Prepayment/Commitment for an Account. Each Event is classified under an + * Event Type framework, providing context about what kind of change occurred to generate + * the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is + * generated for a state change of one of these objects - for when the configuration or + * billing object is **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to + * create and configure *Scheduled Event Configurations*. Scheduled Events are custom Event + * types, which you can set up by referencing Date/Time fields on configuration and billing + * entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be + * sent out via webhooks when the Event occurs and any conditions you've built into the + * Notification rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for + * more details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered + * by the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ override fun events(): EventServiceAsync.WithRawResponse = events + /** + * Endpoints for managing External Mapping related operations such as creation, update, list + * and delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between + * entities in the local system *(m3ter)* and external systems is constructed. This + * *External Mapping* is crucial in scenarios where data from external systems is consumed + * or where data from the local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually + * and, at a later date, edit or delete them. + */ override fun externalMappings(): ExternalMappingServiceAsync.WithRawResponse = externalMappings + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun integrationConfigurations(): IntegrationConfigurationServiceAsync.WithRawResponse = integrationConfigurations + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations + * reference. Use them for currency conversion, pricing tiers, discount rates, and similar + * scenarios where you require values to change operationally but for calculation logic to + * remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTables(): LookupTableServiceAsync.WithRawResponse = lookupTables + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for + * your products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields + * for Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values + * or non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter + * as name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that any fields you configure for Meters, such as Data Fields or + * Derived Fields, do not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ override fun meters(): MeterServiceAsync.WithRawResponse = meters + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you + * base a Notification on a specific Event type, you can include a calculation that + * references the fields available on that Event type to define precise conditions that must + * be met for the Notification to be triggered when an Event of that type occurs. In this + * way, you can set up highly customized Notifications that act as timely alerts to inform + * you about significant occurrences within your Organization. For instance, if you provide + * a sign-up bonus to new end-customer Accounts, you can set up a Notification to alert you + * when an end-customer Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ override fun notificationConfigurations(): NotificationConfigurationServiceAsync.WithRawResponse = notificationConfigurations + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge + * amounts, minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following + * sections in this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ override fun organizationConfig(): OrganizationConfigServiceAsync.WithRawResponse = organizationConfig + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables + * you to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ override fun permissionPolicies(): PermissionPolicyServiceAsync.WithRawResponse = permissionPolicies + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure + * from its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or + * more of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ override fun plans(): PlanServiceAsync.WithRawResponse = plans + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified + * approach to efficiently handle various uses cases across different plans. For example + * applying a minimum spend amount at billing, across several of your products or features + * that are each priced separately. + */ override fun planGroups(): PlanGroupServiceAsync.WithRawResponse = planGroups + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ override fun planGroupLinks(): PlanGroupLinkServiceAsync.WithRawResponse = planGroupLinks + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ + * only in the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ override fun planTemplates(): PlanTemplateServiceAsync.WithRawResponse = planTemplates + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ override fun pricings(): PricingServiceAsync.WithRawResponse = pricings + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products + * act as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ override fun products(): ProductServiceAsync.WithRawResponse = products + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User + * who has been given access to your Organization can and cannot do. For example, you might + * want to create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be + * assigned to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so + * on. This is useful for cases where you want to create Permission Policies which allow or + * deny access to a specific subset of resources. For example, grant a user access to only + * some of the Plans in your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies + * of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs + * to. For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ override fun resourceGroups(): ResourceGroupServiceAsync.WithRawResponse = resourceGroups + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ override fun scheduledEventConfigurations(): ScheduledEventConfigurationServiceAsync.WithRawResponse = scheduledEventConfigurations + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun statements(): StatementServiceAsync.WithRawResponse = statements + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when + * creating and updating Balances. Example TransactionTypes: "Balance Amount" or "Add + * Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ override fun transactionTypes(): TransactionTypeServiceAsync.WithRawResponse = transactionTypes @@ -623,6 +2314,25 @@ class M3terClientAsyncImpl(private val clientOptions: ClientOptions) : M3terClie override fun users(): UserServiceAsync.WithRawResponse = users + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun webhooks(): WebhookServiceAsync.WithRawResponse = webhooks } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientImpl.kt index 34c477ed..93890b97 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/client/M3terClientImpl.kt @@ -248,89 +248,940 @@ class M3terClientImpl(private val clientOptions: ClientOptions) : M3terClient { override fun withOptions(modifier: Consumer): M3terClient = M3terClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ override fun authentication(): AuthenticationService = authentication + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than + * one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but + * not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can + * then set up billing for the Parent/Child Account usage to have the end-customer billed once + * for the Parent Account, instead of having separate bills issued for usage against each of + * their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that only the ``name``, ``address``, or ``emailAddress`` fields contain any + * end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ override fun accounts(): AccountService = accounts + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, + * list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create + * an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create + * the Plan Group, you define an overall minimum spend and then add any priced Plans you want to + * include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account + * that consumes the separate Products which are priced using the included Plans. At billing, + * the minimum spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product + * can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of + * the Plan Groups contain a Plan belonging to the same Product. If you try to attach a + * Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would + * overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ override fun accountPlans(): AccountPlanService = accountPlans + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted + * Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical or + * business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation + * to them to derive pricing metrics needed to serve more complex usage-based pricing + * scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing + * and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ override fun aggregations(): AggregationService = aggregations + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ override fun balances(): BalanceService = balances + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun bills(): BillService = bills + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - + * any Bill with a service period end date on or before the set date will be locked and cannot + * be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the + * specified lock date, then you'll receive an error. + */ override fun billConfig(): BillConfigService = billConfig + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed + * to pay a fixed minimum amount throughout the contract period. ***The commitment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use + * them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming + * your product or services across a full contract term. A customer might pay the entire or only + * part of the agreed amount upfront, but ***the prepayment amount is payable regardless of the + * actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit on + * an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the + * customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ override fun commitments(): CommitmentService = commitments + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the Bill + * is showing correctly for the charges due on the new usage data. + */ override fun billJobs(): BillJobService = billJobs + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill + * date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ override fun charges(): ChargeService = charges + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures can + * then be used as pricing metrics to price your Product Plans, enabling you to implement a wide + * range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and + * any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the + * same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any + * Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity + * per unit** defined or a **Rounding** defined, these will not be factored into the value used + * by the calculation. For example, if the simple Aggregation referenced has a base value of 100 + * and has **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the + * base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ override fun compoundAggregations(): CompoundAggregationService = compoundAggregations + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used + * for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ override fun contracts(): ContractService = contracts + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or Plan + * Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ override fun counters(): CounterService = counters + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to ensure + * the Account is billed according to the number of Counter units the Account subscribes to in a + * given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ override fun counterAdjustments(): CounterAdjustmentService = counterAdjustments + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ override fun counterPricings(): CounterPricingService = counterPricings + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit + * line item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ override fun creditReasons(): CreditReasonService = creditReasons + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities + * such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides + * any currency settings in your pricing Plans. For example, if the Organization currency is set + * to USD and a pricing Plan used for an Account is set to GBP, the bill for an Account using + * that Plan is calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ override fun currencies(): CurrencyService = currencies + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of + * the m3ter platform. Having this capability to store data in a free-hand fashion can prove + * very useful in helping you to meet specific usage-based pricing and other operational + * business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key role + * these calculations can play when implementing usage-based pricing schema, any Custom Fields + * you reference will then affect how the platform behaves. Referencing Custom Field values in + * your calculations offers a much wider scope of options when it comes to resolving complex + * usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to + * also add a Custom Field of the same name at the corresponding individual entity level. If + * you reference the Custom Field in a calculation, the value for the individual entity level + * field is used. If no field is defined at individual entity level, then the Organization + * level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization + * level Meter Custom Field will always be used*, even if you have defined a corresponding field + * at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ override fun customFields(): CustomFieldService = customFields + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports + * to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun dataExports(): DataExportService = dataExports + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit + * line item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ override fun debitReasons(): DebitReasonService = debitReasons + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation + * of a new Prepayment/Commitment for an Account. Each Event is classified under an Event Type + * framework, providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated + * for a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to create + * and configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, + * which you can set up by referencing Date/Time fields on configuration and billing entities. + * See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent + * out via webhooks when the Event occurs and any conditions you've built into the Notification + * rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by + * the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ override fun events(): EventService = events + /** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities + * in the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the + * local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at + * a later date, edit or delete them. + */ override fun externalMappings(): ExternalMappingService = externalMappings + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun integrationConfigurations(): IntegrationConfigurationService = integrationConfigurations + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. + * Use them for currency conversion, pricing tiers, discount rates, and similar scenarios where + * you require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables + * have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTables(): LookupTableService = lookupTables + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please + * ensure that any fields you configure for Meters, such as Data Fields or Derived Fields, do + * not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ override fun meters(): MeterService = meters + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base + * a Notification on a specific Event type, you can include a calculation that references the + * fields available on that Event type to define precise conditions that must be met for the + * Notification to be triggered when an Event of that type occurs. In this way, you can set up + * highly customized Notifications that act as timely alerts to inform you about significant + * occurrences within your Organization. For instance, if you provide a sign-up bonus to new + * end-customer Accounts, you can set up a Notification to alert you when an end-customer + * Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ override fun notificationConfigurations(): NotificationConfigurationService = notificationConfigurations + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ override fun organizationConfig(): OrganizationConfigService = organizationConfig + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables you + * to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ override fun permissionPolicies(): PermissionPolicyService = permissionPolicies + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure from + * its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or more + * of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ override fun plans(): PlanService = plans + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach + * to efficiently handle various uses cases across different plans. For example applying a + * minimum spend amount at billing, across several of your products or features that are each + * priced separately. + */ override fun planGroups(): PlanGroupService = planGroups + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ override fun planGroupLinks(): PlanGroupLinkService = planGroupLinks + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ only in + * the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ override fun planTemplates(): PlanTemplateService = planTemplates + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ override fun pricings(): PricingService = pricings + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act + * as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ override fun products(): ProductService = products + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who + * has been given access to your Organization can and cannot do. For example, you might want to + * create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned + * to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is + * useful for cases where you want to create Permission Policies which allow or deny access to a + * specific subset of resources. For example, grant a user access to only some of the Plans in + * your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies of + * groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs to. + * For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ override fun resourceGroups(): ResourceGroupService = resourceGroups + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ override fun scheduledEventConfigurations(): ScheduledEventConfigurationService = scheduledEventConfigurations + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun statements(): StatementService = statements + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating + * and updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ override fun transactionTypes(): TransactionTypeService = transactionTypes override fun usage(): UsageService = usage override fun users(): UserService = users + /** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing + * and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun webhooks(): WebhookService = webhooks override fun close() = clientOptions.close() @@ -512,93 +1363,952 @@ class M3terClientImpl(private val clientOptions: ClientOptions) : M3terClient { clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the + * Client Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your + * Organization - that is, as an API user. + */ override fun authentication(): AuthenticationService.WithRawResponse = authentication + /** + * Endpoints for Account related operations such as creation, update, list and delete. An + * Account represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more + * than one of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate + * bills for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan + * Template to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount + * but not all of the Prepayment is prepaid, you can use a customized billing schedule for + * outstanding fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You + * can then set up billing for the Parent/Child Account usage to have the end-customer + * billed once for the Parent Account, instead of having separate bills issued for usage + * against each of their multiple Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that only the ``name``, ``address``, or ``emailAddress`` fields + * contain any end-customer PII data on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + */ override fun accounts(): AccountService.WithRawResponse = accounts + /** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, + * update, list and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the + * charges incurred at billing by your end customer for consuming the Product the Plan is + * for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the + * AccountPlan is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create + * separate AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to + * create an AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount + * at billing across several of your Products each of which are priced separately - when you + * create the Plan Group, you define an overall minimum spend and then add any priced Plans + * you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan + * Group to an Account that consumes the separate Products which are priced using the + * included Plans. At billing, the minimum spend you've defined for the Plan Group is + * applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which + * the Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for + * more details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can + * only be attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, + * this creates an AccountPlanGroup. However, the m3ter data model *does not support a + * separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan + * where a `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account + * to create multiple AccountPlanGroups, but the rule that *only one attached Plan per + * Product can be active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none + * of the Plan Groups contain a Plan belonging to the same Product. If you try to + * attach a Plan Group to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group + * already attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account + * would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ override fun accountPlans(): AccountPlanService.WithRawResponse = accountPlans + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. + * You define the method of aggregation used to convert the usage data collected by the + * targeted Meter field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing + * Product Plans and apply usage-based pricing to your products and services. You might also + * want to aggregate raw data measures for other purposes, such as to feed into analytical + * or business performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, + * which apply an aggregation method directly to Meter usage data fields, are contrasted + * with [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A + * Compound Aggregation typically references one or more simple Aggregations and applies a + * calculation to them to derive pricing metrics needed to serve more complex usage-based + * pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some + * pricing and billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ override fun aggregations(): AggregationService.WithRawResponse = aggregations + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ override fun balances(): BalanceService.WithRawResponse = balances + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun bills(): BillService.WithRawResponse = bills + /** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** + * Bills - any Bill with a service period end date on or before the set date will be locked + * and cannot be updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when + * there remains Bills in a *Pending* state whose service period end date is on or before + * the specified lock date, then you'll receive an error. + */ override fun billConfig(): BillConfigService.WithRawResponse = billConfig + /** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of + * usage-based pricing and billing. A Commitment represents an agreement where the + * end-customer has agreed to pay a fixed minimum amount throughout the contract period. + * ***The commitment amount is payable regardless of the actual usage by the customer of + * your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. + * Use them to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account + * at billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed + * the agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for + * consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the prepayment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Prepayment credit + * on an Account is drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer + * contract period, you can choose one of two options for billing the outstanding fees due + * on the customer Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ override fun commitments(): CommitmentService.WithRawResponse = commitments + /** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous + * mechanisms to calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different + * billing management purposes. For example, some historical usage data has come in for an + * Account and you want to run a Bill for a specific date on that Account to check that the + * Bill is showing correctly for the charges due on the new usage data. + */ override fun billJobs(): BillJobService.WithRawResponse = billJobs + /** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account + * billing. Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge + * bill date, a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create + * balance fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ override fun charges(): ChargeService.WithRawResponse = charges + /** + * Endpoints for Compound Aggregation related operations such as creation, update, list and + * delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a + * calculation to one or more simple Aggregations or Custom Fields. These numerical measures + * can then be used as pricing metrics to price your Product Plans, enabling you to + * implement a wide range of usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to + * any Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations + * and any product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to + * the same Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and + * any Global simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a + * **Quantity per unit** defined or a **Rounding** defined, these will not be factored into + * the value used by the calculation. For example, if the simple Aggregation referenced has + * a base value of 100 and has **Quantity per unit** set at 10, the Compound Aggregation + * calculation *will use the base value of 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ override fun compoundAggregations(): CompoundAggregationService.WithRawResponse = compoundAggregations + /** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be + * used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you + * can report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked + * to Contracts on the Account to meet your specific Contract billing use cases. + */ override fun contracts(): ContractService.WithRawResponse = contracts + /** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing + * metrics to apply a unit-based + * [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product Plans or + * Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your + * end-customer Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the + * Accounts and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) + * in our main user documentation for more details. + */ override fun counters(): CounterService.WithRawResponse = counters + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based + * pricing, you can then create CounterAdjustments for the Account using that Counter to + * ensure the Account is billed according to the number of Counter units the Account + * subscribes to in a given billing period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ override fun counterAdjustments(): CounterAdjustmentService.WithRawResponse = counterAdjustments + /** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a + * unit-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ override fun counterPricings(): CounterPricingService.WithRawResponse = counterPricings + /** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a + * credit line item on a bill, or applying a product credit to a bill. CreditReasons provide + * contextual information as to why a credit was applied. + */ override fun creditReasons(): CreditReasonService.WithRawResponse = creditReasons + /** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies + * are stored for your Organization, and can then be used to specify currencies on various + * entities such as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and + * overrides any currency settings in your pricing Plans. For example, if the Organization + * currency is set to USD and a pricing Plan used for an Account is set to GBP, the bill for + * an Account using that Plan is calculated in GBP, and then each bill line item converted + * to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ override fun currencies(): CurrencyService.WithRawResponse = currencies + /** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all + * entities that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string + * values against m3ter entities in a way that does not directly affect the normal working + * operation of the m3ter platform. Having this capability to store data in a free-hand + * fashion can prove very useful in helping you to meet specific usage-based pricing and + * other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by + * referencing them in Derived Field and Compound Aggregation calculations. Given the key + * role these calculations can play when implementing usage-based pricing schema, any Custom + * Fields you reference will then affect how the platform behaves. Referencing Custom Field + * values in your calculations offers a much wider scope of options when it comes to + * resolving complex usage-based pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity + * request and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual + * entity level. + * - The Organizational level field provides a default value and *must be added* if you want + * to also add a Custom Field of the same name at the corresponding individual entity + * level. If you reference the Custom Field in a calculation, the value for the individual + * entity level field is used. If no field is defined at individual entity level, then the + * Organization level field value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at + * the Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity + * level for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global + * Meters*, you can also reference Custom Fields added to a Product in Derived Field + * calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the + * *Organization level Meter Custom Field will always be used*, even if you have defined a + * corresponding field at the individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ override fun customFields(): CustomFieldService.WithRawResponse = customFields + /** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc + * Exports to export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun dataExports(): DataExportService.WithRawResponse = dataExports + /** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a + * debit line item on a bill, or applying a product debit to a bill. DebitReasons provide + * contextual information as to why a debit was applied. + */ override fun debitReasons(): DebitReasonService.WithRawResponse = debitReasons + /** + * This section provides Endpoints for operations that allow you to retrieve detailed + * information about individual Events, list all Events or specific Event Types, and explore + * dynamic fields available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the + * creation of a new Prepayment/Commitment for an Account. Each Event is classified under an + * Event Type framework, providing context about what kind of change occurred to generate + * the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is + * generated for a state change of one of these objects - for when the configuration or + * billing object is **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a + * state change at creation, update, or deletion of the entity, you can use API calls to + * create and configure *Scheduled Event Configurations*. Scheduled Events are custom Event + * types, which you can set up by referencing Date/Time fields on configuration and billing + * entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be + * sent out via webhooks when the Event occurs and any conditions you've built into the + * Notification rule's calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for + * more details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered + * by the Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ override fun events(): EventService.WithRawResponse = events + /** + * Endpoints for managing External Mapping related operations such as creation, update, list + * and delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between + * entities in the local system *(m3ter)* and external systems is constructed. This + * *External Mapping* is crucial in scenarios where data from external systems is consumed + * or where data from the local system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually + * and, at a later date, edit or delete them. + */ override fun externalMappings(): ExternalMappingService.WithRawResponse = externalMappings + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun integrationConfigurations(): IntegrationConfigurationService.WithRawResponse = integrationConfigurations + /** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations + * reference. Use them for currency conversion, pricing tiers, discount rates, and similar + * scenarios where you require values to change operationally but for calculation logic to + * remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTables(): LookupTableService.WithRawResponse = lookupTables + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for + * your products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields + * for Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values + * or non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter + * as name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect + * usage data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally + * Identifiable Information (PII) in m3ter is restricted to a few fields on the **Account** + * entity. Please ensure that any fields you configure for Meters, such as Data Fields or + * Derived Fields, do not contain any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for + * more details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ override fun meters(): MeterService.WithRawResponse = meters + /** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you + * base a Notification on a specific Event type, you can include a calculation that + * references the fields available on that Event type to define precise conditions that must + * be met for the Notification to be triggered when an Event of that type occurs. In this + * way, you can set up highly customized Notifications that act as timely alerts to inform + * you about significant occurrences within your Organization. For instance, if you provide + * a sign-up bonus to new end-customer Accounts, you can set up a Notification to alert you + * when an end-customer Account has used up a certain percentage of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ override fun notificationConfigurations(): NotificationConfigurationService.WithRawResponse = notificationConfigurations + /** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge + * amounts, minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following + * sections in this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ override fun organizationConfig(): OrganizationConfigService.WithRawResponse = organizationConfig + /** + * Endpoints for Permission Policy related operations such as creation, update, add and + * retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users + * *(people)* and Service Users *(automated processes with direct API access)*. This enables + * you to control precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ override fun permissionPolicies(): PermissionPolicyService.WithRawResponse = permissionPolicies + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your + * products or services. Each Plan inherits general billing attributes or pricing structure + * from its parent Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can + * configure the exact pricing structures for Plans to charge customers that consume one or + * more of your Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ override fun plans(): PlanService.WithRawResponse = plans + /** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and + * delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified + * approach to efficiently handle various uses cases across different plans. For example + * applying a minimum spend amount at billing, across several of your products or features + * that are each priced separately. + */ override fun planGroups(): PlanGroupService.WithRawResponse = planGroups + /** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ override fun planGroupLinks(): PlanGroupLinkService.WithRawResponse = planGroupLinks + /** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the + * billing operations you want applied to your products. PlanTemplates avoid repetition in + * configuration work - many Plans will share settings for billing operations and differ + * only in the details of their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ override fun planTemplates(): PlanTemplateService.WithRawResponse = planTemplates + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a + * usage-based pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ override fun pricings(): PricingService.WithRawResponse = pricings + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products + * act as a container for the Meters, Aggregations, Pricing, and Plans required to implement + * usage-based and other pricing models for your Organization. + */ override fun products(): ProductService.WithRawResponse = products + /** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User + * who has been given access to your Organization can and cannot do. For example, you might + * want to create a Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural + * functional grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be + * assigned to Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so + * on. This is useful for cases where you want to create Permission Policies which allow or + * deny access to a specific subset of resources. For example, grant a user access to only + * some of the Plans in your Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including + * ResourceGroups themselves. This allows you to nest ResourceGroups to support hierarchies + * of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of + * type = `user`. You can then retrieve a list of the User Resource Groups a user belongs + * to. For more details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ override fun resourceGroups(): ResourceGroupService.WithRawResponse = resourceGroups + /** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra + * degree of flexibility over and above system-generated Events for setting up Notifications + * based on Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ override fun scheduledEventConfigurations(): ScheduledEventConfigurationService.WithRawResponse = scheduledEventConfigurations + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun statements(): StatementService.WithRawResponse = statements + /** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and + * delete. + * + * You can create TransactionTypes for your Organization, which can then be used when + * creating and updating Balances. Example TransactionTypes: "Balance Amount" or "Add + * Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've + * created for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ override fun transactionTypes(): TransactionTypeService.WithRawResponse = transactionTypes override fun usage(): UsageService.WithRawResponse = usage override fun users(): UserService.WithRawResponse = users + /** + * A suite of endpoints for configuring and managing third party integrations within the + * m3ter platform. The integration endpoints in this section facilitate various operations + * such as creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, + * billing and invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business + * platforms, enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ override fun webhooks(): WebhookService.WithRawResponse = webhooks } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/ClientOptions.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/ClientOptions.kt index 340ad662..c0739c53 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/ClientOptions.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/ClientOptions.kt @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.m3ter.core.http.AsyncStreamResponse import com.m3ter.core.http.Headers import com.m3ter.core.http.HttpClient +import com.m3ter.core.http.LoggingHttpClient import com.m3ter.core.http.PhantomReachableClosingHttpClient import com.m3ter.core.http.QueryParams import com.m3ter.core.http.RetryingHttpClient @@ -80,6 +81,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for existing + * fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -107,6 +111,14 @@ private constructor( * Defaults to 2. */ @get:JvmName("maxRetries") val maxRetries: Int, + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + @get:JvmName("logLevel") val logLevel: LogLevel, @get:JvmName("apiKey") val apiKey: String, @get:JvmName("apiSecret") val apiSecret: String, private val token: String?, @@ -172,6 +184,7 @@ private constructor( private var responseValidation: Boolean = false private var timeout: Timeout = Timeout.default() private var maxRetries: Int = 2 + private var logLevel: LogLevel = LogLevel.fromEnv() private var apiKey: String? = null private var apiSecret: String? = null private var token: String? = null @@ -191,6 +204,7 @@ private constructor( responseValidation = clientOptions.responseValidation timeout = clientOptions.timeout maxRetries = clientOptions.maxRetries + logLevel = clientOptions.logLevel apiKey = clientOptions.apiKey apiSecret = clientOptions.apiSecret token = clientOptions.token @@ -274,6 +288,9 @@ private constructor( /** * Whether to call `validate` on every response before returning it. * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * * Defaults to false, which means the shape of the response will not be validated upfront. * Instead, validation will only occur for the parts of the response that are accessed. */ @@ -315,6 +332,15 @@ private constructor( */ fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } + /** + * The level at which to log request and response information. + * + * [fromEnv] will set the level from environment variables. See [LogLevel.fromEnv]. + * + * Defaults to [LogLevel.fromEnv]. + */ + fun logLevel(logLevel: LogLevel) = apply { this.logLevel = logLevel } + fun apiKey(apiKey: String) = apply { this.apiKey = apiKey } fun apiSecret(apiSecret: String) = apply { this.apiSecret = apiSecret } @@ -424,6 +450,7 @@ private constructor( * System properties take precedence over environment variables. */ fun fromEnv() = apply { + logLevel(LogLevel.fromEnv()) (System.getProperty("m3ter.baseUrl") ?: System.getenv("M3TER_BASE_URL"))?.let { baseUrl(it) } @@ -439,6 +466,14 @@ private constructor( (System.getProperty("m3ter.m3TerOrgId") ?: System.getenv("M3TER_ORG_ID"))?.let { orgId(it) } + System.getenv("M3TER_CUSTOM_HEADERS")?.let { customHeadersEnv -> + for (line in customHeadersEnv.split("\n")) { + val colon = line.indexOf(':') + if (colon >= 0) { + putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim()) + } + } + } } /** @@ -491,18 +526,25 @@ private constructor( headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString()) + // We replace after all the default headers to allow end-users to overwrite them. + headers.replaceAll(this.headers.build()) + queryParams.replaceAll(this.queryParams.build()) token?.let { if (!it.isEmpty()) { - headers.put("Authorization", "Bearer $it") + headers.replace("Authorization", "Bearer $it") } } - headers.replaceAll(this.headers.build()) - queryParams.replaceAll(this.queryParams.build()) return ClientOptions( httpClient, RetryingHttpClient.builder() - .httpClient(httpClient) + .httpClient( + LoggingHttpClient.builder() + .httpClient(httpClient) + .clock(clock) + .level(logLevel) + .build() + ) .sleeper(sleeper) .clock(clock) .maxRetries(maxRetries) @@ -518,6 +560,7 @@ private constructor( responseValidation, timeout, maxRetries, + logLevel, apiKey, apiSecret, token, diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/LogLevel.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/LogLevel.kt new file mode 100644 index 00000000..9f6813ad --- /dev/null +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/LogLevel.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.m3ter.core + +/** The level at which to log request and response information. */ +enum class LogLevel { + /** No logging. */ + OFF, + /** Minimal request and response summary logs. No headers or bodies are logged. */ + INFO, + /** [INFO] logs plus details about request failures. */ + ERROR, + /** + * Full request and response logs. Sensitive headers are redacted, but sensitive data in request + * and response bodies may still be visible. + */ + DEBUG; + + /** Returns whether this level is at or higher than the given [level]. */ + fun shouldLog(level: LogLevel): Boolean = ordinal >= level.ordinal + + companion object { + + /** Returns a [LogLevel] based on the `M3TER_LOG` environment variable. */ + fun fromEnv() = + when (System.getenv("M3TER_LOG")?.lowercase()) { + "info" -> INFO + "error" -> ERROR + "debug" -> DEBUG + else -> OFF + } + } +} diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/ObjectMappers.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/ObjectMappers.kt index 17816afc..bdc5ccbe 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/ObjectMappers.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/ObjectMappers.kt @@ -29,7 +29,9 @@ import java.time.ZoneId import java.time.format.DateTimeFormatter import java.time.temporal.ChronoField -fun jsonMapper(): JsonMapper = +fun jsonMapper(): JsonMapper = JSON_MAPPER + +private val JSON_MAPPER: JsonMapper = JsonMapper.builder() .addModule(kotlinModule()) .addModule(Jdk8Module()) diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/Properties.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/Properties.kt index dcbbb2d6..670f7acd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/Properties.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/Properties.kt @@ -34,9 +34,9 @@ fun getOsName(): String { } } -fun getOsVersion(): String = System.getProperty("os.version", "unknown") +fun getOsVersion(): String = System.getProperty("os.version", "unknown") ?: "unknown" fun getPackageVersion(): String = - M3terClient::class.java.`package`.implementationVersion ?: "unknown" + M3terClient::class.java.`package`?.implementationVersion ?: "unknown" -fun getJavaVersion(): String = System.getProperty("java.version", "unknown") +fun getJavaVersion(): String = System.getProperty("java.version", "unknown") ?: "unknown" diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/RequestOptions.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/RequestOptions.kt index 8e312d67..2dc1365f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/RequestOptions.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/RequestOptions.kt @@ -33,6 +33,15 @@ class RequestOptions private constructor(val responseValidation: Boolean?, val t private var responseValidation: Boolean? = null private var timeout: Timeout? = null + /** + * Whether to call `validate` on the response before returning it. + * + * Setting this to `true` is _not_ forwards compatible with new types from the API for + * existing fields. + * + * Defaults to false, which means the shape of the response will not be validated upfront. + * Instead, validation will only occur for the parts of the response that are accessed. + */ fun responseValidation(responseValidation: Boolean) = apply { this.responseValidation = responseValidation } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/Utils.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/Utils.kt index b9750e64..05a9daa0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/Utils.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/Utils.kt @@ -5,6 +5,7 @@ package com.m3ter.core import com.m3ter.errors.M3terInvalidDataException import java.util.Collections import java.util.SortedMap +import java.util.SortedSet import java.util.concurrent.CompletableFuture import java.util.concurrent.locks.Lock @@ -16,6 +17,11 @@ internal fun T?.getOrThrow(name: String): T = internal fun List.toImmutable(): List = if (isEmpty()) Collections.emptyList() else Collections.unmodifiableList(toList()) +@JvmSynthetic +internal fun > SortedSet.toImmutable(): SortedSet = + if (isEmpty()) Collections.emptySortedSet() + else Collections.unmodifiableSortedSet(toSortedSet(comparator() ?: Comparator.naturalOrder())) + @JvmSynthetic internal fun Map.toImmutable(): Map = if (isEmpty()) immutableEmptyMap() else Collections.unmodifiableMap(toMap()) diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/HttpRequestBodies.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/HttpRequestBodies.kt index 4cd5bfc1..5b90da9c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/HttpRequestBodies.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/HttpRequestBodies.kt @@ -8,13 +8,13 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.databind.node.JsonNodeType import com.m3ter.core.MultipartField +import com.m3ter.core.toImmutable import com.m3ter.errors.M3terInvalidDataException +import java.io.ByteArrayInputStream import java.io.InputStream import java.io.OutputStream +import java.util.UUID import kotlin.jvm.optionals.getOrNull -import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder -import org.apache.hc.core5.http.ContentType -import org.apache.hc.core5.http.HttpEntity @JvmSynthetic internal inline fun json(jsonMapper: JsonMapper, value: T): HttpRequestBody = @@ -37,92 +37,231 @@ internal fun multipartFormData( jsonMapper: JsonMapper, fields: Map>, ): HttpRequestBody = - object : HttpRequestBody { - private val entity: HttpEntity by lazy { - MultipartEntityBuilder.create() - .apply { - fields.forEach { (name, field) -> - val knownValue = field.value.asKnown().getOrNull() - val parts = - if (knownValue is InputStream) { - // Read directly from the `InputStream` instead of reading it all - // into memory due to the `jsonMapper` serialization below. - sequenceOf(name to knownValue) - } else { - val node = jsonMapper.valueToTree(field.value) - serializePart(name, node) + MultipartBody.Builder() + .apply { + fields.forEach { (name, field) -> + val knownValue = field.value.asKnown().getOrNull() + val parts = + if (knownValue is InputStream) { + // Read directly from the `InputStream` instead of reading it all + // into memory due to the `jsonMapper` serialization below. + sequenceOf(name to knownValue) + } else { + val node = jsonMapper.valueToTree(field.value) + serializePart(name, node) + } + + parts.forEach { (name, bytes) -> + val partBody = + if (bytes is ByteArrayInputStream) { + val byteArray = bytes.readBytes() + + object : HttpRequestBody { + + override fun writeTo(outputStream: OutputStream) { + outputStream.write(byteArray) + } + + override fun contentType(): String = field.contentType + + override fun contentLength(): Long = byteArray.size.toLong() + + override fun repeatable(): Boolean = true + + override fun close() {} } + } else { + object : HttpRequestBody { + + override fun writeTo(outputStream: OutputStream) { + bytes.copyTo(outputStream) + } + + override fun contentType(): String = field.contentType + + override fun contentLength(): Long = -1L - parts.forEach { (name, bytes) -> - addBinaryBody( - name, - bytes, - ContentType.parseLenient(field.contentType), - field.filename().getOrNull(), - ) + override fun repeatable(): Boolean = false + + override fun close() = bytes.close() + } } - } + + addPart( + MultipartBody.Part.create( + name, + field.filename().getOrNull(), + field.contentType, + partBody, + ) + ) } - .build() + } } + .build() - private fun serializePart( - name: String, - node: JsonNode, - ): Sequence> = - when (node.nodeType) { - JsonNodeType.MISSING, - JsonNodeType.NULL -> emptySequence() - JsonNodeType.BINARY -> sequenceOf(name to node.binaryValue().inputStream()) - JsonNodeType.STRING -> sequenceOf(name to node.textValue().inputStream()) - JsonNodeType.BOOLEAN -> - sequenceOf(name to node.booleanValue().toString().inputStream()) - JsonNodeType.NUMBER -> - sequenceOf(name to node.numberValue().toString().inputStream()) - JsonNodeType.ARRAY -> - sequenceOf( - name to - node - .elements() - .asSequence() - .mapNotNull { element -> - when (element.nodeType) { - JsonNodeType.MISSING, - JsonNodeType.NULL -> null - JsonNodeType.STRING -> node.textValue() - JsonNodeType.BOOLEAN -> node.booleanValue().toString() - JsonNodeType.NUMBER -> node.numberValue().toString() - null, - JsonNodeType.BINARY, - JsonNodeType.ARRAY, - JsonNodeType.OBJECT, - JsonNodeType.POJO -> - throw M3terInvalidDataException( - "Unexpected JsonNode type in array: ${node.nodeType}" - ) - } - } - .joinToString(",") - .inputStream() - ) - JsonNodeType.OBJECT -> - node.fields().asSequence().flatMap { (key, value) -> - serializePart("$name[$key]", value) - } - JsonNodeType.POJO, - null -> - throw M3terInvalidDataException("Unexpected JsonNode type: ${node.nodeType}") +private fun serializePart(name: String, node: JsonNode): Sequence> = + when (node.nodeType) { + JsonNodeType.MISSING, + JsonNodeType.NULL -> emptySequence() + JsonNodeType.BINARY -> sequenceOf(name to node.binaryValue().inputStream()) + JsonNodeType.STRING -> sequenceOf(name to node.textValue().byteInputStream()) + JsonNodeType.BOOLEAN -> sequenceOf(name to node.booleanValue().toString().byteInputStream()) + JsonNodeType.NUMBER -> sequenceOf(name to node.numberValue().toString().byteInputStream()) + JsonNodeType.ARRAY -> + sequenceOf( + name to + node + .elements() + .asSequence() + .mapNotNull { element -> + when (element.nodeType) { + JsonNodeType.MISSING, + JsonNodeType.NULL -> null + JsonNodeType.STRING -> element.textValue() + JsonNodeType.BOOLEAN -> element.booleanValue().toString() + JsonNodeType.NUMBER -> element.numberValue().toString() + null, + JsonNodeType.BINARY, + JsonNodeType.ARRAY, + JsonNodeType.OBJECT, + JsonNodeType.POJO -> + throw M3terInvalidDataException( + "Unexpected JsonNode type in array: ${element.nodeType}" + ) + } + } + .joinToString(",") + .byteInputStream() + ) + JsonNodeType.OBJECT -> + node.fields().asSequence().flatMap { (key, value) -> + serializePart("$name[$key]", value) + } + JsonNodeType.POJO, + null -> throw M3terInvalidDataException("Unexpected JsonNode type: ${node.nodeType}") + } + +private class MultipartBody +private constructor(private val boundary: String, private val parts: List) : HttpRequestBody { + private val boundaryBytes: ByteArray = boundary.toByteArray() + private val contentType = "multipart/form-data; boundary=$boundary" + + // This must remain in sync with `contentLength`. + override fun writeTo(outputStream: OutputStream) { + parts.forEach { part -> + outputStream.write(DASHDASH) + outputStream.write(boundaryBytes) + outputStream.write(CRLF) + + outputStream.write(CONTENT_DISPOSITION) + outputStream.write(part.contentDisposition.toByteArray()) + outputStream.write(CRLF) + + outputStream.write(CONTENT_TYPE) + outputStream.write(part.contentType.toByteArray()) + outputStream.write(CRLF) + + outputStream.write(CRLF) + part.body.writeTo(outputStream) + outputStream.write(CRLF) + } + + outputStream.write(DASHDASH) + outputStream.write(boundaryBytes) + outputStream.write(DASHDASH) + outputStream.write(CRLF) + } + + override fun contentType(): String = contentType + + // This must remain in sync with `writeTo`. + override fun contentLength(): Long { + var byteCount = 0L + + parts.forEach { part -> + val contentLength = part.body.contentLength() + if (contentLength == -1L) { + return -1L } - private fun String.inputStream(): InputStream = toByteArray().inputStream() + byteCount += + DASHDASH.size + + boundaryBytes.size + + CRLF.size + + CONTENT_DISPOSITION.size + + part.contentDisposition.toByteArray().size + + CRLF.size + + CONTENT_TYPE.size + + part.contentType.toByteArray().size + + CRLF.size + + CRLF.size + + contentLength + + CRLF.size + } - override fun writeTo(outputStream: OutputStream) = entity.writeTo(outputStream) + byteCount += DASHDASH.size + boundaryBytes.size + DASHDASH.size + CRLF.size + return byteCount + } - override fun contentType(): String = entity.contentType + override fun repeatable(): Boolean = parts.all { it.body.repeatable() } - override fun contentLength(): Long = entity.contentLength + override fun close() { + parts.forEach { it.body.close() } + } - override fun repeatable(): Boolean = entity.isRepeatable + class Builder { + private val boundary = UUID.randomUUID().toString() + private val parts: MutableList = mutableListOf() - override fun close() = entity.close() + fun addPart(part: Part) = apply { parts.add(part) } + + fun build() = MultipartBody(boundary, parts.toImmutable()) + } + + class Part + private constructor( + val contentDisposition: String, + val contentType: String, + val body: HttpRequestBody, + ) { + companion object { + fun create( + name: String, + filename: String?, + contentType: String, + body: HttpRequestBody, + ): Part { + val disposition = buildString { + append("form-data; name=") + appendQuotedString(name) + if (filename != null) { + append("; filename=") + appendQuotedString(filename) + } + } + return Part(disposition, contentType, body) + } + } + } + + companion object { + private val CRLF = byteArrayOf('\r'.code.toByte(), '\n'.code.toByte()) + private val DASHDASH = byteArrayOf('-'.code.toByte(), '-'.code.toByte()) + private val CONTENT_DISPOSITION = "Content-Disposition: ".toByteArray() + private val CONTENT_TYPE = "Content-Type: ".toByteArray() + + private fun StringBuilder.appendQuotedString(key: String) { + append('"') + for (ch in key) { + when (ch) { + '\n' -> append("%0A") + '\r' -> append("%0D") + '"' -> append("%22") + else -> append(ch) + } + } + append('"') + } } +} diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/LoggingHttpClient.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/LoggingHttpClient.kt new file mode 100644 index 00000000..30d1aa03 --- /dev/null +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/LoggingHttpClient.kt @@ -0,0 +1,628 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.m3ter.core.http + +import com.m3ter.core.LogLevel +import com.m3ter.core.RequestOptions +import com.m3ter.core.checkRequired +import com.m3ter.core.toImmutable +import java.io.ByteArrayOutputStream +import java.io.InputStream +import java.io.OutputStream +import java.nio.ByteBuffer +import java.nio.charset.CharacterCodingException +import java.nio.charset.Charset +import java.nio.charset.CharsetDecoder +import java.nio.charset.CodingErrorAction +import java.nio.charset.StandardCharsets +import java.time.Clock +import java.time.Duration +import java.time.OffsetDateTime +import java.util.SortedSet +import java.util.concurrent.CompletableFuture +import java.util.concurrent.CompletionException +import kotlin.time.toKotlinDuration + +/** A wrapper [HttpClient] around [httpClient] that logs request and response information. */ +class LoggingHttpClient +private constructor( + /** The underlying [HttpClient] for making requests. */ + @get:JvmName("httpClient") val httpClient: HttpClient, + /** + * Sensitive headers to redact from logs. + * + * Defaults to `Set.of("authorization", "api-key", "x-api-key", "cookie", "set-cookie")`. + */ + @get:JvmName("redactedHeaders") val redactedHeaders: SortedSet, + /** + * The clock to use for measuring request and response durations. + * + * This is primarily useful for using a fake clock in tests. + * + * Defaults to [Clock.systemUTC]. + */ + @get:JvmName("clock") val clock: Clock, + /** + * The log level to use. + * + * Pass [LogLevel.fromEnv] to read from environment variables. + */ + @get:JvmName("level") val level: LogLevel, +) : HttpClient { + + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { + val loggingRequest = logRequest(request) + + val before = OffsetDateTime.now(clock) + val response = + try { + httpClient.execute(loggingRequest, requestOptions) + } catch (e: Throwable) { + logFailure(e, Duration.between(before, OffsetDateTime.now(clock))) + throw e + } + + val took = Duration.between(before, OffsetDateTime.now(clock)) + return logResponse(response, took) + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture { + val loggingRequest = logRequest(request) + + val before = OffsetDateTime.now(clock) + val future = + try { + httpClient.executeAsync(loggingRequest, requestOptions) + } catch (e: Throwable) { + logFailure(e, Duration.between(before, OffsetDateTime.now(clock))) + throw e + } + return future.handle { response, error -> + val took = Duration.between(before, OffsetDateTime.now(clock)) + if (error != null) { + logFailure(unwrapCompletionException(error), took) + throw error + } + logResponse(response, took) + } + } + + private fun logRequest(request: HttpRequest): HttpRequest { + if (!level.shouldLog(LogLevel.INFO)) { + return request + } + + System.err.println( + buildString { + append("--> ${request.method} ${request.url()}") + request.body?.let { + val length = it.contentLength() + append(if (length >= 0) " ($length-byte body)" else " (unknown-length body)") + } + } + ) + + if (!level.shouldLog(LogLevel.DEBUG)) { + return request + } + + logHeaders(request.headers) + + if (request.body == null) { + System.err.println("--> END ${request.method}") + System.err.println() + return request + } + + return request + .toBuilder() + .body(LoggingHttpRequestBody(request.method, request.body)) + .build() + } + + private fun logResponse(response: HttpResponse, took: Duration): HttpResponse { + if (!level.shouldLog(LogLevel.INFO)) { + return response + } + + val contentLength = response.headers().values("Content-Length").firstOrNull()?.toIntOrNull() + System.err.println( + "<-- ${response.statusCode()} (${ + buildString { + append(took.format()) + contentLength?.let { append(", $contentLength-byte body") } + } + })" + ) + + if (!level.shouldLog(LogLevel.DEBUG)) { + return response + } + + logHeaders(response.headers()) + return LoggingHttpResponse(response) + } + + private fun logFailure(error: Throwable, took: Duration) { + if (!level.shouldLog(LogLevel.ERROR)) { + return + } + + System.err.println( + buildString { + append("<-- !! ${error.javaClass.simpleName}") + error.message?.let { append(": $it") } + append(" (${took.format()})") + } + ) + } + + private fun unwrapCompletionException(error: Throwable): Throwable = + if (error is CompletionException && error.cause != null) error.cause!! else error + + private fun logHeaders(headers: Headers) = + headers.names().forEach { name -> + headers.values(name).forEach { value -> + System.err.println("$name: ${if (redactedHeaders.contains(name)) "██" else value}") + } + } + + override fun close() = httpClient.close() + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LoggingHttpClient]. + * + * The following fields are required: + * ```java + * .httpClient() + * .level() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LoggingHttpClient]. */ + class Builder internal constructor() { + + private var httpClient: HttpClient? = null + private var redactedHeaders: Set = + setOf("authorization", "api-key", "x-api-key", "cookie", "set-cookie") + private var clock: Clock = Clock.systemUTC() + private var level: LogLevel? = null + + @JvmSynthetic + internal fun from(loggingHttpClient: LoggingHttpClient) = apply { + httpClient = loggingHttpClient.httpClient + redactedHeaders = loggingHttpClient.redactedHeaders + clock = loggingHttpClient.clock + level = loggingHttpClient.level + } + + /** The underlying [HttpClient] for making requests. */ + fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient } + + /** + * Sensitive headers to redact from logs. + * + * Defaults to `Set.of("authorization", "api-key", "x-api-key", "cookie", "set-cookie")`. + */ + fun redactedHeaders(redactedHeaders: Set) = apply { + this.redactedHeaders = redactedHeaders + } + + /** + * The clock to use for measuring request and response durations. + * + * This is primarily useful for using a fake clock in tests. + * + * Defaults to [Clock.systemUTC]. + */ + fun clock(clock: Clock) = apply { this.clock = clock } + + /** + * The log level to use. + * + * Pass [LogLevel.fromEnv] to read from environment variables. + */ + fun level(level: LogLevel) = apply { this.level = level } + + /** + * Returns an immutable instance of [LoggingHttpClient]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .httpClient() + * .level() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LoggingHttpClient = + LoggingHttpClient( + checkRequired("httpClient", httpClient), + redactedHeaders.toSortedSet(String.CASE_INSENSITIVE_ORDER).toImmutable(), + clock, + checkRequired("level", level), + ) + } +} + +/** + * An [HttpRequestBody] wrapper that delegates to [body] while also logging line by line as it's + * written. + * + * The logging occurs in a streaming manner with minimal buffering. + */ +private class LoggingHttpRequestBody( + private val method: HttpMethod, + private val body: HttpRequestBody, +) : HttpRequestBody { + + private val charset by lazy { parseCharset(body.contentType()) } + + override fun writeTo(outputStream: OutputStream) { + val loggingOutputStream = LoggingOutputStream(outputStream, charset) + body.writeTo(loggingOutputStream) + + loggingOutputStream.flush() + System.err.println("--> END $method (${loggingOutputStream.writeCount()}-byte body)") + System.err.println() + } + + override fun contentType(): String? = body.contentType() + + override fun contentLength(): Long = body.contentLength() + + override fun repeatable(): Boolean = body.repeatable() + + override fun close() = body.close() +} + +/** + * An [OutputStream] wrapper that delegates to [outputStream] while also logging bytes line by line + * as it's written to. + * + * The written content is assumed to be in the given [charset] and the logging occurs in a streaming + * manner with minimal buffering. + */ +private class LoggingOutputStream(private val outputStream: OutputStream, charset: Charset?) : + OutputStream() { + + private val buffer = LoggingBuffer(charset) + + fun writeCount() = buffer.writeCount() + + override fun write(b: Int) { + outputStream.write(b) + buffer.write(b) + } + + override fun write(b: ByteArray, off: Int, len: Int) { + outputStream.write(b, off, len) + for (i in off until off + len) { + buffer.write(b[i].toInt() and 0xFF) + } + } + + /** Prints any currently buffered content. */ + override fun flush() { + buffer.flush() + outputStream.flush() + } + + override fun close() = outputStream.close() +} + +/** + * An [HttpResponse] wrapper that delegates to [response] while also logging line-by-line as it's + * read. + * + * The logging occurs in a streaming manner with minimal buffering. + */ +private class LoggingHttpResponse(private val response: HttpResponse) : HttpResponse { + + private val loggingBody: Lazy = lazy { + LoggingInputStream( + response.body(), + parseCharset(response.headers().values("Content-Type").firstOrNull()), + ) + } + + override fun statusCode(): Int = response.statusCode() + + override fun headers(): Headers = response.headers() + + override fun body(): InputStream = loggingBody.value + + override fun close() { + if (loggingBody.isInitialized()) { + loggingBody.value.close() + } + response.close() + } +} + +/** + * An [InputStream] wrapper that delegates to [inputStream] while also logging bytes line by line as + * it's read. + * + * The contents of [inputStream] are assumed to be in the given [charset] and the logging occurs in + * a streaming manner with minimal buffering. + */ +private class LoggingInputStream(private val inputStream: InputStream, charset: Charset?) : + InputStream() { + + private var isDone = false + private val buffer = LoggingBuffer(charset) + + override fun read(): Int { + if (isDone) { + return -1 + } + + val b = inputStream.read() + + if (b == -1) { + markDone() + return b + } + + buffer.write(b) + return b + } + + override fun read(b: ByteArray, off: Int, len: Int): Int { + if (isDone) { + return -1 + } + + val bytesRead = inputStream.read(b, off, len) + + if (bytesRead == -1) { + markDone() + return bytesRead + } + + for (i in off until off + bytesRead) { + buffer.write(b[i].toInt() and 0xFF) + } + return bytesRead + } + + override fun close() { + if (!isDone) { + markDone(closedEarly = true) + } + inputStream.close() + } + + private fun markDone(closedEarly: Boolean = false) { + isDone = true + buffer.flush() + val suffix = if (closedEarly) ", closed early" else "" + System.err.println("<-- END HTTP (${buffer.writeCount()}-byte body$suffix)") + System.err.println() + } +} + +/** + * A byte buffer that prints line by line, using the given [charset], as bytes are written to it. + * + * When [charset] is `null`, the buffer performs an upfront check to detect binary content. If + * non-whitespace ISO control characters are found in the first [PROBABLY_UTF8_CODE_POINT_LIMIT] + * code points, body logging is suppressed entirely. + */ +private class LoggingBuffer(charset: Charset?) { + + private val charset = charset ?: StandardCharsets.UTF_8 + + private val decoder: CharsetDecoder = + this.charset + .newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT) + private var writeCount = 0 + private val buffer = ByteArrayOutputStream(128) + + /** + * Whether logging has been suppressed because the content doesn't appear to be readable text. + * + * This is only set when [charset] is `null` and the content fails the [isProbablyUtf8] check. + */ + private var suppressed = false + + /** + * Bytes accumulated for the [isProbablyUtf8] check before any lines are printed. + * + * Once the check passes (or [charset] is non-null), this is set to `null` and bytes flow + * directly to [buffer]. + */ + private var prefetchBuffer: ByteArrayOutputStream? = + if (charset != null) null else ByteArrayOutputStream(128) + + fun writeCount() = writeCount + + fun write(b: Int) { + if (writeCount == 0) { + // Print a newline before we start printing anything to separate the printed content + // from previous content. + System.err.println() + } + + writeCount++ + + if (suppressed) { + return + } + + val prefetch = prefetchBuffer + if (prefetch != null) { + prefetch.write(b) + // Continue accumulating until we have enough bytes to decide. + if (prefetch.size() < PROBABLY_UTF8_BYTE_LIMIT && b != '\n'.code) { + return + } + // We have enough bytes. Check if the content is probably UTF-8. + prefetchBuffer = null + val bytes = prefetch.toByteArray() + if (!isProbablyUtf8(bytes)) { + suppressed = true + System.err.println("(binary body omitted)") + return + } + // Content looks like UTF-8. Feed the accumulated bytes into the normal buffer. + for (byte in bytes) { + writeToBuffer(byte.toInt() and 0xFF) + } + return + } + + writeToBuffer(b) + } + + private fun writeToBuffer(b: Int) { + if (b == '\n'.code) { + flush() + return + } + + buffer.write(b) + } + + /** Prints any currently buffered content. */ + fun flush() { + if (suppressed) { + return + } + + // If we still have a prefetch buffer when flush is called (body was shorter than the + // limit), run the check now. + val prefetch = prefetchBuffer + if (prefetch != null) { + prefetchBuffer = null + val bytes = prefetch.toByteArray() + if (bytes.isEmpty()) { + return + } + if (!isProbablyUtf8(bytes)) { + suppressed = true + System.err.println("(binary body omitted)") + return + } + for (byte in bytes) { + writeToBuffer(byte.toInt() and 0xFF) + } + } + + if (buffer.size() == 0) { + return + } + + val line = + try { + decoder.decode(ByteBuffer.wrap(buffer.toByteArray())) + } catch (e: CharacterCodingException) { + "(omitted line is not valid $charset)" + } + buffer.reset() + System.err.println(line) + } +} + +/** The maximum number of code points to sample when checking if content is probably UTF-8. */ +private const val PROBABLY_UTF8_CODE_POINT_LIMIT = 64 + +/** + * The maximum number of bytes to accumulate before running the [isProbablyUtf8] check. UTF-8 code + * points are at most 4 bytes, so this accommodates [PROBABLY_UTF8_CODE_POINT_LIMIT] code points. + */ +private const val PROBABLY_UTF8_BYTE_LIMIT = PROBABLY_UTF8_CODE_POINT_LIMIT * 4 + +/** + * Returns `true` if the given [bytes] probably contain human-readable UTF-8 text. + * + * Decodes up to [PROBABLY_UTF8_CODE_POINT_LIMIT] code points and returns `false` if any + * non-whitespace ISO control characters are found, or if the bytes are not valid UTF-8. + */ +private fun isProbablyUtf8(bytes: ByteArray): Boolean { + try { + val decoder = + StandardCharsets.UTF_8.newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT) + val charBuffer = decoder.decode(ByteBuffer.wrap(bytes)) + var codePointCount = 0 + var i = 0 + while (i < charBuffer.length && codePointCount < PROBABLY_UTF8_CODE_POINT_LIMIT) { + val codePoint = Character.codePointAt(charBuffer, i) + if (Character.isISOControl(codePoint) && !Character.isWhitespace(codePoint)) { + return false + } + i += Character.charCount(codePoint) + codePointCount++ + } + return true + } catch (e: CharacterCodingException) { + return false + } +} + +/** Returns the [Charset] in the given [contentType] string, or `null` if unspecified. */ +private fun parseCharset(contentType: String?): Charset? = + contentType + ?.split(";") + ?.drop(1) + ?.map { it.trim() } + ?.firstOrNull { it.startsWith("charset=", ignoreCase = true) } + ?.substringAfter("=") + ?.trim() + ?.removeSurrounding("\"") + ?.let { runCatching { charset(it) }.getOrNull() } + +/** Formats the [Duration] into a string like "1m 40s 467ms". */ +private fun Duration.format(): String = + toKotlinDuration().toComponents { days, hours, minutes, seconds, nanoseconds -> + buildString { + val milliseconds = nanoseconds / 1_000_000 + if (days > 0) { + append("${days}d") + } + if (hours > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${hours}h") + } + if (minutes > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${minutes}m") + } + if (seconds > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${seconds}s") + } + if (milliseconds > 0) { + if (isNotEmpty()) { + append(" ") + } + append("${milliseconds}ms") + } + + if (isEmpty()) { + append("0s") + } + } + } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/ProxyAuthenticator.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/ProxyAuthenticator.kt new file mode 100644 index 00000000..7efd7596 --- /dev/null +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/ProxyAuthenticator.kt @@ -0,0 +1,59 @@ +package com.m3ter.core.http + +import java.net.Proxy +import java.nio.charset.Charset +import java.nio.charset.StandardCharsets +import java.util.Base64 +import java.util.Optional + +/** + * Provides credentials when an HTTP proxy responds with `407 Proxy Authentication Required`. + * + * Implementations inspect the 407 [response] (typically its `Proxy-Authenticate` header) and return + * the request to retry with a `Proxy-Authorization` header set, or [Optional.empty] to abandon + * authentication and surface the 407 to the caller. + * + * Implementations must be thread-safe; they may be invoked concurrently from multiple HTTP calls. + */ +fun interface ProxyAuthenticator { + + /** + * @param proxy the proxy that produced the challenge, or [Proxy.NO_PROXY] if the route is not + * yet established + * @param request the request that produced [response] + * @param response the 407 challenge response + * @return the retry request to send (typically [request] with a `Proxy-Authorization` header + * added), or [Optional.empty] to abandon authentication + */ + fun authenticate( + proxy: Proxy, + request: HttpRequest, + response: HttpResponse, + ): Optional + + companion object { + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the ISO-8859-1 + * charset. + */ + @JvmStatic + fun basic(username: String, password: String): ProxyAuthenticator = + basic(username, password, StandardCharsets.ISO_8859_1) + + /** + * A [ProxyAuthenticator] that uses RFC 7617 Basic authentication with the given [charset]. + */ + @JvmStatic + fun basic(username: String, password: String, charset: Charset): ProxyAuthenticator { + val token = + Base64.getEncoder().encodeToString("$username:$password".toByteArray(charset)) + val headerValue = "Basic $token" + return ProxyAuthenticator { _, request, _ -> + Optional.of( + request.toBuilder().putHeader("Proxy-Authorization", headerValue).build() + ) + } + } + } +} diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/RetryingHttpClient.kt b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/RetryingHttpClient.kt index 3329ce76..3a8e7e49 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/core/http/RetryingHttpClient.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/core/http/RetryingHttpClient.kt @@ -1,3 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. + package com.m3ter.core.http import com.m3ter.core.DefaultSleeper @@ -199,7 +201,7 @@ private constructor( ?: headers.values("Retry-After").getOrNull(0)?.let { retryAfter -> retryAfter.toFloatOrNull()?.times(TimeUnit.SECONDS.toNanos(1)) ?: try { - ChronoUnit.MILLIS.between( + ChronoUnit.NANOS.between( OffsetDateTime.now(clock), OffsetDateTime.parse( retryAfter, @@ -212,13 +214,8 @@ private constructor( } } ?.let { retryAfterNanos -> - // If the API asks us to wait a certain amount of time (and it's a reasonable - // amount), just - // do what it says. - val retryAfter = Duration.ofNanos(retryAfterNanos.toLong()) - if (retryAfter in Duration.ofNanos(0)..Duration.ofMinutes(1)) { - return retryAfter - } + // If the API asks us to wait a certain amount of time, do what it says. + return Duration.ofNanos(retryAfterNanos.toLong()) } // Apply exponential backoff, but not more than the max. diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/BadRequestException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/BadRequestException.kt index 000faf17..693e21f3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/BadRequestException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/BadRequestException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class BadRequestException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("400: $body", cause) { + M3terServiceException( + "400: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 400 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/InternalServerException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/InternalServerException.kt index 1c392cba..db5f5669 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/InternalServerException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/InternalServerException.kt @@ -5,6 +5,7 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : M3terServiceException("$statusCode: $body", cause) { +) : + M3terServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/NotFoundException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/NotFoundException.kt index b45c01af..7e8663a8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/NotFoundException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/NotFoundException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class NotFoundException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("404: $body", cause) { + M3terServiceException( + "404: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 404 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/PermissionDeniedException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/PermissionDeniedException.kt index d16f5c99..b39a0d8b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/PermissionDeniedException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/PermissionDeniedException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class PermissionDeniedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("403: $body", cause) { + M3terServiceException( + "403: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 403 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/RateLimitException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/RateLimitException.kt index e3a30689..0022537d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/RateLimitException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/RateLimitException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class RateLimitException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("429: $body", cause) { + M3terServiceException( + "429: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 429 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnauthorizedException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnauthorizedException.kt index 135f6453..7bb19044 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnauthorizedException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnauthorizedException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnauthorizedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("401: $body", cause) { + M3terServiceException( + "401: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 401 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnexpectedStatusCodeException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnexpectedStatusCodeException.kt index cbb9c3d5..84b87282 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnexpectedStatusCodeException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnexpectedStatusCodeException.kt @@ -5,6 +5,7 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -14,7 +15,11 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : M3terServiceException("$statusCode: $body", cause) { +) : + M3terServiceException( + "$statusCode: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = statusCode diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnprocessableEntityException.kt b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnprocessableEntityException.kt index b46a0d4e..06dc6f07 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnprocessableEntityException.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/errors/UnprocessableEntityException.kt @@ -5,12 +5,16 @@ package com.m3ter.errors import com.m3ter.core.JsonValue import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers +import com.m3ter.core.jsonMapper import java.util.Optional import kotlin.jvm.optionals.getOrNull class UnprocessableEntityException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - M3terServiceException("422: $body", cause) { + M3terServiceException( + "422: ${if (body.isMissing()) "Unknown" else jsonMapper().writeValueAsString(body)}", + cause, + ) { override fun statusCode(): Int = 422 diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountCreateParams.kt index 3d836bc1..246d87a2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountCreateParams.kt @@ -1624,6 +1624,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1832,6 +1841,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoGenerateStatementMode = apply { if (validated) { return@apply @@ -1963,6 +1981,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreditApplicationOrder = apply { if (validated) { return@apply @@ -2071,6 +2098,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesParams.kt index a7609ab5..85f42e69 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesParams.kt @@ -605,6 +605,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -766,6 +775,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingEntity = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesResponse.kt index 11414a23..951cac60 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountEndDateBillingEntitiesResponse.kt @@ -217,6 +217,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountEndDateBillingEntitiesResponse = apply { if (validated) { return@apply @@ -490,6 +498,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FailedEntities = apply { if (validated) { return@apply @@ -799,6 +816,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdatedEntities = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListChildrenPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListChildrenPageResponse.kt index c38f4985..552294c7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListChildrenPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListChildrenPageResponse.kt @@ -167,6 +167,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountListChildrenPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListPageResponse.kt index 76e3a97b..c959a369 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanCreateParams.kt index bb2e5aef..410a72d2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanCreateParams.kt @@ -1247,6 +1247,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1441,6 +1450,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -1549,6 +1567,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanListPageResponse.kt index b2cfea29..6013bea9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountPlanListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanResponse.kt index bfcc9905..dabdf804 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanResponse.kt @@ -805,6 +805,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountPlanResponse = apply { if (validated) { return@apply @@ -967,6 +975,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -1075,6 +1092,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanUpdateParams.kt index 89874ef4..b327cf49 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountPlanUpdateParams.kt @@ -1262,6 +1262,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1456,6 +1465,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -1564,6 +1582,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountResponse.kt index 4d0969aa..f2983c8d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountResponse.kt @@ -942,6 +942,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountResponse = apply { if (validated) { return@apply @@ -1109,6 +1117,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoGenerateStatementMode = apply { if (validated) { return@apply @@ -1240,6 +1257,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreditApplicationOrder = apply { if (validated) { return@apply @@ -1348,6 +1374,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchParams.kt index 27526b77..d40aca58 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchParams.kt @@ -430,6 +430,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -557,6 +566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SortOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchResponse.kt index 851af85d..25688869 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountSearchResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AccountSearchResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountUpdateParams.kt index 93109e8b..597fd5dc 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AccountUpdateParams.kt @@ -1642,6 +1642,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1850,6 +1859,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoGenerateStatementMode = apply { if (validated) { return@apply @@ -1981,6 +1999,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreditApplicationOrder = apply { if (validated) { return@apply @@ -2089,6 +2116,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocOperationalDataRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocOperationalDataRequest.kt index d37e78e7..e3b6388e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocOperationalDataRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocOperationalDataRequest.kt @@ -242,6 +242,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AdHocOperationalDataRequest = apply { if (validated) { return@apply @@ -471,6 +479,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OperationalDataType = apply { if (validated) { return@apply @@ -592,6 +609,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocResponse.kt index 5eeae4a3..4ead2615 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocResponse.kt @@ -113,6 +113,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AdHocResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocUsageDataRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocUsageDataRequest.kt index c42168c3..f0cfe2c0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocUsageDataRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AdHocUsageDataRequest.kt @@ -479,6 +479,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AdHocUsageDataRequest = apply { if (validated) { return@apply @@ -602,6 +610,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply @@ -866,6 +883,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -993,6 +1019,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FieldType = apply { if (validated) { return@apply @@ -1154,6 +1190,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Function = apply { if (validated) { return@apply @@ -1417,6 +1463,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DimensionFilter = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/Address.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/Address.kt index 8439ea0f..792a8690 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/Address.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/Address.kt @@ -348,6 +348,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): Address = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationCreateParams.kt index 3057edb5..9d8ebe65 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationCreateParams.kt @@ -1709,6 +1709,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1964,6 +1973,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -2114,6 +2132,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -2210,6 +2237,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -2309,6 +2345,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationListPageResponse.kt index 4c7fd29c..76170014 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AggregationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationResponse.kt index a2ccafd9..17bcf697 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationResponse.kt @@ -985,6 +985,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AggregationResponse = apply { if (validated) { return@apply @@ -1198,6 +1206,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -1294,6 +1311,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1447,6 +1473,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -1543,6 +1578,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationUpdateParams.kt index cf491a7a..a4387bea 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AggregationUpdateParams.kt @@ -1727,6 +1727,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1982,6 +1991,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -2132,6 +2150,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -2228,6 +2255,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -2327,6 +2363,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenParams.kt index e155b2e0..20557cbe 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenParams.kt @@ -427,6 +427,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -558,6 +567,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GrantType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenResponse.kt index d730088f..5c49d87b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/AuthenticationGetBearerTokenResponse.kt @@ -236,6 +236,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): AuthenticationGetBearerTokenResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/Balance.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/Balance.kt index d2000e0c..4e728b08 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/Balance.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/Balance.kt @@ -1157,6 +1157,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): Balance = apply { if (validated) { return@apply @@ -1303,6 +1311,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1458,6 +1475,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateParams.kt index 46d8e492..99a1726b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateParams.kt @@ -1510,6 +1510,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1719,6 +1728,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1827,6 +1845,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateResponse.kt index 72f6456b..cbbd6b9a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleCreateResponse.kt @@ -1015,6 +1015,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleCreateResponse = apply { if (validated) { return@apply @@ -1188,6 +1196,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1296,6 +1313,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleDeleteResponse.kt index 2dee86ea..8925ec16 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleDeleteResponse.kt @@ -1015,6 +1015,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleDeleteResponse = apply { if (validated) { return@apply @@ -1188,6 +1196,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1296,6 +1313,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListPageResponse.kt index 7888086f..362e863c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListResponse.kt index 9b2abb34..fc5e89a6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleListResponse.kt @@ -1014,6 +1014,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleListResponse = apply { if (validated) { return@apply @@ -1187,6 +1195,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1295,6 +1312,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewParams.kt index 01206270..22fbeec2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewParams.kt @@ -1553,6 +1553,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1762,6 +1771,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1870,6 +1888,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewResponse.kt index 548e6bd6..d1f2e2a7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeSchedulePreviewResponse.kt @@ -1015,6 +1015,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeSchedulePreviewResponse = apply { if (validated) { return@apply @@ -1188,6 +1196,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1296,6 +1313,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleRetrieveResponse.kt index ee13daf5..2ed2f002 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleRetrieveResponse.kt @@ -1015,6 +1015,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleRetrieveResponse = apply { if (validated) { return@apply @@ -1188,6 +1196,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1296,6 +1313,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateParams.kt index 7650c814..0b9e59c1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateParams.kt @@ -1521,6 +1521,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1730,6 +1739,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1838,6 +1856,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateResponse.kt index b2365627..e0939070 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceChargeScheduleUpdateResponse.kt @@ -1015,6 +1015,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceChargeScheduleUpdateResponse = apply { if (validated) { return@apply @@ -1188,6 +1196,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1296,6 +1313,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceCreateParams.kt index 22b6720a..dec9fdca 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceCreateParams.kt @@ -2037,6 +2037,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2233,6 +2242,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -2388,6 +2406,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceListPageResponse.kt index f14fd03c..3ed7809a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceListPageResponse.kt @@ -160,6 +160,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionCreateParams.kt index 33b0f772..414f1984 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionCreateParams.kt @@ -925,6 +925,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListPageResponse.kt index e9058b2a..3f0ba0c3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListPageResponse.kt @@ -167,6 +167,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceTransactionListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListParams.kt index 5a479163..9bf2e4cc 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionListParams.kt @@ -392,6 +392,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionScheduleListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionScheduleListPageResponse.kt index 2511b50c..6a65628b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionScheduleListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionScheduleListPageResponse.kt @@ -168,6 +168,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceTransactionScheduleListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionSummaryResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionSummaryResponse.kt index 4c80c45d..a3023eed 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionSummaryResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceTransactionSummaryResponse.kt @@ -330,6 +330,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BalanceTransactionSummaryResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceUpdateParams.kt index f37d09ac..6dfeef48 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BalanceUpdateParams.kt @@ -2049,6 +2049,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2245,6 +2254,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -2400,6 +2418,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveParams.kt index 6e7cd826..b4a1129f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveParams.kt @@ -496,6 +496,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveResponse.kt index ac14d45f..d09eb04b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillApproveResponse.kt @@ -117,6 +117,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillApproveResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigResponse.kt index eec85daa..76ce5b9c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigResponse.kt @@ -370,6 +370,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillConfigResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigUpdateParams.kt index c4c61ffe..4d1b22b2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillConfigUpdateParams.kt @@ -454,6 +454,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemCreateParams.kt index b4ad0926..ff9e1182 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemCreateParams.kt @@ -1272,6 +1272,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1561,6 +1570,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemListPageResponse.kt index 669b863b..604e9ca1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillCreditLineItemListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemUpdateParams.kt index 5fe24e29..8f1d61c6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillCreditLineItemUpdateParams.kt @@ -1278,6 +1278,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1567,6 +1576,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemCreateParams.kt index 2d35a191..6cccb7ca 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemCreateParams.kt @@ -1271,6 +1271,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1560,6 +1569,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemListPageResponse.kt index 5fc958b3..f387872b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemListPageResponse.kt @@ -167,6 +167,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillDebitLineItemListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemUpdateParams.kt index 73516b71..306da653 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillDebitLineItemUpdateParams.kt @@ -1277,6 +1277,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1566,6 +1575,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobCreateParams.kt index ce40fdd5..dca98259 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobCreateParams.kt @@ -1615,6 +1615,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1841,6 +1850,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingFrequency = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobListPageResponse.kt index d81636ab..d51905b9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillJobListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobRecalculateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobRecalculateParams.kt index 309ba80c..a6d69064 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobRecalculateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobRecalculateParams.kt @@ -502,6 +502,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobResponse.kt index 38a5ecf0..1f6c1007 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillJobResponse.kt @@ -1160,6 +1160,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillJobResponse = apply { if (validated) { return@apply @@ -1354,6 +1362,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingFrequency = apply { if (validated) { return@apply @@ -1497,6 +1514,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1626,6 +1652,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillLineItemListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillLineItemListPageResponse.kt index 336f7551..d2cec68d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillLineItemListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillLineItemListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillLineItemListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListPageResponse.kt index 7f0eb678..96abb0db 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListParams.kt index 483aeb88..a0edf6b2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillListParams.kt @@ -587,6 +587,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillResponse.kt index 97554d54..4cd57c5b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillResponse.kt @@ -1502,6 +1502,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillResponse = apply { if (validated) { return@apply @@ -1714,6 +1722,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingFrequency = apply { if (validated) { return@apply @@ -3411,6 +3428,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItem = apply { if (validated) { return@apply @@ -3713,6 +3739,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply @@ -3812,6 +3848,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Additional = apply { if (validated) { return@apply @@ -3914,6 +3960,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Group = apply { if (validated) { return@apply @@ -4020,6 +4076,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply @@ -4542,6 +4608,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UsagePerPricingBand = apply { if (validated) { return@apply @@ -4817,6 +4893,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchParams.kt index ade83651..1e4d011a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchParams.kt @@ -430,6 +430,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -557,6 +566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SortOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchResponse.kt index c40a2a4e..3e912f56 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillSearchResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): BillSearchResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillUpdateStatusParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillUpdateStatusParams.kt index 90165537..d078cdf1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/BillUpdateStatusParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/BillUpdateStatusParams.kt @@ -396,6 +396,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -525,6 +534,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateParams.kt index 574033a7..cd20891b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateParams.kt @@ -1605,6 +1605,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1812,6 +1821,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1940,6 +1958,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateResponse.kt index 1483025d..0b90eb5b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeCreateResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a Charge entity */ class ChargeCreateResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1016,6 +1017,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeCreateResponse = apply { if (validated) { return@apply @@ -1179,6 +1188,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1307,6 +1325,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeDeleteResponse.kt index 547e794e..b227d66e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeDeleteResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a Charge entity */ class ChargeDeleteResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1016,6 +1017,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeDeleteResponse = apply { if (validated) { return@apply @@ -1179,6 +1188,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1307,6 +1325,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListPageResponse.kt index 21ed91db..955f1e2f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListParams.kt index 370d9c34..39e37214 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListParams.kt @@ -404,6 +404,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListResponse.kt index 6164b26d..13ea0046 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeListResponse.kt @@ -1016,6 +1016,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeListResponse = apply { if (validated) { return@apply @@ -1179,6 +1187,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1307,6 +1324,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeRetrieveResponse.kt index 9df022e6..7d686b01 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeRetrieveResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a Charge entity */ class ChargeRetrieveResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1016,6 +1017,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeRetrieveResponse = apply { if (validated) { return@apply @@ -1179,6 +1188,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1307,6 +1325,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateParams.kt index d17b9210..935970f5 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateParams.kt @@ -1612,6 +1612,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1819,6 +1828,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1947,6 +1965,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateResponse.kt index 816af710..6c47e561 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ChargeUpdateResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a Charge entity */ class ChargeUpdateResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -1016,6 +1017,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ChargeUpdateResponse = apply { if (validated) { return@apply @@ -1179,6 +1188,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply @@ -1307,6 +1325,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentCreateParams.kt index 29200327..fc7d03f2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentCreateParams.kt @@ -2624,6 +2624,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2878,6 +2887,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -3024,6 +3042,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentFee.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentFee.kt index e9f00da0..0328ca47 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentFee.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentFee.kt @@ -239,6 +239,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CommitmentFee = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentListPageResponse.kt index 223b70be..ec31c1d5 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CommitmentListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentResponse.kt index a2ff8b1e..3b5292f1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentResponse.kt @@ -1479,6 +1479,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CommitmentResponse = apply { if (validated) { return@apply @@ -1671,6 +1679,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -1817,6 +1834,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchParams.kt index a43d0762..d9d58dde 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchParams.kt @@ -430,6 +430,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Operator = apply { if (validated) { return@apply @@ -557,6 +566,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SortOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchResponse.kt index d1bc05de..92d2b77c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentSearchResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CommitmentSearchResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentUpdateParams.kt index 9ebc2247..caf3b44b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CommitmentUpdateParams.kt @@ -2628,6 +2628,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2882,6 +2891,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ChildBillingMode = apply { if (validated) { return@apply @@ -3028,6 +3046,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationCreateParams.kt index 1b1371f9..7c262bf3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationCreateParams.kt @@ -1263,6 +1263,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1465,6 +1474,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -1561,6 +1579,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationListPageResponse.kt index e1bc831b..fde7d092 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CompoundAggregationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationResponse.kt index fa69a49e..a00fbea4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationResponse.kt @@ -803,6 +803,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CompoundAggregationResponse = apply { if (validated) { return@apply @@ -919,6 +927,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1072,6 +1089,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -1168,6 +1194,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationUpdateParams.kt index a8d851a8..03090207 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CompoundAggregationUpdateParams.kt @@ -1280,6 +1280,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1482,6 +1491,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Rounding = apply { if (validated) { return@apply @@ -1578,6 +1596,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractCreateParams.kt index b12d4cef..0d48da80 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractCreateParams.kt @@ -1331,6 +1331,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1495,6 +1504,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1719,6 +1737,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UsageFilter = apply { if (validated) { return@apply @@ -1839,6 +1866,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Mode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesParams.kt index f7c5abdd..1917be58 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesParams.kt @@ -611,6 +611,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -772,6 +781,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillingEntity = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesResponse.kt index 5326da6f..b364a7df 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractEndDateBillingEntitiesResponse.kt @@ -217,6 +217,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ContractEndDateBillingEntitiesResponse = apply { if (validated) { return@apply @@ -490,6 +498,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FailedEntities = apply { if (validated) { return@apply @@ -799,6 +816,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UpdatedEntities = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractListPageResponse.kt index cfd2ef49..b9e6f377 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ContractListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractResponse.kt index 39a1fc2a..36b05776 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractResponse.kt @@ -796,6 +796,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ContractResponse = apply { if (validated) { return@apply @@ -924,6 +932,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1148,6 +1165,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UsageFilter = apply { if (validated) { return@apply @@ -1268,6 +1294,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Mode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractUpdateParams.kt index b3011060..5cf7fdfa 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ContractUpdateParams.kt @@ -1346,6 +1346,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1510,6 +1519,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1734,6 +1752,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): UsageFilter = apply { if (validated) { return@apply @@ -1854,6 +1881,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Mode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentCreateParams.kt index c58c36d6..e468fae9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentCreateParams.kt @@ -784,6 +784,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentListPageResponse.kt index fa9448c7..fb675614 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterAdjustmentListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentResponse.kt index 85a3a108..6ab4f1c2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentResponse.kt @@ -499,6 +499,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterAdjustmentResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentUpdateParams.kt index 6ab83efb..b447c551 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterAdjustmentUpdateParams.kt @@ -786,6 +786,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterCreateParams.kt index ce564b6b..f5c129ee 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterCreateParams.kt @@ -667,6 +667,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterListPageResponse.kt index 33602666..61179bdd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingCreateParams.kt index fe51f9bd..3867afa3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingCreateParams.kt @@ -1555,6 +1555,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingListPageResponse.kt index 2045d3ef..7abc5f83 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingListPageResponse.kt @@ -168,6 +168,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterPricingListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingResponse.kt index 31376195..18ad1c2e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingResponse.kt @@ -923,6 +923,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterPricingResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingUpdateParams.kt index a6e55359..37a15a71 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterPricingUpdateParams.kt @@ -1567,6 +1567,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterResponse.kt index 49196532..5fbec0e2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterResponse.kt @@ -463,6 +463,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CounterResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterUpdateParams.kt index 1823f70a..4279df9e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CounterUpdateParams.kt @@ -679,6 +679,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditLineItemResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditLineItemResponse.kt index dea5d87e..ef620951 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditLineItemResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditLineItemResponse.kt @@ -650,6 +650,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CreditLineItemResponse = apply { if (validated) { return@apply @@ -895,6 +903,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonCreateParams.kt index 6a70af89..e29a4841 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonCreateParams.kt @@ -603,6 +603,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonListPageResponse.kt index ed54121e..211ffc3b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CreditReasonListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonResponse.kt index fd5464b9..1ea65ae2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonResponse.kt @@ -425,6 +425,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CreditReasonResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonUpdateParams.kt index c9b8496c..0faf003e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CreditReasonUpdateParams.kt @@ -611,6 +611,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyConversion.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyConversion.kt index 983300a5..988a45f2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyConversion.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyConversion.kt @@ -201,6 +201,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CurrencyConversion = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyCreateParams.kt index 4330aec2..f8211983 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyCreateParams.kt @@ -740,6 +740,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -935,6 +944,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RoundingMode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyListPageResponse.kt index 5877dc3e..cd122a06 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CurrencyListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyResponse.kt index 57f08d0f..d3605610 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyResponse.kt @@ -504,6 +504,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CurrencyResponse = apply { if (validated) { return@apply @@ -675,6 +683,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RoundingMode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyUpdateParams.kt index dcb89dd3..a8672d48 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CurrencyUpdateParams.kt @@ -752,6 +752,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -947,6 +956,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): RoundingMode = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldUpdateParams.kt index b173908c..6663ca49 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldUpdateParams.kt @@ -1031,6 +1031,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1180,6 +1189,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Account = apply { if (validated) { return@apply @@ -1280,6 +1298,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountPlan = apply { if (validated) { return@apply @@ -1380,6 +1407,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -1481,6 +1517,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CompoundAggregation = apply { if (validated) { return@apply @@ -1582,6 +1627,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Contract = apply { if (validated) { return@apply @@ -1682,6 +1736,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Meter = apply { if (validated) { return@apply @@ -1782,6 +1845,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Organization = apply { if (validated) { return@apply @@ -1882,6 +1954,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Plan = apply { if (validated) { return@apply @@ -1982,6 +2063,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PlanTemplate = apply { if (validated) { return@apply @@ -2082,6 +2172,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Product = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldsResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldsResponse.kt index 52ff3465..299cf5b4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldsResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/CustomFieldsResponse.kt @@ -689,6 +689,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): CustomFieldsResponse = apply { if (validated) { return@apply @@ -804,6 +812,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Account = apply { if (validated) { return@apply @@ -904,6 +921,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AccountPlan = apply { if (validated) { return@apply @@ -1004,6 +1030,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -1105,6 +1140,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CompoundAggregation = apply { if (validated) { return@apply @@ -1206,6 +1250,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Contract = apply { if (validated) { return@apply @@ -1306,6 +1359,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Meter = apply { if (validated) { return@apply @@ -1406,6 +1468,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Organization = apply { if (validated) { return@apply @@ -1506,6 +1577,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Plan = apply { if (validated) { return@apply @@ -1606,6 +1686,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PlanTemplate = apply { if (validated) { return@apply @@ -1706,6 +1795,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Product = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerAccountGroup.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerAccountGroup.kt index 4dfe51ca..584a4f1e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerAccountGroup.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerAccountGroup.kt @@ -123,6 +123,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExplorerAccountGroup = apply { if (validated) { return@apply @@ -241,6 +249,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GroupType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerDimensionGroup.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerDimensionGroup.kt index 4324e968..22c7a7a1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerDimensionGroup.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerDimensionGroup.kt @@ -206,6 +206,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExplorerDimensionGroup = apply { if (validated) { return@apply @@ -330,6 +338,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GroupType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerGroup.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerGroup.kt index 5cea7a59..e4c18686 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerGroup.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerGroup.kt @@ -116,6 +116,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExplorerGroup = apply { if (validated) { return@apply @@ -234,6 +242,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GroupType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerTimeGroup.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerTimeGroup.kt index 372eb1dc..9f5b1264 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerTimeGroup.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExplorerTimeGroup.kt @@ -175,6 +175,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExplorerTimeGroup = apply { if (validated) { return@apply @@ -310,6 +318,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Frequency = apply { if (validated) { return@apply @@ -442,6 +459,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): GroupType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportCreateAdhocParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportCreateAdhocParams.kt index bb0bdb20..eac9eabb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportCreateAdhocParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportCreateAdhocParams.kt @@ -301,6 +301,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitAdHocOperationalDataRequest(AdHocOperationalDataRequest adHocOperationalDataRequest) { + * return Optional.of(adHocOperationalDataRequest.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { adHocOperationalDataRequest != null -> @@ -312,6 +341,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateParams.kt index 614a69c9..7979a02d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateParams.kt @@ -286,6 +286,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitDataExportDestinationS3Request(DataExportDestinationS3Request dataExportDestinationS3Request) { + * return Optional.of(dataExportDestinationS3Request.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { dataExportDestinationS3Request != null -> @@ -299,6 +328,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateResponse.kt index c1b3dcce..f499e192 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationCreateResponse.kt @@ -63,6 +63,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportDestinationCreateResponse.accept(new DataExportDestinationCreateResponse.Visitor>() { + * @Override + * public Optional visitExportDestinationS3(ExportDestinationS3Response exportDestinationS3) { + * return Optional.of(exportDestinationS3.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { exportDestinationS3 != null -> visitor.visitExportDestinationS3(exportDestinationS3) @@ -75,6 +104,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationCreateResponse = apply { if (validated) { return@apply @@ -201,6 +238,10 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): DataExportDestinationCreateResponse { val json = JsonValue.fromJsonNode(node) + val destinationType = + json.asObject().getOrNull()?.get("destinationType")?.asString()?.getOrNull() + + when (destinationType) {} val bestMatches = sequenceOf( @@ -880,6 +921,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationS3Response = apply { if (validated) { return@apply @@ -1040,6 +1090,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply @@ -1860,6 +1920,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationGoogleCloudStorageResponse = apply { if (validated) { return@apply @@ -2026,6 +2095,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationDeleteResponse.kt index 3dd32606..0f8ba3be 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationDeleteResponse.kt @@ -63,6 +63,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportDestinationDeleteResponse.accept(new DataExportDestinationDeleteResponse.Visitor>() { + * @Override + * public Optional visitExportDestinationS3(ExportDestinationS3Response exportDestinationS3) { + * return Optional.of(exportDestinationS3.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { exportDestinationS3 != null -> visitor.visitExportDestinationS3(exportDestinationS3) @@ -75,6 +104,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationDeleteResponse = apply { if (validated) { return@apply @@ -201,6 +238,10 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): DataExportDestinationDeleteResponse { val json = JsonValue.fromJsonNode(node) + val destinationType = + json.asObject().getOrNull()?.get("destinationType")?.asString()?.getOrNull() + + when (destinationType) {} val bestMatches = sequenceOf( @@ -880,6 +921,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationS3Response = apply { if (validated) { return@apply @@ -1040,6 +1090,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply @@ -1860,6 +1920,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationGoogleCloudStorageResponse = apply { if (validated) { return@apply @@ -2026,6 +2095,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationGoogleCloudStorageRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationGoogleCloudStorageRequest.kt index f49b29db..afd0353a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationGoogleCloudStorageRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationGoogleCloudStorageRequest.kt @@ -485,6 +485,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationGoogleCloudStorageRequest = apply { if (validated) { return@apply @@ -612,6 +620,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DestinationType = apply { if (validated) { return@apply @@ -755,6 +772,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationListPageResponse.kt index b992c753..a046053c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationResponse.kt index 3e0ffcf8..ee9b952b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationResponse.kt @@ -429,6 +429,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationResponse = apply { if (validated) { return@apply @@ -561,6 +569,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DestinationType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationRetrieveResponse.kt index 1adfb233..5ea020c2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationRetrieveResponse.kt @@ -63,6 +63,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportDestinationRetrieveResponse.accept(new DataExportDestinationRetrieveResponse.Visitor>() { + * @Override + * public Optional visitExportDestinationS3(ExportDestinationS3Response exportDestinationS3) { + * return Optional.of(exportDestinationS3.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { exportDestinationS3 != null -> visitor.visitExportDestinationS3(exportDestinationS3) @@ -75,6 +104,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationRetrieveResponse = apply { if (validated) { return@apply @@ -204,6 +241,10 @@ private constructor( node: JsonNode ): DataExportDestinationRetrieveResponse { val json = JsonValue.fromJsonNode(node) + val destinationType = + json.asObject().getOrNull()?.get("destinationType")?.asString()?.getOrNull() + + when (destinationType) {} val bestMatches = sequenceOf( @@ -883,6 +924,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationS3Response = apply { if (validated) { return@apply @@ -1043,6 +1093,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply @@ -1863,6 +1923,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationGoogleCloudStorageResponse = apply { if (validated) { return@apply @@ -2029,6 +2098,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationS3Request.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationS3Request.kt index 5b2d87b5..6647b3a4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationS3Request.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationS3Request.kt @@ -399,6 +399,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationS3Request = apply { if (validated) { return@apply @@ -520,6 +528,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DestinationType = apply { if (validated) { return@apply @@ -663,6 +680,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateParams.kt index be0a46ad..dd0f11ef 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateParams.kt @@ -298,6 +298,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitDataExportDestinationS3Request(DataExportDestinationS3Request dataExportDestinationS3Request) { + * return Optional.of(dataExportDestinationS3Request.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { dataExportDestinationS3Request != null -> @@ -311,6 +340,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateResponse.kt index 837a8654..c9560d2f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportDestinationUpdateResponse.kt @@ -63,6 +63,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportDestinationUpdateResponse.accept(new DataExportDestinationUpdateResponse.Visitor>() { + * @Override + * public Optional visitExportDestinationS3(ExportDestinationS3Response exportDestinationS3) { + * return Optional.of(exportDestinationS3.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { exportDestinationS3 != null -> visitor.visitExportDestinationS3(exportDestinationS3) @@ -75,6 +104,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportDestinationUpdateResponse = apply { if (validated) { return@apply @@ -201,6 +238,10 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): DataExportDestinationUpdateResponse { val json = JsonValue.fromJsonNode(node) + val destinationType = + json.asObject().getOrNull()?.get("destinationType")?.asString()?.getOrNull() + + when (destinationType) {} val bestMatches = sequenceOf( @@ -880,6 +921,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationS3Response = apply { if (validated) { return@apply @@ -1040,6 +1090,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply @@ -1860,6 +1920,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportDestinationGoogleCloudStorageResponse = apply { if (validated) { return@apply @@ -2026,6 +2095,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PartitionOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobGetDownloadUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobGetDownloadUrlResponse.kt index 5b872900..75fb4994 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobGetDownloadUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobGetDownloadUrlResponse.kt @@ -163,6 +163,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportJobGetDownloadUrlResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListPageResponse.kt index abd359c1..44af4063 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListPageResponse.kt @@ -165,6 +165,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportJobListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListParams.kt index 7ed906fd..fd4875a2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobListParams.kt @@ -405,6 +405,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobResponse.kt index 538c5b66..59af0eee 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportJobResponse.kt @@ -342,6 +342,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportJobResponse = apply { if (validated) { return@apply @@ -468,6 +476,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply @@ -604,6 +621,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateParams.kt index 1a426aee..c799791c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateParams.kt @@ -300,6 +300,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitOperationalDataExportScheduleRequest(OperationalDataExportScheduleRequest operationalDataExportScheduleRequest) { + * return Optional.of(operationalDataExportScheduleRequest.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportScheduleRequest != null -> @@ -313,6 +342,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateResponse.kt index 6a719943..dc1fa9fe 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleCreateResponse.kt @@ -51,6 +51,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportScheduleCreateResponse.accept(new DataExportScheduleCreateResponse.Visitor>() { + * @Override + * public Optional visitOperationalDataExportSchedule(OperationalDataExportScheduleResponse operationalDataExportSchedule) { + * return Optional.of(operationalDataExportSchedule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportSchedule != null -> @@ -62,6 +91,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleCreateResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleDeleteResponse.kt index f751d76b..feab7eb4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleDeleteResponse.kt @@ -51,6 +51,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportScheduleDeleteResponse.accept(new DataExportScheduleDeleteResponse.Visitor>() { + * @Override + * public Optional visitOperationalDataExportSchedule(OperationalDataExportScheduleResponse operationalDataExportSchedule) { + * return Optional.of(operationalDataExportSchedule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportSchedule != null -> @@ -62,6 +91,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleDeleteResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListPageResponse.kt index 81f7a3d2..5955cdc0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListResponse.kt index 3164f27e..2ee5a74a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleListResponse.kt @@ -671,6 +671,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleListResponse = apply { if (validated) { return@apply @@ -815,6 +823,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExportFileFormat = apply { if (validated) { return@apply @@ -954,6 +971,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ScheduleType = apply { if (validated) { return@apply @@ -1080,6 +1106,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleRetrieveResponse.kt index 7a73fcc3..37ee6969 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleRetrieveResponse.kt @@ -51,6 +51,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportScheduleRetrieveResponse.accept(new DataExportScheduleRetrieveResponse.Visitor>() { + * @Override + * public Optional visitOperationalDataExportSchedule(OperationalDataExportScheduleResponse operationalDataExportSchedule) { + * return Optional.of(operationalDataExportSchedule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportSchedule != null -> @@ -62,6 +91,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleRetrieveResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateParams.kt index 18e7a1f8..e2c6e5ac 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateParams.kt @@ -304,6 +304,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = body.accept(new Body.Visitor>() { + * @Override + * public Optional visitOperationalDataExportScheduleRequest(OperationalDataExportScheduleRequest operationalDataExportScheduleRequest) { + * return Optional.of(operationalDataExportScheduleRequest.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and + * the current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportScheduleRequest != null -> @@ -317,6 +346,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateResponse.kt index a4af201a..09166d3d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataExportScheduleUpdateResponse.kt @@ -51,6 +51,35 @@ private constructor( fun _json(): Optional = Optional.ofNullable(_json) + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of the + * SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import com.m3ter.core.JsonValue; + * import java.util.Optional; + * + * Optional result = dataExportScheduleUpdateResponse.accept(new DataExportScheduleUpdateResponse.Visitor>() { + * @Override + * public Optional visitOperationalDataExportSchedule(OperationalDataExportScheduleResponse operationalDataExportSchedule) { + * return Optional.of(operationalDataExportSchedule.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws M3terInvalidDataException if [Visitor.unknown] is not overridden in [visitor] and the + * current variant is unknown. + */ fun accept(visitor: Visitor): T = when { operationalDataExportSchedule != null -> @@ -62,6 +91,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataExportScheduleUpdateResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataField.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataField.kt index d69c4421..f1e70396 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DataField.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DataField.kt @@ -243,6 +243,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DataField = apply { if (validated) { return@apply @@ -398,6 +406,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Category = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitLineItemResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitLineItemResponse.kt index 6c8bf2c3..27d29183 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitLineItemResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitLineItemResponse.kt @@ -647,6 +647,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DebitLineItemResponse = apply { if (validated) { return@apply @@ -892,6 +900,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonCreateParams.kt index 10c3e0e6..5ddbf301 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonCreateParams.kt @@ -603,6 +603,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonListPageResponse.kt index 96fd6c68..854fb4f3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DebitReasonListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonResponse.kt index 9c4a4ecc..e9edf39b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonResponse.kt @@ -425,6 +425,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DebitReasonResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonUpdateParams.kt index 17e4e4c6..7d8f93d0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DebitReasonUpdateParams.kt @@ -611,6 +611,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DerivedField.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DerivedField.kt index 48a47e66..b23fcb33 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DerivedField.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DerivedField.kt @@ -291,6 +291,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DerivedField = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/DownloadUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/DownloadUrlResponse.kt index c5e11e68..0b9ce5d3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/DownloadUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/DownloadUrlResponse.kt @@ -114,6 +114,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): DownloadUrlResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetFieldsResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetFieldsResponse.kt index 0f9f45ae..cec45748 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetFieldsResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetFieldsResponse.kt @@ -128,6 +128,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): EventGetFieldsResponse = apply { if (validated) { return@apply @@ -218,6 +226,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Events = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetTypesResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetTypesResponse.kt index 622dd34d..af4d7093 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetTypesResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventGetTypesResponse.kt @@ -139,6 +139,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): EventGetTypesResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventListPageResponse.kt index 1a6f9adb..ef72f5c9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): EventListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventResponse.kt index 553f3a15..3424d63c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/EventResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/EventResponse.kt @@ -276,6 +276,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): EventResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingCreateParams.kt index 9a77e707..8f7ed7c7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingCreateParams.kt @@ -851,6 +851,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByExternalEntityPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByExternalEntityPageResponse.kt index 73f04c48..b386607d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByExternalEntityPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByExternalEntityPageResponse.kt @@ -171,6 +171,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ExternalMappingListByExternalEntityPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByM3terEntityPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByM3terEntityPageResponse.kt index 91a60dcc..88e30bc2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByM3terEntityPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListByM3terEntityPageResponse.kt @@ -171,6 +171,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ExternalMappingListByM3terEntityPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListPageResponse.kt index 45e7fdf4..387d47f0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ExternalMappingListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingResponse.kt index 07955898..0390fb2b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingResponse.kt @@ -560,6 +560,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ExternalMappingResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingUpdateParams.kt index a7d1f89a..f22514c3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ExternalMappingUpdateParams.kt @@ -863,6 +863,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/FileUploadJobResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/FileUploadJobResponse.kt index 3176e619..61080931 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/FileUploadJobResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/FileUploadJobResponse.kt @@ -399,6 +399,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): FileUploadJobResponse = apply { if (validated) { return@apply @@ -540,6 +548,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateParams.kt index 91fc5847..1b20b740 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateParams.kt @@ -972,6 +972,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1115,6 +1124,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -1422,6 +1440,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Credentials = apply { if (validated) { return@apply @@ -1507,6 +1534,8 @@ private constructor( @JvmField val SAGE_INTACCT_CLIENT_SECRET = of("SAGE_INTACCT_CLIENT_SECRET") + @JvmField val STATIC_API_KEY = of("STATIC_API_KEY") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1529,6 +1558,7 @@ private constructor( SLACK_WEBHOOK, SAGE_INTACCT_CLIENT_CREDENTIALS, SAGE_INTACCT_CLIENT_SECRET, + STATIC_API_KEY, } /** @@ -1558,6 +1588,7 @@ private constructor( SLACK_WEBHOOK, SAGE_INTACCT_CLIENT_CREDENTIALS, SAGE_INTACCT_CLIENT_SECRET, + STATIC_API_KEY, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1588,6 +1619,7 @@ private constructor( SLACK_WEBHOOK -> Value.SLACK_WEBHOOK SAGE_INTACCT_CLIENT_CREDENTIALS -> Value.SAGE_INTACCT_CLIENT_CREDENTIALS SAGE_INTACCT_CLIENT_SECRET -> Value.SAGE_INTACCT_CLIENT_SECRET + STATIC_API_KEY -> Value.STATIC_API_KEY else -> Value._UNKNOWN } @@ -1619,6 +1651,7 @@ private constructor( SLACK_WEBHOOK -> Known.SLACK_WEBHOOK SAGE_INTACCT_CLIENT_CREDENTIALS -> Known.SAGE_INTACCT_CLIENT_CREDENTIALS SAGE_INTACCT_CLIENT_SECRET -> Known.SAGE_INTACCT_CLIENT_SECRET + STATIC_API_KEY -> Known.STATIC_API_KEY else -> throw M3terInvalidDataException("Unknown Type: $value") } @@ -1638,6 +1671,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1835,6 +1878,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Destination = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateResponse.kt index 36ae4e2d..d1614019 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationCreateResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a IntegrationConfigResponse entity. */ class IntegrationConfigurationCreateResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -714,6 +715,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationCreateResponse = apply { if (validated) { return@apply @@ -829,6 +838,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -961,6 +979,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TriggerType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationDeleteResponse.kt index 7e55d6da..a5c04f96 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationDeleteResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a IntegrationConfigResponse entity. */ class IntegrationConfigurationDeleteResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -714,6 +715,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationDeleteResponse = apply { if (validated) { return@apply @@ -829,6 +838,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -961,6 +979,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TriggerType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationEnableResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationEnableResponse.kt index 0a172e07..8064a82b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationEnableResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationEnableResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a IntegrationConfigResponse entity. */ class IntegrationConfigurationEnableResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -714,6 +715,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationEnableResponse = apply { if (validated) { return@apply @@ -829,6 +838,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -961,6 +979,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TriggerType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListPageResponse.kt index c5820914..4cbd349d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListResponse.kt index 6766a561..0a930b06 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationListResponse.kt @@ -713,6 +713,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationListResponse = apply { if (validated) { return@apply @@ -828,6 +836,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -960,6 +977,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TriggerType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationResponse.kt index 5224f989..d10ba78e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationResponse.kt @@ -730,6 +730,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationResponse = apply { if (validated) { return@apply @@ -928,6 +936,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateParams.kt index 3b06bdff..e5833c42 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateParams.kt @@ -989,6 +989,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1132,6 +1141,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -1439,6 +1457,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Credentials = apply { if (validated) { return@apply @@ -1524,6 +1551,8 @@ private constructor( @JvmField val SAGE_INTACCT_CLIENT_SECRET = of("SAGE_INTACCT_CLIENT_SECRET") + @JvmField val STATIC_API_KEY = of("STATIC_API_KEY") + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1546,6 +1575,7 @@ private constructor( SLACK_WEBHOOK, SAGE_INTACCT_CLIENT_CREDENTIALS, SAGE_INTACCT_CLIENT_SECRET, + STATIC_API_KEY, } /** @@ -1575,6 +1605,7 @@ private constructor( SLACK_WEBHOOK, SAGE_INTACCT_CLIENT_CREDENTIALS, SAGE_INTACCT_CLIENT_SECRET, + STATIC_API_KEY, /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1605,6 +1636,7 @@ private constructor( SLACK_WEBHOOK -> Value.SLACK_WEBHOOK SAGE_INTACCT_CLIENT_CREDENTIALS -> Value.SAGE_INTACCT_CLIENT_CREDENTIALS SAGE_INTACCT_CLIENT_SECRET -> Value.SAGE_INTACCT_CLIENT_SECRET + STATIC_API_KEY -> Value.STATIC_API_KEY else -> Value._UNKNOWN } @@ -1636,6 +1668,7 @@ private constructor( SLACK_WEBHOOK -> Known.SLACK_WEBHOOK SAGE_INTACCT_CLIENT_CREDENTIALS -> Known.SAGE_INTACCT_CLIENT_CREDENTIALS SAGE_INTACCT_CLIENT_SECRET -> Known.SAGE_INTACCT_CLIENT_SECRET + STATIC_API_KEY -> Known.STATIC_API_KEY else -> throw M3terInvalidDataException("Unknown Type: $value") } @@ -1655,6 +1688,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1852,6 +1895,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Destination = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateResponse.kt index 795ed52f..52a4195f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/IntegrationConfigurationUpdateResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull +/** Response containing a IntegrationConfigResponse entity. */ class IntegrationConfigurationUpdateResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( @@ -714,6 +715,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): IntegrationConfigurationUpdateResponse = apply { if (validated) { return@apply @@ -829,6 +838,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ConfigData = apply { if (validated) { return@apply @@ -961,6 +979,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TriggerType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/InvitationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/InvitationResponse.kt index 44321abe..f0208a09 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/InvitationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/InvitationResponse.kt @@ -648,6 +648,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): InvitationResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LineItemResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LineItemResponse.kt index a5a3fb29..a922b0d8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LineItemResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LineItemResponse.kt @@ -1816,6 +1816,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LineItemResponse = apply { if (validated) { return@apply @@ -1990,6 +1998,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Additional = apply { if (validated) { return@apply @@ -2494,6 +2511,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BandUsage = apply { if (validated) { return@apply @@ -2638,6 +2664,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Group = apply { if (validated) { return@apply @@ -2870,6 +2905,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): LineItemType = apply { if (validated) { return@apply @@ -2970,6 +3014,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableListPageResponse.kt index eccef7b3..366bb3bd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveParams.kt index 8a7c05d6..1d65a91c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveParams.kt @@ -431,6 +431,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -565,6 +574,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ContentType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveResponse.kt index 506665ba..dd29e3f2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataArchieveResponse.kt @@ -160,6 +160,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataArchieveResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyParams.kt index 59b7a8b1..60463a8f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyParams.kt @@ -413,6 +413,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyResponse.kt index 50f29248..ae186707 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataCopyResponse.kt @@ -155,6 +155,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataCopyResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyParams.kt index bc39251a..e467c0d2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyParams.kt @@ -412,6 +412,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyResponse.kt index 45f493ac..5c11e378 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteKeyResponse.kt @@ -332,6 +332,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataDeleteKeyResponse = apply { if (validated) { return@apply @@ -426,6 +434,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteResponse.kt index ba126bef..f96f2a04 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataDeleteResponse.kt @@ -123,6 +123,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataDeleteResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlParams.kt index 36f5e7eb..6f612076 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlParams.kt @@ -651,6 +651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -797,6 +806,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ContentType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlResponse.kt index f3f55a5a..0321db87 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataGenerateDownloadUrlResponse.kt @@ -190,6 +190,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataGenerateDownloadUrlResponse = apply { if (validated) { return@apply @@ -279,6 +287,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Headers = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDeleteResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDeleteResponse.kt index 7693a396..41e35e57 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDeleteResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDeleteResponse.kt @@ -550,6 +550,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDeleteResponse = apply { if (validated) { @@ -692,6 +700,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -828,6 +845,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadParams.kt index 380084ec..b514a479 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadParams.kt @@ -442,6 +442,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -576,6 +585,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ContentType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadResponse.kt index 41e3c301..eeeeb6a3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadResponse.kt @@ -130,6 +130,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataLookupTableRevisionDataJobDownloadResponse = apply { if (validated) { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListPageResponse.kt index a064e30f..f5404e40 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListPageResponse.kt @@ -204,6 +204,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListPageResponse = apply { if (validated) { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListResponse.kt index 92fbcc6c..5682aac4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListResponse.kt @@ -546,6 +546,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataLookupTableRevisionDataJobListResponse = apply { if (validated) { @@ -688,6 +696,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -824,6 +841,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse.kt index f9789cc7..e0dc2261 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse.kt @@ -551,6 +551,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse = apply { if (validated) { @@ -693,6 +701,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -829,6 +846,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveKeyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveKeyResponse.kt index acd7232e..6fc7345e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveKeyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveKeyResponse.kt @@ -334,6 +334,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataRetrieveKeyResponse = apply { if (validated) { return@apply @@ -428,6 +436,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveResponse.kt index 36c5a6df..fd984699 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataRetrieveResponse.kt @@ -332,6 +332,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataRetrieveResponse = apply { if (validated) { return@apply @@ -426,6 +434,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyParams.kt index d42ada57..7c078905 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyParams.kt @@ -525,6 +525,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -632,6 +641,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyResponse.kt index cc5433a8..b9a04929 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateKeyResponse.kt @@ -332,6 +332,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataUpdateKeyResponse = apply { if (validated) { return@apply @@ -426,6 +434,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateParams.kt index 9bc4642e..4a87069a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateParams.kt @@ -536,6 +536,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -642,6 +651,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateResponse.kt index 449312c8..d8d0ce02 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionDataUpdateResponse.kt @@ -331,6 +331,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionDataUpdateResponse = apply { if (validated) { return@apply @@ -425,6 +433,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Item = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponse.kt index 763d8b0b..4117df4a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponse.kt @@ -171,6 +171,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableLookupTableRevisionListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRequest.kt index 7032d50b..d59c655a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRequest.kt @@ -275,6 +275,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableRequest = apply { if (validated) { return@apply @@ -377,6 +385,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableResponse.kt index f3b338dc..cec7c2f2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableResponse.kt @@ -490,6 +490,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableResponse = apply { if (validated) { return@apply @@ -604,6 +612,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionRequest.kt index d86fb2b9..0db4a95e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionRequest.kt @@ -366,6 +366,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableRevisionRequest = apply { if (validated) { return@apply @@ -547,6 +555,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Field = apply { if (validated) { return@apply @@ -665,6 +682,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -792,6 +819,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionResponse.kt index 980abfa5..6bbdfa7f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionResponse.kt @@ -608,6 +608,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableRevisionResponse = apply { if (validated) { return@apply @@ -728,6 +736,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -914,6 +931,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Field = apply { if (validated) { return@apply @@ -1032,6 +1058,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1182,6 +1218,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionStatusRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionStatusRequest.kt index 5b09fe41..2b749cf2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionStatusRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/LookupTableRevisionStatusRequest.kt @@ -151,6 +151,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): LookupTableRevisionStatusRequest = apply { if (validated) { return@apply @@ -272,6 +280,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsRequest.kt index 562ff5a2..0e85cdc3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsRequest.kt @@ -292,6 +292,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): M3terSignedCredentialsRequest = apply { if (validated) { return@apply @@ -410,6 +418,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsResponse.kt index 498bda39..29bd6dee 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/M3terSignedCredentialsResponse.kt @@ -540,6 +540,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): M3terSignedCredentialsResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeasurementRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeasurementRequest.kt index e616d1a0..9b6d770d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeasurementRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeasurementRequest.kt @@ -536,6 +536,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): MeasurementRequest = apply { if (validated) { return@apply @@ -645,6 +653,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Cost = apply { if (validated) { return@apply @@ -745,6 +762,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Income = apply { if (validated) { return@apply @@ -845,6 +871,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Measure = apply { if (validated) { return@apply @@ -945,6 +980,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Metadata = apply { if (validated) { return@apply @@ -1045,6 +1089,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Other = apply { if (validated) { return@apply @@ -1145,6 +1198,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): What = apply { if (validated) { return@apply @@ -1245,6 +1307,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Where = apply { if (validated) { return@apply @@ -1345,6 +1416,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Who = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterCreateParams.kt index d520eb31..612001d2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterCreateParams.kt @@ -1040,6 +1040,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1188,6 +1197,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterListPageResponse.kt index 275fe03e..b4eab228 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): MeterListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterResponse.kt index 714a45cb..1c582717 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterResponse.kt @@ -632,6 +632,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): MeterResponse = apply { if (validated) { return@apply @@ -752,6 +760,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterUpdateParams.kt index 8fe0ef36..4e585b27 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/MeterUpdateParams.kt @@ -1032,6 +1032,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1180,6 +1189,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationCreateParams.kt index 1e634887..052bf1b8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationCreateParams.kt @@ -992,6 +992,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationListPageResponse.kt index fa018d29..33e3d56c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): NotificationConfigurationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationResponse.kt index 29052184..8e29fa30 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationResponse.kt @@ -625,6 +625,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): NotificationConfigurationResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationUpdateParams.kt index c63bea38..9403e3a1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/NotificationConfigurationUpdateParams.kt @@ -1004,6 +1004,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ObjectUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ObjectUrlResponse.kt index 5ff57127..6c34e252 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ObjectUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ObjectUrlResponse.kt @@ -116,6 +116,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ObjectUrlResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleRequest.kt index 8f9c95de..fda66069 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleRequest.kt @@ -246,6 +246,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): OperationalDataExportScheduleRequest = apply { if (validated) { return@apply @@ -475,6 +483,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OperationalDataType = apply { if (validated) { return@apply @@ -596,6 +613,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleResponse.kt index 571049e5..beff76e1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/OperationalDataExportScheduleResponse.kt @@ -235,6 +235,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): OperationalDataExportScheduleResponse = apply { if (validated) { return@apply @@ -464,6 +472,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): OperationalDataType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigRequest.kt index 27cb15c6..6209e8a4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigRequest.kt @@ -1492,6 +1492,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): OrganizationConfigRequest = apply { if (validated) { return@apply @@ -1676,6 +1684,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoGenerateStatementMode = apply { if (validated) { return@apply @@ -1807,6 +1824,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreditApplicationOrder = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigResponse.kt index 8f6ad0c0..717a085b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/OrganizationConfigResponse.kt @@ -1463,6 +1463,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): OrganizationConfigResponse = apply { if (validated) { return@apply @@ -1652,6 +1660,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoApproveBillsGracePeriodUnit = apply { if (validated) { return@apply @@ -1798,6 +1815,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AutoGenerateStatementMode = apply { if (validated) { return@apply @@ -1929,6 +1955,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CreditApplicationOrder = apply { if (validated) { return@apply @@ -2058,6 +2093,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ExternalInvoiceDate = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToServiceUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToServiceUserResponse.kt index b6f7c0c9..86ababab 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToServiceUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToServiceUserResponse.kt @@ -437,6 +437,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyAddToServiceUserResponse = apply { if (validated) { return@apply @@ -581,6 +589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserParams.kt index b3068b9d..8b3cc072 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserParams.kt @@ -395,6 +395,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserResponse.kt index b64cd8d5..eec123bb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToSupportUserResponse.kt @@ -437,6 +437,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyAddToSupportUserResponse = apply { if (validated) { return@apply @@ -581,6 +589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserGroupResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserGroupResponse.kt index 12025620..e88272de 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserGroupResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserGroupResponse.kt @@ -437,6 +437,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyAddToUserGroupResponse = apply { if (validated) { return@apply @@ -581,6 +589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserResponse.kt index adfffa12..ec4e4a56 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyAddToUserResponse.kt @@ -436,6 +436,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyAddToUserResponse = apply { if (validated) { return@apply @@ -580,6 +588,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyCreateParams.kt index 04cbfa05..94362634 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyCreateParams.kt @@ -581,6 +581,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyListPageResponse.kt index 4ca8009a..bec59247 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromServiceUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromServiceUserResponse.kt index 32ee0730..e18482d6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromServiceUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromServiceUserResponse.kt @@ -438,6 +438,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyRemoveFromServiceUserResponse = apply { if (validated) { return@apply @@ -582,6 +590,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromSupportUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromSupportUserResponse.kt index a09a31cd..f62a3cdf 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromSupportUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromSupportUserResponse.kt @@ -438,6 +438,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyRemoveFromSupportUserResponse = apply { if (validated) { return@apply @@ -582,6 +590,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserGroupResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserGroupResponse.kt index cb4e1985..b4ddce8d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserGroupResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserGroupResponse.kt @@ -437,6 +437,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyRemoveFromUserGroupResponse = apply { if (validated) { return@apply @@ -581,6 +589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserResponse.kt index 5f13c6f6..88adb15f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyRemoveFromUserResponse.kt @@ -437,6 +437,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyRemoveFromUserResponse = apply { if (validated) { return@apply @@ -581,6 +589,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): PrincipalType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyResponse.kt index 6460095b..84b333b3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyResponse.kt @@ -455,6 +455,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionPolicyResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyUpdateParams.kt index 7f2e8431..975a3460 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionPolicyUpdateParams.kt @@ -592,6 +592,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionStatementResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionStatementResponse.kt index ea8c0eb7..4d67f3c7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionStatementResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PermissionStatementResponse.kt @@ -268,6 +268,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PermissionStatementResponse = apply { if (validated) { return@apply @@ -480,6 +488,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Action = apply { if (validated) { return@apply @@ -610,6 +627,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Effect = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanCreateParams.kt index 3c964ac1..aa80190f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanCreateParams.kt @@ -1646,6 +1646,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1826,6 +1835,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupCreateParams.kt index 54341e64..754e3e7b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupCreateParams.kt @@ -1410,6 +1410,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1582,6 +1591,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkCreateParams.kt index c09af699..3998faa8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkCreateParams.kt @@ -520,6 +520,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkListPageResponse.kt index b4b6fd12..2c2a98c7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkListPageResponse.kt @@ -165,6 +165,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanGroupLinkListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkResponse.kt index 3bd1ac35..0e1025f6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkResponse.kt @@ -391,6 +391,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanGroupLinkResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkUpdateParams.kt index 8d299d3d..51046172 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupLinkUpdateParams.kt @@ -532,6 +532,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupListPageResponse.kt index 75702ff2..9ecba42a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanGroupListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupResponse.kt index 78f3bf51..356e8f8d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupResponse.kt @@ -870,6 +870,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanGroupResponse = apply { if (validated) { return@apply @@ -1002,6 +1010,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupUpdateParams.kt index 635aca12..0ac16754 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanGroupUpdateParams.kt @@ -1429,6 +1429,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1601,6 +1610,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanListPageResponse.kt index d717428a..c04ba3bd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanResponse.kt index 132e63d3..33de18f6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanResponse.kt @@ -1013,6 +1013,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanResponse = apply { if (validated) { return@apply @@ -1151,6 +1159,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateCreateParams.kt index 6ab4ab34..7de7ab5e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateCreateParams.kt @@ -1795,6 +1795,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2032,6 +2041,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -2140,6 +2158,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateListPageResponse.kt index f178a9e0..f597a897 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateListPageResponse.kt @@ -164,6 +164,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanTemplateListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateResponse.kt index 89077408..09257740 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateResponse.kt @@ -1040,6 +1040,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PlanTemplateResponse = apply { if (validated) { return@apply @@ -1231,6 +1239,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -1339,6 +1356,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateUpdateParams.kt index 7d2637b7..7483fb9d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanTemplateUpdateParams.kt @@ -1812,6 +1812,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2049,6 +2058,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): BillFrequency = apply { if (validated) { return@apply @@ -2157,6 +2175,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanUpdateParams.kt index deff9297..a6496c5a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PlanUpdateParams.kt @@ -1664,6 +1664,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1844,6 +1853,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingBand.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingBand.kt index 5bde1cf4..9fd82a85 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingBand.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingBand.kt @@ -273,6 +273,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PricingBand = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingCreateParams.kt index 00d6f37c..00ab7a02 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingCreateParams.kt @@ -1928,6 +1928,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2122,6 +2131,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply @@ -2266,6 +2284,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingListPageResponse.kt index ab111d72..5395fe5b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PricingListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingResponse.kt index 118df851..80b97544 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingResponse.kt @@ -1179,6 +1179,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PricingResponse = apply { if (validated) { return@apply @@ -1345,6 +1353,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AggregationType = apply { if (validated) { return@apply @@ -1447,6 +1464,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply @@ -1591,6 +1617,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingUpdateParams.kt index e599c770..610ae9ac 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PricingUpdateParams.kt @@ -1940,6 +1940,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -2134,6 +2143,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Segment = apply { if (validated) { return@apply @@ -2278,6 +2296,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/PrincipalPermissionRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/PrincipalPermissionRequest.kt index 7013ba5b..dcbc4cdd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/PrincipalPermissionRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/PrincipalPermissionRequest.kt @@ -174,6 +174,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): PrincipalPermissionRequest = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductCreateParams.kt index 0752a77f..3d03a146 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductCreateParams.kt @@ -648,6 +648,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -774,6 +783,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductListPageResponse.kt index 6e7c2d5c..89aae4e7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ProductListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductResponse.kt index 5cb48acb..dd9ffa88 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductResponse.kt @@ -453,6 +453,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ProductResponse = apply { if (validated) { return@apply @@ -565,6 +573,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductUpdateParams.kt index c463154d..ea18517e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ProductUpdateParams.kt @@ -664,6 +664,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -790,6 +799,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupAddResourceParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupAddResourceParams.kt index 9cbd388d..de506d24 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupAddResourceParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupAddResourceParams.kt @@ -583,6 +583,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -734,6 +743,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TargetType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupCreateParams.kt index ce0f156b..e4bd81a2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupCreateParams.kt @@ -434,6 +434,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsPageResponse.kt index d7b0c668..b5aeee1a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ResourceGroupListContentsPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsResponse.kt index 5c0a6018..42d1a073 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListContentsResponse.kt @@ -395,6 +395,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ResourceGroupListContentsResponse = apply { if (validated) { return@apply @@ -523,6 +531,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TargetType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPageResponse.kt index 2ca3f563..d0accf39 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPageResponse.kt @@ -165,6 +165,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ResourceGroupListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPermissionsPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPermissionsPageResponse.kt index 63c60fcc..302bbd7d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPermissionsPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupListPermissionsPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ResourceGroupListPermissionsPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupRemoveResourceParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupRemoveResourceParams.kt index 9af7e67f..b4688f80 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupRemoveResourceParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupRemoveResourceParams.kt @@ -585,6 +585,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -736,6 +745,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TargetType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupResponse.kt index b579ba3d..860821e4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupResponse.kt @@ -356,6 +356,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ResourceGroupResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupUpdateParams.kt index 8551f3ab..c4bb6f95 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ResourceGroupUpdateParams.kt @@ -445,6 +445,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleRequest.kt index 8c178933..e63e001a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleRequest.kt @@ -649,6 +649,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ScheduleRequest = apply { if (validated) { return@apply @@ -800,6 +808,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Frequency = apply { if (validated) { return@apply @@ -908,6 +925,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleResponse.kt index ce58ba45..83d95b4a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduleResponse.kt @@ -929,6 +929,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ScheduleResponse = apply { if (validated) { return@apply @@ -1065,6 +1073,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CustomFields = apply { if (validated) { return@apply @@ -1207,6 +1224,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Frequency = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationCreateParams.kt index cd02971f..c371e1d6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationCreateParams.kt @@ -710,6 +710,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationListPageResponse.kt index b6cd0029..e2c828c2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationListPageResponse.kt @@ -170,6 +170,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ScheduledEventConfigurationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationResponse.kt index c19b1ea1..e0360735 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationResponse.kt @@ -476,6 +476,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): ScheduledEventConfigurationResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationUpdateParams.kt index e38a8c5a..c6404679 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/ScheduledEventConfigurationUpdateParams.kt @@ -722,6 +722,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/SetString.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/SetString.kt index 9642eb87..41994517 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/SetString.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/SetString.kt @@ -109,6 +109,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): SetString = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementDefinitionResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementDefinitionResponse.kt index 93bd8a90..f07ada42 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementDefinitionResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementDefinitionResponse.kt @@ -595,6 +595,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): StatementDefinitionResponse = apply { if (validated) { return@apply @@ -760,6 +768,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AggregationFrequency = apply { if (validated) { return@apply @@ -1051,6 +1068,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Dimension = apply { if (validated) { return@apply @@ -1297,6 +1323,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Measure = apply { if (validated) { return@apply @@ -1478,6 +1513,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementJobResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementJobResponse.kt index d1069810..1420c779 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementJobResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementJobResponse.kt @@ -11,7 +11,9 @@ import com.m3ter.core.ExcludeMissing import com.m3ter.core.JsonField import com.m3ter.core.JsonMissing import com.m3ter.core.JsonValue +import com.m3ter.core.checkKnown import com.m3ter.core.checkRequired +import com.m3ter.core.toImmutable import com.m3ter.errors.M3terInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -28,6 +30,7 @@ private constructor( private val csvStatementStatus: JsonField, private val dtCreated: JsonField, private val dtLastModified: JsonField, + private val filters: JsonField, private val includeCsvFormat: JsonField, private val jsonStatementStatus: JsonField, private val lastModifiedBy: JsonField, @@ -53,6 +56,7 @@ private constructor( @JsonProperty("dtLastModified") @ExcludeMissing dtLastModified: JsonField = JsonMissing.of(), + @JsonProperty("filters") @ExcludeMissing filters: JsonField = JsonMissing.of(), @JsonProperty("includeCsvFormat") @ExcludeMissing includeCsvFormat: JsonField = JsonMissing.of(), @@ -80,6 +84,7 @@ private constructor( csvStatementStatus, dtCreated, dtLastModified, + filters, includeCsvFormat, jsonStatementStatus, lastModifiedBy, @@ -138,6 +143,12 @@ private constructor( */ fun dtLastModified(): Optional = dtLastModified.getOptional("dtLastModified") + /** + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional = filters.getOptional("filters") + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -259,6 +270,13 @@ private constructor( @ExcludeMissing fun _dtLastModified(): JsonField = dtLastModified + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField = filters + /** * Returns the raw JSON value of [includeCsvFormat]. * @@ -366,6 +384,7 @@ private constructor( private var csvStatementStatus: JsonField = JsonMissing.of() private var dtCreated: JsonField = JsonMissing.of() private var dtLastModified: JsonField = JsonMissing.of() + private var filters: JsonField = JsonMissing.of() private var includeCsvFormat: JsonField = JsonMissing.of() private var jsonStatementStatus: JsonField = JsonMissing.of() private var lastModifiedBy: JsonField = JsonMissing.of() @@ -384,6 +403,7 @@ private constructor( csvStatementStatus = statementJobResponse.csvStatementStatus dtCreated = statementJobResponse.dtCreated dtLastModified = statementJobResponse.dtLastModified + filters = statementJobResponse.filters includeCsvFormat = statementJobResponse.includeCsvFormat jsonStatementStatus = statementJobResponse.jsonStatementStatus lastModifiedBy = statementJobResponse.lastModifiedBy @@ -470,6 +490,16 @@ private constructor( this.dtLastModified = dtLastModified } + fun filters(filters: Filters) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [Filters] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun filters(filters: JsonField) = apply { this.filters = filters } + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -636,6 +666,7 @@ private constructor( csvStatementStatus, dtCreated, dtLastModified, + filters, includeCsvFormat, jsonStatementStatus, lastModifiedBy, @@ -650,6 +681,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): StatementJobResponse = apply { if (validated) { return@apply @@ -661,6 +700,7 @@ private constructor( csvStatementStatus().ifPresent { it.validate() } dtCreated() dtLastModified() + filters().ifPresent { it.validate() } includeCsvFormat() jsonStatementStatus().ifPresent { it.validate() } lastModifiedBy() @@ -693,6 +733,7 @@ private constructor( (csvStatementStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (dtCreated.asKnown().isPresent) 1 else 0) + (if (dtLastModified.asKnown().isPresent) 1 else 0) + + (filters.asKnown().getOrNull()?.validity() ?: 0) + (if (includeCsvFormat.asKnown().isPresent) 1 else 0) + (jsonStatementStatus.asKnown().getOrNull()?.validity() ?: 0) + (if (lastModifiedBy.asKnown().isPresent) 1 else 0) + @@ -799,6 +840,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): CsvStatementStatus = apply { if (validated) { return@apply @@ -837,6 +887,178 @@ private constructor( override fun toString() = value.toString() } + class Filters + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val meterIds: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("meterIds") + @ExcludeMissing + meterIds: JsonField> = JsonMissing.of() + ) : this(meterIds, mutableMapOf()) + + /** + * Include usage line items whose meterId matches one of these values. + * + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun meterIds(): Optional> = meterIds.getOptional("meterIds") + + /** + * Returns the raw JSON value of [meterIds]. + * + * Unlike [meterIds], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("meterIds") + @ExcludeMissing + fun _meterIds(): JsonField> = meterIds + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Filters]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Filters]. */ + class Builder internal constructor() { + + private var meterIds: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filters: Filters) = apply { + meterIds = filters.meterIds.map { it.toMutableList() } + additionalProperties = filters.additionalProperties.toMutableMap() + } + + /** Include usage line items whose meterId matches one of these values. */ + fun meterIds(meterIds: List) = meterIds(JsonField.of(meterIds)) + + /** + * Sets [Builder.meterIds] to an arbitrary JSON value. + * + * You should usually call [Builder.meterIds] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun meterIds(meterIds: JsonField>) = apply { + this.meterIds = meterIds.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [meterIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addMeterId(meterId: String) = apply { + meterIds = + (meterIds ?: JsonField.of(mutableListOf())).also { + checkKnown("meterIds", it).add(meterId) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Filters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Filters = + Filters( + (meterIds ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Filters = apply { + if (validated) { + return@apply + } + + meterIds() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: M3terInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (meterIds.asKnown().getOrNull()?.size ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Filters && + meterIds == other.meterIds && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(meterIds, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Filters{meterIds=$meterIds, additionalProperties=$additionalProperties}" + } + class JsonStatementStatus @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -934,6 +1156,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): JsonStatementStatus = apply { if (validated) { return@apply @@ -1085,6 +1316,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): StatementJobStatus = apply { if (validated) { return@apply @@ -1135,6 +1375,7 @@ private constructor( csvStatementStatus == other.csvStatementStatus && dtCreated == other.dtCreated && dtLastModified == other.dtLastModified && + filters == other.filters && includeCsvFormat == other.includeCsvFormat && jsonStatementStatus == other.jsonStatementStatus && lastModifiedBy == other.lastModifiedBy && @@ -1154,6 +1395,7 @@ private constructor( csvStatementStatus, dtCreated, dtLastModified, + filters, includeCsvFormat, jsonStatementStatus, lastModifiedBy, @@ -1169,5 +1411,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "StatementJobResponse{id=$id, billId=$billId, createdBy=$createdBy, csvStatementStatus=$csvStatementStatus, dtCreated=$dtCreated, dtLastModified=$dtLastModified, includeCsvFormat=$includeCsvFormat, jsonStatementStatus=$jsonStatementStatus, lastModifiedBy=$lastModifiedBy, orgId=$orgId, presignedCsvStatementUrl=$presignedCsvStatementUrl, presignedJsonStatementUrl=$presignedJsonStatementUrl, statementJobStatus=$statementJobStatus, version=$version, additionalProperties=$additionalProperties}" + "StatementJobResponse{id=$id, billId=$billId, createdBy=$createdBy, csvStatementStatus=$csvStatementStatus, dtCreated=$dtCreated, dtLastModified=$dtLastModified, filters=$filters, includeCsvFormat=$includeCsvFormat, jsonStatementStatus=$jsonStatementStatus, lastModifiedBy=$lastModifiedBy, orgId=$orgId, presignedCsvStatementUrl=$presignedCsvStatementUrl, presignedJsonStatementUrl=$presignedJsonStatementUrl, statementJobStatus=$statementJobStatus, version=$version, additionalProperties=$additionalProperties}" } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionCreateParams.kt index fd5e162c..32637627 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionCreateParams.kt @@ -892,6 +892,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1083,6 +1092,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AggregationFrequency = apply { if (validated) { return@apply @@ -1374,6 +1392,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Dimension = apply { if (validated) { return@apply @@ -1620,6 +1647,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Measure = apply { if (validated) { return@apply @@ -1801,6 +1837,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionListPageResponse.kt index c7942cbb..2933deee 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionListPageResponse.kt @@ -171,6 +171,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): StatementStatementDefinitionListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionUpdateParams.kt index de3f2790..07c6981f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementDefinitionUpdateParams.kt @@ -905,6 +905,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1096,6 +1105,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): AggregationFrequency = apply { if (validated) { return@apply @@ -1387,6 +1405,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Dimension = apply { if (validated) { return@apply @@ -1633,6 +1660,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Measure = apply { if (validated) { return@apply @@ -1814,6 +1850,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParams.kt index d15bf83e..6602d895 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParams.kt @@ -71,6 +71,12 @@ private constructor( */ fun billIds(): List = body.billIds() + /** + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional = body.filters() + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -101,6 +107,13 @@ private constructor( */ fun _billIds(): JsonField> = body._billIds() + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _filters(): JsonField = body._filters() + /** * Returns the raw JSON value of [includeCsvFormat]. * @@ -172,6 +185,7 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [billIds] + * - [filters] * - [includeCsvFormat] * - [version] */ @@ -196,6 +210,16 @@ private constructor( */ fun addBillId(billId: String) = apply { body.addBillId(billId) } + fun filters(filters: Filters) = apply { body.filters(filters) } + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [Filters] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun filters(filters: JsonField) = apply { body.filters(filters) } + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -388,6 +412,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val billIds: JsonField>, + private val filters: JsonField, private val includeCsvFormat: JsonField, private val version: JsonField, private val additionalProperties: MutableMap, @@ -398,11 +423,12 @@ private constructor( @JsonProperty("billIds") @ExcludeMissing billIds: JsonField> = JsonMissing.of(), + @JsonProperty("filters") @ExcludeMissing filters: JsonField = JsonMissing.of(), @JsonProperty("includeCsvFormat") @ExcludeMissing includeCsvFormat: JsonField = JsonMissing.of(), @JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(), - ) : this(billIds, includeCsvFormat, version, mutableMapOf()) + ) : this(billIds, filters, includeCsvFormat, version, mutableMapOf()) /** * The list of unique identifiers (UUIDs) of the bills associated with the StatementJob. @@ -412,6 +438,12 @@ private constructor( */ fun billIds(): List = billIds.getRequired("billIds") + /** + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional = filters.getOptional("filters") + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -442,6 +474,13 @@ private constructor( */ @JsonProperty("billIds") @ExcludeMissing fun _billIds(): JsonField> = billIds + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField = filters + /** * Returns the raw JSON value of [includeCsvFormat]. * @@ -488,6 +527,7 @@ private constructor( class Builder internal constructor() { private var billIds: JsonField>? = null + private var filters: JsonField = JsonMissing.of() private var includeCsvFormat: JsonField = JsonMissing.of() private var version: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -495,6 +535,7 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { billIds = body.billIds.map { it.toMutableList() } + filters = body.filters includeCsvFormat = body.includeCsvFormat version = body.version additionalProperties = body.additionalProperties.toMutableMap() @@ -528,6 +569,17 @@ private constructor( } } + fun filters(filters: Filters) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [Filters] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField) = apply { this.filters = filters } + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -600,6 +652,7 @@ private constructor( fun build(): Body = Body( checkRequired("billIds", billIds).map { it.toImmutable() }, + filters, includeCsvFormat, version, additionalProperties.toMutableMap(), @@ -608,12 +661,22 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply } billIds() + filters().ifPresent { it.validate() } includeCsvFormat() version() validated = true @@ -636,6 +699,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (billIds.asKnown().getOrNull()?.size ?: 0) + + (filters.asKnown().getOrNull()?.validity() ?: 0) + (if (includeCsvFormat.asKnown().isPresent) 1 else 0) + (if (version.asKnown().isPresent) 1 else 0) @@ -646,19 +710,192 @@ private constructor( return other is Body && billIds == other.billIds && + filters == other.filters && includeCsvFormat == other.includeCsvFormat && version == other.version && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(billIds, includeCsvFormat, version, additionalProperties) + Objects.hash(billIds, filters, includeCsvFormat, version, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{billIds=$billIds, includeCsvFormat=$includeCsvFormat, version=$version, additionalProperties=$additionalProperties}" + "Body{billIds=$billIds, filters=$filters, includeCsvFormat=$includeCsvFormat, version=$version, additionalProperties=$additionalProperties}" + } + + class Filters + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val meterIds: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("meterIds") + @ExcludeMissing + meterIds: JsonField> = JsonMissing.of() + ) : this(meterIds, mutableMapOf()) + + /** + * Include usage line items whose meterId matches one of these values. + * + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun meterIds(): Optional> = meterIds.getOptional("meterIds") + + /** + * Returns the raw JSON value of [meterIds]. + * + * Unlike [meterIds], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("meterIds") + @ExcludeMissing + fun _meterIds(): JsonField> = meterIds + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Filters]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Filters]. */ + class Builder internal constructor() { + + private var meterIds: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filters: Filters) = apply { + meterIds = filters.meterIds.map { it.toMutableList() } + additionalProperties = filters.additionalProperties.toMutableMap() + } + + /** Include usage line items whose meterId matches one of these values. */ + fun meterIds(meterIds: List) = meterIds(JsonField.of(meterIds)) + + /** + * Sets [Builder.meterIds] to an arbitrary JSON value. + * + * You should usually call [Builder.meterIds] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun meterIds(meterIds: JsonField>) = apply { + this.meterIds = meterIds.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [meterIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addMeterId(meterId: String) = apply { + meterIds = + (meterIds ?: JsonField.of(mutableListOf())).also { + checkKnown("meterIds", it).add(meterId) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Filters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Filters = + Filters( + (meterIds ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Filters = apply { + if (validated) { + return@apply + } + + meterIds() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: M3terInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (meterIds.asKnown().getOrNull()?.size ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Filters && + meterIds == other.meterIds && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(meterIds, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Filters{meterIds=$meterIds, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateParams.kt index e2f583f7..c75bcb3e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobCreateParams.kt @@ -11,9 +11,11 @@ import com.m3ter.core.JsonField import com.m3ter.core.JsonMissing import com.m3ter.core.JsonValue import com.m3ter.core.Params +import com.m3ter.core.checkKnown import com.m3ter.core.checkRequired import com.m3ter.core.http.Headers import com.m3ter.core.http.QueryParams +import com.m3ter.core.toImmutable import com.m3ter.errors.M3terInvalidDataException import java.util.Collections import java.util.Objects @@ -69,6 +71,12 @@ private constructor( */ fun billId(): String = body.billId() + /** + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional = body.filters() + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -99,6 +107,13 @@ private constructor( */ fun _billId(): JsonField = body._billId() + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _filters(): JsonField = body._filters() + /** * Returns the raw JSON value of [includeCsvFormat]. * @@ -169,6 +184,7 @@ private constructor( * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: * - [billId] + * - [filters] * - [includeCsvFormat] * - [version] */ @@ -185,6 +201,16 @@ private constructor( */ fun billId(billId: JsonField) = apply { body.billId(billId) } + fun filters(filters: Filters) = apply { body.filters(filters) } + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [Filters] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun filters(filters: JsonField) = apply { body.filters(filters) } + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -377,6 +403,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val billId: JsonField, + private val filters: JsonField, private val includeCsvFormat: JsonField, private val version: JsonField, private val additionalProperties: MutableMap, @@ -385,11 +412,12 @@ private constructor( @JsonCreator private constructor( @JsonProperty("billId") @ExcludeMissing billId: JsonField = JsonMissing.of(), + @JsonProperty("filters") @ExcludeMissing filters: JsonField = JsonMissing.of(), @JsonProperty("includeCsvFormat") @ExcludeMissing includeCsvFormat: JsonField = JsonMissing.of(), @JsonProperty("version") @ExcludeMissing version: JsonField = JsonMissing.of(), - ) : this(billId, includeCsvFormat, version, mutableMapOf()) + ) : this(billId, filters, includeCsvFormat, version, mutableMapOf()) /** * The unique identifier (UUID) of the bill associated with the StatementJob. @@ -399,6 +427,12 @@ private constructor( */ fun billId(): String = billId.getRequired("billId") + /** + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun filters(): Optional = filters.getOptional("filters") + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -429,6 +463,13 @@ private constructor( */ @JsonProperty("billId") @ExcludeMissing fun _billId(): JsonField = billId + /** + * Returns the raw JSON value of [filters]. + * + * Unlike [filters], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField = filters + /** * Returns the raw JSON value of [includeCsvFormat]. * @@ -475,6 +516,7 @@ private constructor( class Builder internal constructor() { private var billId: JsonField? = null + private var filters: JsonField = JsonMissing.of() private var includeCsvFormat: JsonField = JsonMissing.of() private var version: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -482,6 +524,7 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { billId = body.billId + filters = body.filters includeCsvFormat = body.includeCsvFormat version = body.version additionalProperties = body.additionalProperties.toMutableMap() @@ -499,6 +542,17 @@ private constructor( */ fun billId(billId: JsonField) = apply { this.billId = billId } + fun filters(filters: Filters) = filters(JsonField.of(filters)) + + /** + * Sets [Builder.filters] to an arbitrary JSON value. + * + * You should usually call [Builder.filters] with a well-typed [Filters] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun filters(filters: JsonField) = apply { this.filters = filters } + /** * A Boolean value indicating whether the generated statement includes a CSV format. * * TRUE - includes the statement in CSV format. @@ -571,6 +625,7 @@ private constructor( fun build(): Body = Body( checkRequired("billId", billId), + filters, includeCsvFormat, version, additionalProperties.toMutableMap(), @@ -579,12 +634,22 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply } billId() + filters().ifPresent { it.validate() } includeCsvFormat() version() validated = true @@ -607,6 +672,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (billId.asKnown().isPresent) 1 else 0) + + (filters.asKnown().getOrNull()?.validity() ?: 0) + (if (includeCsvFormat.asKnown().isPresent) 1 else 0) + (if (version.asKnown().isPresent) 1 else 0) @@ -617,19 +683,192 @@ private constructor( return other is Body && billId == other.billId && + filters == other.filters && includeCsvFormat == other.includeCsvFormat && version == other.version && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(billId, includeCsvFormat, version, additionalProperties) + Objects.hash(billId, filters, includeCsvFormat, version, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{billId=$billId, filters=$filters, includeCsvFormat=$includeCsvFormat, version=$version, additionalProperties=$additionalProperties}" + } + + class Filters + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val meterIds: JsonField>, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("meterIds") + @ExcludeMissing + meterIds: JsonField> = JsonMissing.of() + ) : this(meterIds, mutableMapOf()) + + /** + * Include usage line items whose meterId matches one of these values. + * + * @throws M3terInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun meterIds(): Optional> = meterIds.getOptional("meterIds") + + /** + * Returns the raw JSON value of [meterIds]. + * + * Unlike [meterIds], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("meterIds") + @ExcludeMissing + fun _meterIds(): JsonField> = meterIds + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Filters]. */ + @JvmStatic fun builder() = Builder() } + /** A builder for [Filters]. */ + class Builder internal constructor() { + + private var meterIds: JsonField>? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(filters: Filters) = apply { + meterIds = filters.meterIds.map { it.toMutableList() } + additionalProperties = filters.additionalProperties.toMutableMap() + } + + /** Include usage line items whose meterId matches one of these values. */ + fun meterIds(meterIds: List) = meterIds(JsonField.of(meterIds)) + + /** + * Sets [Builder.meterIds] to an arbitrary JSON value. + * + * You should usually call [Builder.meterIds] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun meterIds(meterIds: JsonField>) = apply { + this.meterIds = meterIds.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [meterIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addMeterId(meterId: String) = apply { + meterIds = + (meterIds ?: JsonField.of(mutableListOf())).also { + checkKnown("meterIds", it).add(meterId) + } + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Filters]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Filters = + Filters( + (meterIds ?: JsonMissing.of()).map { it.toImmutable() }, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Filters = apply { + if (validated) { + return@apply + } + + meterIds() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: M3terInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (meterIds.asKnown().getOrNull()?.size ?: 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Filters && + meterIds == other.meterIds && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(meterIds, additionalProperties) } + override fun hashCode(): Int = hashCode override fun toString() = - "Body{billId=$billId, includeCsvFormat=$includeCsvFormat, version=$version, additionalProperties=$additionalProperties}" + "Filters{meterIds=$meterIds, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobListPageResponse.kt index 12ebcfaf..5676f4ff 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/StatementStatementJobListPageResponse.kt @@ -168,6 +168,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): StatementStatementJobListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsRequest.kt index 6e226667..cfc32898 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsRequest.kt @@ -153,6 +153,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): SubmitMeasurementsRequest = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsResponse.kt index b403c598..2f120f16 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/SubmitMeasurementsResponse.kt @@ -115,6 +115,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): SubmitMeasurementsResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionResponse.kt index 8936fce9..2c60a2c9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionResponse.kt @@ -679,6 +679,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): TransactionResponse = apply { if (validated) { return@apply @@ -844,6 +852,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): EntityType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeCreateParams.kt index bda86cf6..a261bd67 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeCreateParams.kt @@ -602,6 +602,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeListPageResponse.kt index 1f9b3283..077f71f7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeListPageResponse.kt @@ -169,6 +169,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): TransactionTypeListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeResponse.kt index 2895e621..e6c9a041 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeResponse.kt @@ -425,6 +425,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): TransactionTypeResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeUpdateParams.kt index 51a08695..207c6478 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/TransactionTypeUpdateParams.kt @@ -614,6 +614,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleRequest.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleRequest.kt index 0894e830..bc19d8f3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleRequest.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleRequest.kt @@ -540,6 +540,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageDataExportScheduleRequest = apply { if (validated) { return@apply @@ -663,6 +671,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): SourceType = apply { if (validated) { return@apply @@ -902,6 +919,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TimePeriod = apply { if (validated) { return@apply @@ -1166,6 +1192,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -1293,6 +1328,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FieldType = apply { if (validated) { return@apply @@ -1454,6 +1499,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Function = apply { if (validated) { return@apply @@ -1717,6 +1772,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DimensionFilter = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleResponse.kt index 8d98dcb4..7f2481f9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageDataExportScheduleResponse.kt @@ -531,6 +531,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageDataExportScheduleResponse = apply { if (validated) { return@apply @@ -797,6 +805,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -924,6 +941,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FieldType = apply { if (validated) { return@apply @@ -1085,6 +1112,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Function = apply { if (validated) { return@apply @@ -1348,6 +1385,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DimensionFilter = apply { if (validated) { return@apply @@ -1602,6 +1648,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): TimePeriod = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlParams.kt index c98a8259..33eb2709 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlParams.kt @@ -575,6 +575,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -722,6 +731,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ContentType = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlResponse.kt index 4ebeec69..29a63536 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadGenerateUploadUrlResponse.kt @@ -187,6 +187,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageFileUploadGenerateUploadUrlResponse = apply { if (validated) { return@apply @@ -276,6 +284,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Headers = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobGetOriginalDownloadUrlResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobGetOriginalDownloadUrlResponse.kt index ac23121e..fad7bd9c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobGetOriginalDownloadUrlResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobGetOriginalDownloadUrlResponse.kt @@ -188,6 +188,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageFileUploadJobGetOriginalDownloadUrlResponse = apply { if (validated) { return@apply @@ -277,6 +285,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Headers = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobListPageResponse.kt index dab24be7..4d9091dd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageFileUploadJobListPageResponse.kt @@ -167,6 +167,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageFileUploadJobListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryParams.kt index 4c28b72a..5d5ef5d1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryParams.kt @@ -1068,6 +1068,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply @@ -1372,6 +1381,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Aggregation = apply { if (validated) { return@apply @@ -1499,6 +1517,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): FieldType = apply { if (validated) { return@apply @@ -1660,6 +1688,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Function = apply { if (validated) { return@apply @@ -1923,6 +1961,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): DimensionFilter = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryResponse.kt index 1846b523..eeece182 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UsageQueryResponse.kt @@ -188,6 +188,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UsageQueryResponse = apply { if (validated) { return@apply @@ -274,6 +282,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Data = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationCreateParams.kt index d72eec85..4a0bbfec 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationCreateParams.kt @@ -937,6 +937,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationListPageResponse.kt index 0ed663b1..a07698ef 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserInvitationListPageResponse.kt @@ -166,6 +166,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UserInvitationListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserListPageResponse.kt index bfb3cf28..7019f906 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserListPageResponse.kt @@ -162,6 +162,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UserListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserMeResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserMeResponse.kt index 872f3858..70af4d2d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserMeResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserMeResponse.kt @@ -184,6 +184,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UserMeResponse = apply { if (validated) { return@apply @@ -1222,6 +1230,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Organization = apply { if (validated) { return@apply @@ -1390,6 +1407,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Status = apply { if (validated) { return@apply @@ -1517,6 +1544,16 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Type = apply { if (validated) { return@apply @@ -1975,6 +2012,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): ServiceUser = apply { if (validated) { return@apply @@ -2696,6 +2742,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): User = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserResponse.kt index c92cd6c1..696cff25 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserResponse.kt @@ -747,6 +747,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): UserResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserUpdateParams.kt index f87f93b5..e3398192 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/UserUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/UserUpdateParams.kt @@ -595,6 +595,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/Webhook.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/Webhook.kt index b25aa43f..07fb7220 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/Webhook.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/Webhook.kt @@ -517,6 +517,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): Webhook = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookCreateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookCreateParams.kt index 91ea00e2..d9463eb6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookCreateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookCreateParams.kt @@ -770,6 +770,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookListPageResponse.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookListPageResponse.kt index a1f02a3a..56915247 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookListPageResponse.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookListPageResponse.kt @@ -160,6 +160,14 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its expected + * type. + */ fun validate(): WebhookListPageResponse = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookUpdateParams.kt b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookUpdateParams.kt index 74cafca4..5a463f98 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookUpdateParams.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/models/WebhookUpdateParams.kt @@ -779,6 +779,15 @@ private constructor( private var validated: Boolean = false + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws M3terInvalidDataException if any value type in this object doesn't match its + * expected type. + */ fun validate(): Body = apply { if (validated) { return@apply diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsync.kt index b8948907..5ef61a67 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsync.kt @@ -15,6 +15,59 @@ import com.m3ter.models.AccountPlanUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list + * and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges + * incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan + * is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create an + * AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create the + * Plan Group, you define an overall minimum spend and then add any priced Plans you want to include + * in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that + * consumes the separate Products which are priced using the included Plans. At billing, the minimum + * spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this + * creates an AccountPlanGroup. However, the m3ter data model *does not support a separate + * AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be + * active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of the + * Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group + * to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group already + * attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ interface AccountPlanServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsyncImpl.kt index 4e27c2e4..72ad1953 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountPlanServiceAsyncImpl.kt @@ -28,6 +28,59 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list + * and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges + * incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan + * is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create an + * AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create the + * Plan Group, you define an overall minimum spend and then add any priced Plans you want to include + * in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that + * consumes the separate Products which are priced using the included Plans. At billing, the minimum + * spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this + * creates an AccountPlanGroup. However, the m3ter data model *does not support a separate + * AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be + * active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of the + * Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group + * to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group already + * attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ class AccountPlanServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : AccountPlanServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsync.kt index 414f1858..1c3c9f7f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsync.kt @@ -21,6 +21,33 @@ import com.m3ter.models.AccountUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Account related operations such as creation, update, list and delete. An Account + * represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than one + * of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate bills + * for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan Template + * to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but not + * all of the Prepayment is prepaid, you can use a customized billing schedule for outstanding + * fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can then + * set up billing for the Parent/Child Account usage to have the end-customer billed once for the + * Parent Account, instead of having separate bills issued for usage against each of their multiple + * Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that only the ``name``, ``address``, or ``emailAddress`` fields contain any end-customer PII data + * on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ interface AccountServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsyncImpl.kt index ff1cf688..e16cce31 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AccountServiceAsyncImpl.kt @@ -35,6 +35,33 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Account related operations such as creation, update, list and delete. An Account + * represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than one + * of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate bills + * for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan Template + * to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but not + * all of the Prepayment is prepaid, you can use a customized billing schedule for outstanding + * fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can then + * set up billing for the Parent/Child Account usage to have the end-customer billed once for the + * Parent Account, instead of having separate bills issued for usage against each of their multiple + * Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that only the ``name``, ``address``, or ``emailAddress`` fields contain any end-customer PII data + * on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ class AccountServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : AccountServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsync.kt index e9067b99..7c615e08 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsync.kt @@ -15,6 +15,30 @@ import com.m3ter.models.AggregationUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted Meter + * field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing Product + * Plans and apply usage-based pricing to your products and services. You might also want to + * aggregate raw data measures for other purposes, such as to feed into analytical or business + * performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, which + * apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation to + * them to derive pricing metrics needed to serve more complex usage-based pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing and + * billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ interface AggregationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsyncImpl.kt index 5d39f8a8..b10ac25c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AggregationServiceAsyncImpl.kt @@ -28,6 +28,30 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted Meter + * field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing Product + * Plans and apply usage-based pricing to your products and services. You might also want to + * aggregate raw data measures for other purposes, such as to feed into analytical or business + * performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, which + * apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation to + * them to derive pricing metrics needed to serve more complex usage-based pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing and + * billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ class AggregationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : AggregationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsync.kt index 738d11b3..f180e201 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsync.kt @@ -10,6 +10,13 @@ import com.m3ter.models.AuthenticationGetBearerTokenResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the Client + * Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your Organization - + * that is, as an API user. + */ interface AuthenticationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsyncImpl.kt index 4d9c71a4..437ec5fb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/AuthenticationServiceAsyncImpl.kt @@ -20,6 +20,13 @@ import com.m3ter.models.AuthenticationGetBearerTokenResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the Client + * Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your Organization - + * that is, as an API user. + */ class AuthenticationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : AuthenticationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsync.kt index f19d5b81..96ec98c4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsync.kt @@ -18,6 +18,54 @@ import com.m3ter.services.async.balances.TransactionServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ interface BalanceServiceAsync { /** @@ -32,10 +80,74 @@ interface BalanceServiceAsync { */ fun withOptions(modifier: Consumer): BalanceServiceAsync + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ fun transactions(): TransactionServiceAsync + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun chargeSchedules(): ChargeScheduleServiceAsync + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun transactionSchedules(): TransactionScheduleServiceAsync /** @@ -190,10 +302,76 @@ interface BalanceServiceAsync { modifier: Consumer ): BalanceServiceAsync.WithRawResponse + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ fun transactions(): TransactionServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun chargeSchedules(): ChargeScheduleServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun transactionSchedules(): TransactionScheduleServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsyncImpl.kt index 7555177a..4659a564 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BalanceServiceAsyncImpl.kt @@ -34,6 +34,54 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ class BalanceServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : BalanceServiceAsync { @@ -58,10 +106,74 @@ class BalanceServiceAsyncImpl internal constructor(private val clientOptions: Cl override fun withOptions(modifier: Consumer): BalanceServiceAsync = BalanceServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ override fun transactions(): TransactionServiceAsync = transactions + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun chargeSchedules(): ChargeScheduleServiceAsync = chargeSchedules + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun transactionSchedules(): TransactionScheduleServiceAsync = transactionSchedules override fun create( @@ -124,10 +236,76 @@ class BalanceServiceAsyncImpl internal constructor(private val clientOptions: Cl clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ override fun transactions(): TransactionServiceAsync.WithRawResponse = transactions + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun chargeSchedules(): ChargeScheduleServiceAsync.WithRawResponse = chargeSchedules + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun transactionSchedules(): TransactionScheduleServiceAsync.WithRawResponse = transactionSchedules diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsync.kt index 42ccec4b..1319ef9f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsync.kt @@ -11,6 +11,18 @@ import com.m3ter.models.BillConfigUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - any + * Bill with a service period end date on or before the set date will be locked and cannot be + * updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the specified + * lock date, then you'll receive an error. + */ interface BillConfigServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsyncImpl.kt index 0951f479..08cb82d8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillConfigServiceAsyncImpl.kt @@ -21,6 +21,18 @@ import com.m3ter.models.BillConfigUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - any + * Bill with a service period end date on or before the set date will be locked and cannot be + * updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the specified + * lock date, then you'll receive an error. + */ class BillConfigServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : BillConfigServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsync.kt index 47c4eccb..82f692ca 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsync.kt @@ -15,6 +15,17 @@ import com.m3ter.models.BillJobRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different billing + * management purposes. For example, some historical usage data has come in for an Account and you + * want to run a Bill for a specific date on that Account to check that the Bill is showing + * correctly for the charges due on the new usage data. + */ interface BillJobServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsyncImpl.kt index 55a82c97..7ed583dd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillJobServiceAsyncImpl.kt @@ -28,6 +28,17 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different billing + * management purposes. For example, some historical usage data has come in for an Account and you + * want to run a Bill for a specific date on that Account to check that the Bill is showing + * correctly for the charges due on the new usage data. + */ class BillJobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : BillJobServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsync.kt index d6ad2dd4..58ab7b10 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsync.kt @@ -23,6 +23,15 @@ import com.m3ter.services.async.bills.LineItemServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface BillServiceAsync { /** @@ -37,10 +46,34 @@ interface BillServiceAsync { */ fun withOptions(modifier: Consumer): BillServiceAsync + /** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items + * for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ fun creditLineItems(): CreditLineItemServiceAsync + /** + * Endpoints for Debit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for + * calls you can use to create and manage Debit Reasons for your Organization. + */ fun debitLineItems(): DebitLineItemServiceAsync + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun lineItems(): LineItemServiceAsync /** @@ -303,10 +336,34 @@ interface BillServiceAsync { */ fun withOptions(modifier: Consumer): BillServiceAsync.WithRawResponse + /** + * Endpoints for Credit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line + * items for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ fun creditLineItems(): CreditLineItemServiceAsync.WithRawResponse + /** + * Endpoints for Debit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items + * for Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section + * for calls you can use to create and manage Debit Reasons for your Organization. + */ fun debitLineItems(): DebitLineItemServiceAsync.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun lineItems(): LineItemServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsyncImpl.kt index 98dbd813..d807a598 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/BillServiceAsyncImpl.kt @@ -39,6 +39,15 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class BillServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : BillServiceAsync { @@ -61,10 +70,34 @@ class BillServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun withOptions(modifier: Consumer): BillServiceAsync = BillServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items + * for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ override fun creditLineItems(): CreditLineItemServiceAsync = creditLineItems + /** + * Endpoints for Debit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for + * calls you can use to create and manage Debit Reasons for your Organization. + */ override fun debitLineItems(): DebitLineItemServiceAsync = debitLineItems + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun lineItems(): LineItemServiceAsync = lineItems override fun retrieve( @@ -148,10 +181,34 @@ class BillServiceAsyncImpl internal constructor(private val clientOptions: Clien clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for Credit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line + * items for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ override fun creditLineItems(): CreditLineItemServiceAsync.WithRawResponse = creditLineItems + /** + * Endpoints for Debit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items + * for Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section + * for calls you can use to create and manage Debit Reasons for your Organization. + */ override fun debitLineItems(): DebitLineItemServiceAsync.WithRawResponse = debitLineItems + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun lineItems(): LineItemServiceAsync.WithRawResponse = lineItems private val retrieveHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsync.kt index 639a2aa6..4ee174ff 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsync.kt @@ -18,6 +18,26 @@ import com.m3ter.models.ChargeUpdateResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account billing. + * Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill date, + * a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create balance + * fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ interface ChargeServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsyncImpl.kt index 8c936801..248d9639 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ChargeServiceAsyncImpl.kt @@ -31,6 +31,26 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account billing. + * Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill date, + * a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create balance + * fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ class ChargeServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ChargeServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsync.kt index 2b355fba..b14942b5 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsync.kt @@ -17,6 +17,50 @@ import com.m3ter.models.CommitmentUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed to + * pay a fixed minimum amount throughout the contract period. ***The commitment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use them + * to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming your + * product or services across a full contract term. A customer might pay the entire or only part of + * the agreed amount upfront, but ***the prepayment amount is payable regardless of the actual usage + * by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Prepayment credit on an Account is + * drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the customer + * Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ interface CommitmentServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsyncImpl.kt index d75a5837..6031d05d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CommitmentServiceAsyncImpl.kt @@ -30,6 +30,50 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed to + * pay a fixed minimum amount throughout the contract period. ***The commitment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use them + * to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming your + * product or services across a full contract term. A customer might pay the entire or only part of + * the agreed amount upfront, but ***the prepayment amount is payable regardless of the actual usage + * by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Prepayment credit on an Account is + * drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the customer + * Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ class CommitmentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CommitmentServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsync.kt index 892fcd82..16ce3fad 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsync.kt @@ -16,6 +16,38 @@ import com.m3ter.models.CompoundAggregationUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Compound Aggregation related operations such as creation, update, list and delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a calculation + * to one or more simple Aggregations or Custom Fields. These numerical measures can then be used as + * pricing metrics to price your Product Plans, enabling you to implement a wide range of + * usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and any + * product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the same + * Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any Global + * simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity per + * unit** defined or a **Rounding** defined, these will not be factored into the value used by the + * calculation. For example, if the simple Aggregation referenced has a base value of 100 and has + * **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the base value of + * 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ interface CompoundAggregationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsyncImpl.kt index 4d9f2d18..8bf5da6d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CompoundAggregationServiceAsyncImpl.kt @@ -29,6 +29,38 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Compound Aggregation related operations such as creation, update, list and delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a calculation + * to one or more simple Aggregations or Custom Fields. These numerical measures can then be used as + * pricing metrics to price your Product Plans, enabling you to implement a wide range of + * usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and any + * product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the same + * Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any Global + * simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity per + * unit** defined or a **Rounding** defined, these will not be factored into the value used by the + * calculation. For example, if the simple Aggregation referenced has a base value of 100 and has + * **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the base value of + * 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ class CompoundAggregationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CompoundAggregationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsync.kt index db01d2ce..0d867a20 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsync.kt @@ -17,6 +17,15 @@ import com.m3ter.models.ContractUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ interface ContractServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsyncImpl.kt index db8de4ff..a4468f1b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ContractServiceAsyncImpl.kt @@ -30,6 +30,15 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ class ContractServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ContractServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsync.kt index b23e8e49..5db4c72b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsync.kt @@ -15,6 +15,18 @@ import com.m3ter.models.CounterAdjustmentUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based pricing, + * you can then create CounterAdjustments for the Account using that Counter to ensure the Account + * is billed according to the number of Counter units the Account subscribes to in a given billing + * period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ interface CounterAdjustmentServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsyncImpl.kt index 2825d04f..006aac8c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterAdjustmentServiceAsyncImpl.kt @@ -28,6 +28,18 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based pricing, + * you can then create CounterAdjustments for the Account using that Counter to ensure the Account + * is billed according to the number of Counter units the Account subscribes to in a given billing + * period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ class CounterAdjustmentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CounterAdjustmentServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsync.kt index 89fbfcd9..411940b6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsync.kt @@ -15,6 +15,16 @@ import com.m3ter.models.CounterPricingUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ interface CounterPricingServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsyncImpl.kt index 3584b2e8..0b684e11 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterPricingServiceAsyncImpl.kt @@ -28,6 +28,16 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ class CounterPricingServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CounterPricingServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsync.kt index a45399b8..6b8f6318 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsync.kt @@ -15,6 +15,22 @@ import com.m3ter.models.CounterUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing metrics to + * apply a unit-based [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product + * Plans or Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your end-customer + * Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the Accounts + * and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) in + * our main user documentation for more details. + */ interface CounterServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsyncImpl.kt index 6545983f..dcff3ded 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CounterServiceAsyncImpl.kt @@ -28,6 +28,22 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing metrics to + * apply a unit-based [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product + * Plans or Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your end-customer + * Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the Accounts + * and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) in + * our main user documentation for more details. + */ class CounterServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CounterServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsync.kt index f8ab2d83..5dbb5670 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsync.kt @@ -15,6 +15,13 @@ import com.m3ter.models.CreditReasonUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit line + * item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ interface CreditReasonServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsyncImpl.kt index 10b2d5bb..38e9234a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CreditReasonServiceAsyncImpl.kt @@ -28,6 +28,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit line + * item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ class CreditReasonServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CreditReasonServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsync.kt index 441ef16b..aadff1fd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsync.kt @@ -15,6 +15,22 @@ import com.m3ter.models.CurrencyUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities such + * as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides any + * currency settings in your pricing Plans. For example, if the Organization currency is set to USD + * and a pricing Plan used for an Account is set to GBP, the bill for an Account using that Plan is + * calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ interface CurrencyServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsyncImpl.kt index 499ede00..36b759c6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CurrencyServiceAsyncImpl.kt @@ -28,6 +28,22 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities such + * as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides any + * currency settings in your pricing Plans. For example, if the Organization currency is set to USD + * and a pricing Plan used for an Account is set to GBP, the bill for an Account using that Plan is + * calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ class CurrencyServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CurrencyServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsync.kt index d966ec10..9a1a46dd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsync.kt @@ -11,6 +11,83 @@ import com.m3ter.models.CustomFieldsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all entities + * that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of the + * m3ter platform. Having this capability to store data in a free-hand fashion can prove very useful + * in helping you to meet specific usage-based pricing and other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by referencing + * them in Derived Field and Compound Aggregation calculations. Given the key role these + * calculations can play when implementing usage-based pricing schema, any Custom Fields you + * reference will then affect how the platform behaves. Referencing Custom Field values in your + * calculations offers a much wider scope of options when it comes to resolving complex usage-based + * pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity request + * and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to also + * add a Custom Field of the same name at the corresponding individual entity level. If you + * reference the Custom Field in a calculation, the value for the individual entity level field is + * used. If no field is defined at individual entity level, then the Organization level field + * value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity level + * for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global Meters*, + * you can also reference Custom Fields added to a Product in Derived Field calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization level + * Meter Custom Field will always be used*, even if you have defined a corresponding field at the + * individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ interface CustomFieldServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsyncImpl.kt index d479d5ab..3de0949d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/CustomFieldServiceAsyncImpl.kt @@ -21,6 +21,83 @@ import com.m3ter.models.CustomFieldsResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all entities + * that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of the + * m3ter platform. Having this capability to store data in a free-hand fashion can prove very useful + * in helping you to meet specific usage-based pricing and other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by referencing + * them in Derived Field and Compound Aggregation calculations. Given the key role these + * calculations can play when implementing usage-based pricing schema, any Custom Fields you + * reference will then affect how the platform behaves. Referencing Custom Field values in your + * calculations offers a much wider scope of options when it comes to resolving complex usage-based + * pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity request + * and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to also + * add a Custom Field of the same name at the corresponding individual entity level. If you + * reference the Custom Field in a calculation, the value for the individual entity level field is + * used. If no field is defined at individual entity level, then the Organization level field + * value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity level + * for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global Meters*, + * you can also reference Custom Fields added to a Product in Derived Field calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization level + * Meter Custom Field will always be used*, even if you have defined a corresponding field at the + * individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ class CustomFieldServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CustomFieldServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsync.kt index 61fa76b6..5d3a4ce2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsync.kt @@ -5,7 +5,9 @@ package com.m3ter.services.async import com.m3ter.core.ClientOptions import com.m3ter.core.RequestOptions import com.m3ter.core.http.HttpResponseFor +import com.m3ter.models.AdHocOperationalDataRequest import com.m3ter.models.AdHocResponse +import com.m3ter.models.AdHocUsageDataRequest import com.m3ter.models.DataExportCreateAdhocParams import com.m3ter.services.async.dataExports.DestinationServiceAsync import com.m3ter.services.async.dataExports.JobServiceAsync @@ -13,6 +15,32 @@ import com.m3ter.services.async.dataExports.ScheduleServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports to + * export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export has + * been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface DataExportServiceAsync { /** @@ -27,10 +55,63 @@ interface DataExportServiceAsync { */ fun withOptions(modifier: Consumer): DataExportServiceAsync + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through + * to the specified Destination. However, the export file is also made available for you to + * download it locally. You can set up and run Data Exports without defining a Destination. The + * data is not exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun destinations(): DestinationServiceAsync fun jobs(): JobServiceAsync + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set + * up an Export Schedule to export one of two types of data from your m3ter Organization - + * either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under + * a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun schedules(): ScheduleServiceAsync /** @@ -85,6 +166,50 @@ interface DataExportServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see createAdhoc */ + fun createAdhoc( + body: DataExportCreateAdhocParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + createAdhoc(DataExportCreateAdhocParams.builder().body(body).build(), requestOptions) + + /** @see createAdhoc */ + fun createAdhoc(body: DataExportCreateAdhocParams.Body): CompletableFuture = + createAdhoc(body, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocOperationalDataRequest( + adHocOperationalDataRequest + ), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest + ): CompletableFuture = + createAdhoc(adHocOperationalDataRequest, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocUsageDataRequest(adHocUsageDataRequest), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest + ): CompletableFuture = createAdhoc(adHocUsageDataRequest, RequestOptions.none()) + /** * A view of [DataExportServiceAsync] that provides access to raw HTTP responses for each * method. @@ -100,10 +225,65 @@ interface DataExportServiceAsync { modifier: Consumer ): DataExportServiceAsync.WithRawResponse + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are + * available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent + * through to the specified Destination. However, the export file is also made available for + * you to download it locally. You can set up and run Data Exports without defining a + * Destination. The data is not exported but the compiled export file is made available for + * downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if + * Data Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun destinations(): DestinationServiceAsync.WithRawResponse fun jobs(): JobServiceAsync.WithRawResponse + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can + * set up an Export Schedule to export one of two types of data from your m3ter + * Organization - either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data + * under a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun schedules(): ScheduleServiceAsync.WithRawResponse /** @@ -120,5 +300,52 @@ interface DataExportServiceAsync { params: DataExportCreateAdhocParams, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + + /** @see createAdhoc */ + fun createAdhoc( + body: DataExportCreateAdhocParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + createAdhoc(DataExportCreateAdhocParams.builder().body(body).build(), requestOptions) + + /** @see createAdhoc */ + fun createAdhoc( + body: DataExportCreateAdhocParams.Body + ): CompletableFuture> = + createAdhoc(body, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocOperationalDataRequest( + adHocOperationalDataRequest + ), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest + ): CompletableFuture> = + createAdhoc(adHocOperationalDataRequest, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocUsageDataRequest(adHocUsageDataRequest), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest + ): CompletableFuture> = + createAdhoc(adHocUsageDataRequest, RequestOptions.none()) } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsyncImpl.kt index 5d43ae9e..8c3eacac 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DataExportServiceAsyncImpl.kt @@ -26,6 +26,32 @@ import com.m3ter.services.async.dataExports.ScheduleServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports to + * export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export has + * been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class DataExportServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : DataExportServiceAsync { @@ -46,10 +72,63 @@ class DataExportServiceAsyncImpl internal constructor(private val clientOptions: override fun withOptions(modifier: Consumer): DataExportServiceAsync = DataExportServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through + * to the specified Destination. However, the export file is also made available for you to + * download it locally. You can set up and run Data Exports without defining a Destination. The + * data is not exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun destinations(): DestinationServiceAsync = destinations override fun jobs(): JobServiceAsync = jobs + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set + * up an Export Schedule to export one of two types of data from your m3ter Organization - + * either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under + * a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun schedules(): ScheduleServiceAsync = schedules override fun createAdhoc( @@ -84,10 +163,65 @@ class DataExportServiceAsyncImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are + * available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent + * through to the specified Destination. However, the export file is also made available for + * you to download it locally. You can set up and run Data Exports without defining a + * Destination. The data is not exported but the compiled export file is made available for + * downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if + * Data Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun destinations(): DestinationServiceAsync.WithRawResponse = destinations override fun jobs(): JobServiceAsync.WithRawResponse = jobs + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can + * set up an Export Schedule to export one of two types of data from your m3ter + * Organization - either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data + * under a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun schedules(): ScheduleServiceAsync.WithRawResponse = schedules private val createAdhocHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsync.kt index 34d56306..7f424736 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsync.kt @@ -15,6 +15,13 @@ import com.m3ter.models.DebitReasonUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit line + * item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ interface DebitReasonServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsyncImpl.kt index e36c283f..aba973e3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/DebitReasonServiceAsyncImpl.kt @@ -28,6 +28,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit line + * item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ class DebitReasonServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : DebitReasonServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsync.kt index 490fddf2..bd317468 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsync.kt @@ -16,6 +16,78 @@ import com.m3ter.models.EventRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * This section provides Endpoints for operations that allow you to retrieve detailed information + * about individual Events, list all Events or specific Event Types, and explore dynamic fields + * available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation of a + * new Prepayment/Commitment for an Account. Each Event is classified under an Event Type framework, + * providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated for + * a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a state + * change at creation, update, or deletion of the entity, you can use API calls to create and + * configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, which you + * can set up by referencing Date/Time fields on configuration and billing entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent out + * via webhooks when the Event occurs and any conditions you've built into the Notification rule's + * calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by the + * Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ interface EventServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsyncImpl.kt index 21ff9350..6af92719 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/EventServiceAsyncImpl.kt @@ -28,6 +28,78 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * This section provides Endpoints for operations that allow you to retrieve detailed information + * about individual Events, list all Events or specific Event Types, and explore dynamic fields + * available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation of a + * new Prepayment/Commitment for an Account. Each Event is classified under an Event Type framework, + * providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated for + * a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a state + * change at creation, update, or deletion of the entity, you can use API calls to create and + * configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, which you + * can set up by referencing Date/Time fields on configuration and billing entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent out + * via webhooks when the Event occurs and any conditions you've built into the Notification rule's + * calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by the + * Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ class EventServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : EventServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsync.kt index 647d67df..6bdafc7e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsync.kt @@ -19,6 +19,19 @@ import com.m3ter.models.ExternalMappingUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities in + * the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the local + * system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at a + * later date, edit or delete them. + */ interface ExternalMappingServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsyncImpl.kt index ac5b8e2a..823ed239 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ExternalMappingServiceAsyncImpl.kt @@ -34,6 +34,19 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities in + * the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the local + * system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at a + * later date, edit or delete them. + */ class ExternalMappingServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ExternalMappingServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsync.kt index a5c930e6..412d5d19 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsync.kt @@ -21,6 +21,25 @@ import com.m3ter.models.IntegrationConfigurationUpdateResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ interface IntegrationConfigurationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsyncImpl.kt index 184d8de7..a664f0d2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/IntegrationConfigurationServiceAsyncImpl.kt @@ -34,6 +34,25 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ class IntegrationConfigurationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : IntegrationConfigurationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsync.kt index f78671cc..fdee5283 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsync.kt @@ -18,6 +18,20 @@ import com.m3ter.services.async.lookupTables.LookupTableRevisionServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. Use + * them for currency conversion, pricing tiers, discount rates, and similar scenarios where you + * require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables have + * been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableServiceAsync { /** @@ -32,8 +46,53 @@ interface LookupTableServiceAsync { */ fun withOptions(modifier: Consumer): LookupTableServiceAsync + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisions(): LookupTableRevisionServiceAsync + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionData(): LookupTableRevisionDataServiceAsync /** Create a new Lookup Table. */ @@ -189,8 +248,54 @@ interface LookupTableServiceAsync { modifier: Consumer ): LookupTableServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, + * and extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations + * that reference the Lookup Table, the data values defined for the published Revision are + * used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisions(): LookupTableRevisionServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionData(): LookupTableRevisionDataServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsyncImpl.kt index f2f60e2d..f4cb6681 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/LookupTableServiceAsyncImpl.kt @@ -32,6 +32,20 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. Use + * them for currency conversion, pricing tiers, discount rates, and similar scenarios where you + * require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables have + * been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableServiceAsync { @@ -52,8 +66,53 @@ class LookupTableServiceAsyncImpl internal constructor(private val clientOptions override fun withOptions(modifier: Consumer): LookupTableServiceAsync = LookupTableServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisions(): LookupTableRevisionServiceAsync = lookupTableRevisions + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionData(): LookupTableRevisionDataServiceAsync = lookupTableRevisionData @@ -114,9 +173,55 @@ class LookupTableServiceAsyncImpl internal constructor(private val clientOptions clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, + * and extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations + * that reference the Lookup Table, the data values defined for the published Revision are + * used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisions(): LookupTableRevisionServiceAsync.WithRawResponse = lookupTableRevisions + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionData(): LookupTableRevisionDataServiceAsync.WithRawResponse = lookupTableRevisionData diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsync.kt index 7875a80a..5552360a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsync.kt @@ -15,6 +15,42 @@ import com.m3ter.models.MeterUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect usage + * data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that any fields you configure for Meters, such as Data Fields or Derived Fields, do not contain + * any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ interface MeterServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsyncImpl.kt index d9704bdc..a332d995 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/MeterServiceAsyncImpl.kt @@ -28,6 +28,42 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect usage + * data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that any fields you configure for Meters, such as Data Fields or Derived Fields, do not contain + * any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ class MeterServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : MeterServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsync.kt index e1b4fdbc..f431d504 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsync.kt @@ -15,6 +15,32 @@ import com.m3ter.models.NotificationConfigurationUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base a + * Notification on a specific Event type, you can include a calculation that references the fields + * available on that Event type to define precise conditions that must be met for the Notification + * to be triggered when an Event of that type occurs. In this way, you can set up highly customized + * Notifications that act as timely alerts to inform you about significant occurrences within your + * Organization. For instance, if you provide a sign-up bonus to new end-customer Accounts, you can + * set up a Notification to alert you when an end-customer Account has used up a certain percentage + * of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ interface NotificationConfigurationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsyncImpl.kt index 7e432569..bca1ae34 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/NotificationConfigurationServiceAsyncImpl.kt @@ -28,6 +28,32 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base a + * Notification on a specific Event type, you can include a calculation that references the fields + * available on that Event type to define precise conditions that must be met for the Notification + * to be triggered when an Event of that type occurs. In this way, you can set up highly customized + * Notifications that act as timely alerts to inform you about significant occurrences within your + * Organization. For instance, if you provide a sign-up bonus to new end-customer Accounts, you can + * set up a Notification to alert you when an end-customer Account has used up a certain percentage + * of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ class NotificationConfigurationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : NotificationConfigurationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsync.kt index 9098db4c..76e7aefe 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsync.kt @@ -12,6 +12,30 @@ import com.m3ter.models.OrganizationConfigUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ interface OrganizationConfigServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsyncImpl.kt index a6b8a085..5ac2f8a9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/OrganizationConfigServiceAsyncImpl.kt @@ -21,6 +21,30 @@ import com.m3ter.models.OrganizationConfigUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ class OrganizationConfigServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : OrganizationConfigServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsync.kt index f8c6db12..e6d934c3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsync.kt @@ -31,6 +31,17 @@ import com.m3ter.models.PermissionPolicyUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Permission Policy related operations such as creation, update, add and retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users *(people)* + * and Service Users *(automated processes with direct API access)*. This enables you to control + * precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ interface PermissionPolicyServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsyncImpl.kt index cd533329..8020ce84 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PermissionPolicyServiceAsyncImpl.kt @@ -44,6 +44,17 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Permission Policy related operations such as creation, update, add and retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users *(people)* + * and Service Users *(automated processes with direct API access)*. This enables you to control + * precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ class PermissionPolicyServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PermissionPolicyServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsync.kt index 3df8467b..3159a1de 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsync.kt @@ -15,6 +15,12 @@ import com.m3ter.models.PlanGroupLinkUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ interface PlanGroupLinkServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsyncImpl.kt index 23d2bc14..e889a73f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupLinkServiceAsyncImpl.kt @@ -28,6 +28,12 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ class PlanGroupLinkServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PlanGroupLinkServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsync.kt index 7cedf787..f2d2b56e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsync.kt @@ -15,6 +15,14 @@ import com.m3ter.models.PlanGroupUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach to + * efficiently handle various uses cases across different plans. For example applying a minimum + * spend amount at billing, across several of your products or features that are each priced + * separately. + */ interface PlanGroupServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsyncImpl.kt index faa99eb7..b721c08e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanGroupServiceAsyncImpl.kt @@ -28,6 +28,14 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach to + * efficiently handle various uses cases across different plans. For example applying a minimum + * spend amount at billing, across several of your products or features that are each priced + * separately. + */ class PlanGroupServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PlanGroupServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsync.kt index 717e1337..0aedd960 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsync.kt @@ -15,6 +15,25 @@ import com.m3ter.models.PlanUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your products + * or services. Each Plan inherits general billing attributes or pricing structure from its parent + * Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can configure + * the exact pricing structures for Plans to charge customers that consume one or more of your + * Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ interface PlanServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsyncImpl.kt index 75ff0a52..6fd10138 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanServiceAsyncImpl.kt @@ -28,6 +28,25 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your products + * or services. Each Plan inherits general billing attributes or pricing structure from its parent + * Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can configure + * the exact pricing structures for Plans to charge customers that consume one or more of your + * Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ class PlanServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PlanServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsync.kt index 85a804e4..96f6ec33 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsync.kt @@ -15,6 +15,16 @@ import com.m3ter.models.PlanTemplateUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the billing + * operations you want applied to your products. PlanTemplates avoid repetition in configuration + * work - many Plans will share settings for billing operations and differ only in the details of + * their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ interface PlanTemplateServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsyncImpl.kt index cdbd72bb..ac527d8d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PlanTemplateServiceAsyncImpl.kt @@ -28,6 +28,16 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the billing + * operations you want applied to your products. PlanTemplates avoid repetition in configuration + * work - many Plans will share settings for billing operations and differ only in the details of + * their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ class PlanTemplateServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PlanTemplateServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsync.kt index 724eba07..c19ed039 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsync.kt @@ -15,6 +15,16 @@ import com.m3ter.models.PricingUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a usage-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ interface PricingServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsyncImpl.kt index f31962b4..18a95f18 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/PricingServiceAsyncImpl.kt @@ -28,6 +28,16 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a usage-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ class PricingServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : PricingServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsync.kt index 8f41bc44..baba09fd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsync.kt @@ -15,6 +15,13 @@ import com.m3ter.models.ProductUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act as a + * container for the Meters, Aggregations, Pricing, and Plans required to implement usage-based and + * other pricing models for your Organization. + */ interface ProductServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsyncImpl.kt index 84b981c8..6e05cdcf 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ProductServiceAsyncImpl.kt @@ -28,6 +28,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act as a + * container for the Meters, Aggregations, Pricing, and Plans required to implement usage-based and + * other pricing models for your Organization. + */ class ProductServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ProductServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsync.kt index 36c704db..092c67a6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsync.kt @@ -21,6 +21,46 @@ import com.m3ter.models.ResourceGroupUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who has + * been given access to your Organization can and cannot do. For example, you might want to create a + * Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural functional + * grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned to + * Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is useful + * for cases where you want to create Permission Policies which allow or deny access to a specific + * subset of resources. For example, grant a user access to only some of the Plans in your + * Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including ResourceGroups + * themselves. This allows you to nest ResourceGroups to support hierarchies of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of type = + * `user`. You can then retrieve a list of the User Resource Groups a user belongs to. For more + * details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ interface ResourceGroupServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsyncImpl.kt index 7d6c0a25..f6f2d857 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ResourceGroupServiceAsyncImpl.kt @@ -36,6 +36,46 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who has + * been given access to your Organization can and cannot do. For example, you might want to create a + * Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural functional + * grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned to + * Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is useful + * for cases where you want to create Permission Policies which allow or deny access to a specific + * subset of resources. For example, grant a user access to only some of the Plans in your + * Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including ResourceGroups + * themselves. This allows you to nest ResourceGroups to support hierarchies of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of type = + * `user`. You can then retrieve a list of the User Resource Groups a user belongs to. For more + * details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ class ResourceGroupServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ResourceGroupServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsync.kt index a64a5af8..3ba7c64a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsync.kt @@ -15,6 +15,18 @@ import com.m3ter.models.ScheduledEventConfigurationUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra degree + * of flexibility over and above system-generated Events for setting up Notifications based on + * Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ interface ScheduledEventConfigurationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsyncImpl.kt index 3ed24dbb..6ea01347 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/ScheduledEventConfigurationServiceAsyncImpl.kt @@ -28,6 +28,18 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra degree + * of flexibility over and above system-generated Events for setting up Notifications based on + * Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ class ScheduledEventConfigurationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ScheduledEventConfigurationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsync.kt index 6a41fde0..afe99956 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsync.kt @@ -14,6 +14,15 @@ import com.m3ter.services.async.statements.StatementJobServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface StatementServiceAsync { /** @@ -28,8 +37,28 @@ interface StatementServiceAsync { */ fun withOptions(modifier: Consumer): StatementServiceAsync + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + */ fun statementJobs(): StatementJobServiceAsync + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ fun statementDefinitions(): StatementDefinitionServiceAsync /** @@ -173,8 +202,29 @@ interface StatementServiceAsync { modifier: Consumer ): StatementServiceAsync.WithRawResponse + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + */ fun statementJobs(): StatementJobServiceAsync.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown + * the usage responsible for the monthly charge on a Bill into weekly portions in Bill + * statements. + */ fun statementDefinitions(): StatementDefinitionServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsyncImpl.kt index 47bd19cc..199aeb98 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/StatementServiceAsyncImpl.kt @@ -28,6 +28,15 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class StatementServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : StatementServiceAsync { @@ -48,8 +57,28 @@ class StatementServiceAsyncImpl internal constructor(private val clientOptions: override fun withOptions(modifier: Consumer): StatementServiceAsync = StatementServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + */ override fun statementJobs(): StatementJobServiceAsync = statementJobs + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ override fun statementDefinitions(): StatementDefinitionServiceAsync = statementDefinitions override fun createCsv( @@ -94,8 +123,29 @@ class StatementServiceAsyncImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + */ override fun statementJobs(): StatementJobServiceAsync.WithRawResponse = statementJobs + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown + * the usage responsible for the monthly charge on a Bill into weekly portions in Bill + * statements. + */ override fun statementDefinitions(): StatementDefinitionServiceAsync.WithRawResponse = statementDefinitions diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsync.kt index f4dc1834..67b4a435 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsync.kt @@ -15,6 +15,18 @@ import com.m3ter.models.TransactionTypeUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating and + * updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've created + * for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ interface TransactionTypeServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsyncImpl.kt index ed243962..35b9ad9e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/TransactionTypeServiceAsyncImpl.kt @@ -28,6 +28,18 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating and + * updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've created + * for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ class TransactionTypeServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : TransactionTypeServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsync.kt index 746244dd..137f2c26 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsync.kt @@ -30,6 +30,34 @@ interface UsageServiceAsync { */ fun withOptions(modifier: Consumer): UsageServiceAsync + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun fileUploads(): FileUploadServiceAsync /** @@ -185,6 +213,34 @@ interface UsageServiceAsync { modifier: Consumer ): UsageServiceAsync.WithRawResponse + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun fileUploads(): FileUploadServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsyncImpl.kt index 433fbc7c..7ee90a02 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UsageServiceAsyncImpl.kt @@ -42,6 +42,34 @@ class UsageServiceAsyncImpl internal constructor(private val clientOptions: Clie override fun withOptions(modifier: Consumer): UsageServiceAsync = UsageServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun fileUploads(): FileUploadServiceAsync = fileUploads override fun getFailedIngestDownloadUrl( @@ -84,6 +112,34 @@ class UsageServiceAsyncImpl internal constructor(private val clientOptions: Clie clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun fileUploads(): FileUploadServiceAsync.WithRawResponse = fileUploads private val getFailedIngestDownloadUrlHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsync.kt index e47892e3..fb4f4455 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsync.kt @@ -36,6 +36,27 @@ interface UserServiceAsync { */ fun withOptions(modifier: Consumer): UserServiceAsync + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept + * the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and + * use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ fun invitations(): InvitationServiceAsync /** @@ -290,6 +311,27 @@ interface UserServiceAsync { */ fun withOptions(modifier: Consumer): UserServiceAsync.WithRawResponse + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up + * an invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they + * accept the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link + * and use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be + * invited to create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ fun invitations(): InvitationServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsyncImpl.kt index d1c51286..22f674b5 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/UserServiceAsyncImpl.kt @@ -52,6 +52,27 @@ class UserServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun withOptions(modifier: Consumer): UserServiceAsync = UserServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept + * the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and + * use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ override fun invitations(): InvitationServiceAsync = invitations override fun retrieve( @@ -120,6 +141,27 @@ class UserServiceAsyncImpl internal constructor(private val clientOptions: Clien clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up + * an invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they + * accept the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link + * and use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be + * invited to create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ override fun invitations(): InvitationServiceAsync.WithRawResponse = invitations private val retrieveHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsync.kt index 07075d91..99c9ab0e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsync.kt @@ -16,6 +16,25 @@ import com.m3ter.models.WebhookUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ interface WebhookServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsyncImpl.kt index b416d388..e0894536 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/WebhookServiceAsyncImpl.kt @@ -29,6 +29,25 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ class WebhookServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : WebhookServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsync.kt index b9608599..4df5237f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsync.kt @@ -20,6 +20,13 @@ import com.m3ter.models.BalanceChargeScheduleUpdateResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ interface ChargeScheduleServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsyncImpl.kt index 27d586bf..d2ff66a4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/ChargeScheduleServiceAsyncImpl.kt @@ -33,6 +33,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ class ChargeScheduleServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ChargeScheduleServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsync.kt index 4aca1bbd..46de3bb3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsync.kt @@ -16,6 +16,13 @@ import com.m3ter.models.ScheduleResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ interface TransactionScheduleServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsyncImpl.kt index d6f221b9..9fcbce80 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionScheduleServiceAsyncImpl.kt @@ -29,6 +29,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ class TransactionScheduleServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : TransactionScheduleServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsync.kt index f38e6310..9d49ee2f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsync.kt @@ -14,6 +14,54 @@ import com.m3ter.models.TransactionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ interface TransactionServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsyncImpl.kt index 0722303f..f189be25 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/balances/TransactionServiceAsyncImpl.kt @@ -27,6 +27,54 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ class TransactionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : TransactionServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsync.kt index 0480b367..93fb8a8f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsync.kt @@ -15,6 +15,13 @@ import com.m3ter.models.CreditLineItemResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items for + * Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ interface CreditLineItemServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsyncImpl.kt index 8c2b28fb..570db26c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/CreditLineItemServiceAsyncImpl.kt @@ -28,6 +28,13 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items for + * Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ class CreditLineItemServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : CreditLineItemServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsync.kt index 88aa8a62..ef8b7632 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsync.kt @@ -15,6 +15,14 @@ import com.m3ter.models.DebitLineItemResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for Debit line item related operations such as creation, update, list and delete. These + * are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for calls + * you can use to create and manage Debit Reasons for your Organization. + */ interface DebitLineItemServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsyncImpl.kt index 88d37e14..039ef798 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/DebitLineItemServiceAsyncImpl.kt @@ -28,6 +28,14 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Debit line item related operations such as creation, update, list and delete. These + * are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for calls + * you can use to create and manage Debit Reasons for your Organization. + */ class DebitLineItemServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : DebitLineItemServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsync.kt index 921e9424..ce828197 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsync.kt @@ -12,6 +12,15 @@ import com.m3ter.models.LineItemResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface LineItemServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsyncImpl.kt index f6035aa5..e9cebd86 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/bills/LineItemServiceAsyncImpl.kt @@ -24,6 +24,15 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class LineItemServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : LineItemServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsync.kt index 784733bf..ad740c72 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsync.kt @@ -9,15 +9,41 @@ import com.m3ter.models.DataExportDestinationCreateParams import com.m3ter.models.DataExportDestinationCreateResponse import com.m3ter.models.DataExportDestinationDeleteParams import com.m3ter.models.DataExportDestinationDeleteResponse +import com.m3ter.models.DataExportDestinationGoogleCloudStorageRequest import com.m3ter.models.DataExportDestinationListPageAsync import com.m3ter.models.DataExportDestinationListParams import com.m3ter.models.DataExportDestinationRetrieveParams import com.m3ter.models.DataExportDestinationRetrieveResponse +import com.m3ter.models.DataExportDestinationS3Request import com.m3ter.models.DataExportDestinationUpdateParams import com.m3ter.models.DataExportDestinationUpdateResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through to + * the specified Destination. However, the export file is also made available for you to download it + * locally. You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface DestinationServiceAsync { /** @@ -58,6 +84,56 @@ interface DestinationServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see create */ + fun create( + body: DataExportDestinationCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create(DataExportDestinationCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create( + body: DataExportDestinationCreateParams.Body + ): CompletableFuture = create(body, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationS3Request( + dataExportDestinationS3Request + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request + ): CompletableFuture = + create(dataExportDestinationS3Request, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationGoogleCloudStorageRequest( + dataExportDestinationGoogleCloudStorageRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest + ): CompletableFuture = + create(dataExportDestinationGoogleCloudStorageRequest, RequestOptions.none()) + /** Retrieve an Export Destination for the given UUID. */ fun retrieve(id: String): CompletableFuture = retrieve(id, DataExportDestinationRetrieveParams.none()) @@ -235,6 +311,58 @@ interface DestinationServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** @see create */ + fun create( + body: DataExportDestinationCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create(DataExportDestinationCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create( + body: DataExportDestinationCreateParams.Body + ): CompletableFuture> = + create(body, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationS3Request( + dataExportDestinationS3Request + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request + ): CompletableFuture> = + create(dataExportDestinationS3Request, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create( + DataExportDestinationCreateParams.Body + .ofDataExportDestinationGoogleCloudStorageRequest( + dataExportDestinationGoogleCloudStorageRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest + ): CompletableFuture> = + create(dataExportDestinationGoogleCloudStorageRequest, RequestOptions.none()) + /** * Returns a raw HTTP response for `get * /organizations/{orgId}/dataexports/destinations/{id}`, but is otherwise the same as diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsyncImpl.kt index f29bde0d..2bea1be0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/DestinationServiceAsyncImpl.kt @@ -31,6 +31,30 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through to + * the specified Destination. However, the export file is also made available for you to download it + * locally. You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class DestinationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : DestinationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsync.kt index f4f6f3bd..9e962124 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsync.kt @@ -15,9 +15,39 @@ import com.m3ter.models.DataExportScheduleRetrieveParams import com.m3ter.models.DataExportScheduleRetrieveResponse import com.m3ter.models.DataExportScheduleUpdateParams import com.m3ter.models.DataExportScheduleUpdateResponse +import com.m3ter.models.OperationalDataExportScheduleRequest +import com.m3ter.models.UsageDataExportScheduleRequest import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set up + * an Export Schedule to export one of two types of data from your m3ter Organization - either + * *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under a + * single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface ScheduleServiceAsync { /** @@ -78,6 +108,54 @@ interface ScheduleServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see create */ + fun create( + body: DataExportScheduleCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create(DataExportScheduleCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create( + body: DataExportScheduleCreateParams.Body + ): CompletableFuture = create(body, RequestOptions.none()) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create( + DataExportScheduleCreateParams.Body.ofOperationalDataExportScheduleRequest( + operationalDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest + ): CompletableFuture = + create(operationalDataExportScheduleRequest, RequestOptions.none()) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + create( + DataExportScheduleCreateParams.Body.ofUsageDataExportScheduleRequest( + usageDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest + ): CompletableFuture = + create(usageDataExportScheduleRequest, RequestOptions.none()) + /** * Retrieve a Data Export Schedule for the given UUID. Each Schedule can be configured for * exporting *only one* of either Usage or Operational data. @@ -266,6 +344,55 @@ interface ScheduleServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** @see create */ + fun create( + body: DataExportScheduleCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create(DataExportScheduleCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create( + body: DataExportScheduleCreateParams.Body + ): CompletableFuture> = + create(body, RequestOptions.none()) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create( + DataExportScheduleCreateParams.Body.ofOperationalDataExportScheduleRequest( + operationalDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest + ): CompletableFuture> = + create(operationalDataExportScheduleRequest, RequestOptions.none()) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + create( + DataExportScheduleCreateParams.Body.ofUsageDataExportScheduleRequest( + usageDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest + ): CompletableFuture> = + create(usageDataExportScheduleRequest, RequestOptions.none()) + /** * Returns a raw HTTP response for `get /organizations/{orgId}/dataexports/schedules/{id}`, * but is otherwise the same as [ScheduleServiceAsync.retrieve]. diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsyncImpl.kt index a3a25841..a304debe 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/dataExports/ScheduleServiceAsyncImpl.kt @@ -31,6 +31,34 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set up + * an Export Schedule to export one of two types of data from your m3ter Organization - either + * *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under a + * single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class ScheduleServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsync.kt index 174b4aff..d2c44997 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsync.kt @@ -27,6 +27,27 @@ import com.m3ter.services.async.lookupTables.lookupTableRevisionData.LookupTable import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionDataServiceAsync { /** @@ -41,6 +62,28 @@ interface LookupTableRevisionDataServiceAsync { */ fun withOptions(modifier: Consumer): LookupTableRevisionDataServiceAsync + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobServiceAsync /** List Lookup Table Revision Data items for the given UUID. */ @@ -384,6 +427,28 @@ interface LookupTableRevisionDataServiceAsync { modifier: Consumer ): LookupTableRevisionDataServiceAsync.WithRawResponse + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsyncImpl.kt index dcce1be8..60cf9c41 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionDataServiceAsyncImpl.kt @@ -40,6 +40,27 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionDataServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionDataServiceAsync { @@ -62,6 +83,28 @@ internal constructor(private val clientOptions: ClientOptions) : clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobServiceAsync = lookupTableRevisionDataJobs @@ -155,6 +198,28 @@ internal constructor(private val clientOptions: ClientOptions) : clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobServiceAsync.WithRawResponse = lookupTableRevisionDataJobs diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsync.kt index a165a0ca..8ceb00d4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsync.kt @@ -16,6 +16,26 @@ import com.m3ter.models.LookupTableRevisionResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft Revisions, + * but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision containing + * the required new values. The currently published Revision is archived automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncImpl.kt index a129f2a4..d4035f3f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncImpl.kt @@ -29,6 +29,26 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft Revisions, + * but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision containing + * the required new values. The currently published Revision is archived automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsync.kt index 1112a9b2..3fdccda6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsync.kt @@ -16,6 +16,27 @@ import com.m3ter.models.LookupTableLookupTableRevisionDataLookupTableRevisionDat import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionDataJobServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsyncImpl.kt index 24adf8b6..fe3e1704 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceAsyncImpl.kt @@ -29,6 +29,27 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionDataJobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionDataJobServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsync.kt index 245ba951..b6ce4d2d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsync.kt @@ -15,6 +15,17 @@ import com.m3ter.models.StatementStatementDefinitionUpdateParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ interface StatementDefinitionServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsyncImpl.kt index 1ba6cd68..9e51d75a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementDefinitionServiceAsyncImpl.kt @@ -28,6 +28,17 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ class StatementDefinitionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : StatementDefinitionServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsync.kt index 9bc6b118..b9ee1364 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsync.kt @@ -15,6 +15,15 @@ import com.m3ter.models.StatementStatementJobRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + */ interface StatementJobServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncImpl.kt index f31c52e3..9dbb2009 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncImpl.kt @@ -28,6 +28,15 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + */ class StatementJobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : StatementJobServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsync.kt index 185cc074..751f2d99 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsync.kt @@ -11,6 +11,33 @@ import com.m3ter.services.async.usage.fileUploads.JobServiceAsync import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ interface FileUploadServiceAsync { /** @@ -25,6 +52,34 @@ interface FileUploadServiceAsync { */ fun withOptions(modifier: Consumer): FileUploadServiceAsync + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun jobs(): JobServiceAsync /** @@ -68,6 +123,34 @@ interface FileUploadServiceAsync { modifier: Consumer ): FileUploadServiceAsync.WithRawResponse + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun jobs(): JobServiceAsync.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsyncImpl.kt index a9e454f9..2c9c1a67 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/FileUploadServiceAsyncImpl.kt @@ -22,6 +22,33 @@ import com.m3ter.services.async.usage.fileUploads.JobServiceAsyncImpl import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ class FileUploadServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : FileUploadServiceAsync { @@ -36,6 +63,34 @@ class FileUploadServiceAsyncImpl internal constructor(private val clientOptions: override fun withOptions(modifier: Consumer): FileUploadServiceAsync = FileUploadServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun jobs(): JobServiceAsync = jobs override fun generateUploadUrl( @@ -62,6 +117,34 @@ class FileUploadServiceAsyncImpl internal constructor(private val clientOptions: clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun jobs(): JobServiceAsync.WithRawResponse = jobs private val generateUploadUrlHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsync.kt index f5d4bbeb..3b3546f9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsync.kt @@ -14,6 +14,33 @@ import com.m3ter.models.UsageFileUploadJobRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ interface JobServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsyncImpl.kt index b4ed70ee..50e916a8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/usage/fileUploads/JobServiceAsyncImpl.kt @@ -26,6 +26,33 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ class JobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : JobServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsync.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsync.kt index 58730912..55c5df48 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsync.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsync.kt @@ -13,6 +13,27 @@ import com.m3ter.models.UserInvitationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer +/** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other people to + * join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept the + * invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and use + * their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ interface InvitationServiceAsync { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsyncImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsyncImpl.kt index ae8a7ed4..e4e18618 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsyncImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/async/users/InvitationServiceAsyncImpl.kt @@ -26,6 +26,27 @@ import java.util.concurrent.CompletableFuture import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other people to + * join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept the + * invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and use + * their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ class InvitationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : InvitationServiceAsync { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanService.kt index 5b90a38b..9a9c34e3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanService.kt @@ -15,6 +15,59 @@ import com.m3ter.models.AccountPlanRetrieveParams import com.m3ter.models.AccountPlanUpdateParams import java.util.function.Consumer +/** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list + * and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges + * incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan + * is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create an + * AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create the + * Plan Group, you define an overall minimum spend and then add any priced Plans you want to include + * in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that + * consumes the separate Products which are priced using the included Plans. At billing, the minimum + * spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this + * creates an AccountPlanGroup. However, the m3ter data model *does not support a separate + * AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be + * active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of the + * Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group + * to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group already + * attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ interface AccountPlanService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanServiceImpl.kt index 2188d28c..10f6700d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountPlanServiceImpl.kt @@ -27,6 +27,59 @@ import com.m3ter.models.AccountPlanUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list + * and delete. + * + * **AccountPlans** An Account represents one of your end-customer accounts. To create an + * AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges + * incurred at billing by your end customer for consuming the Product the Plan is for: + * * **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan + * is active for the Account. + * * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate + * AccountPlans to charge for each Product. + * + * **AccountPlan Constraints:** + * * Only one AccountPlan per Product can be active at any one time for an Account. + * * If you create a Plan as a custom Plan for a specific Account, you can only use it to create an + * AccountPlan for that Account. + * + * **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at + * billing across several of your Products each of which are priced separately - when you create the + * Plan Group, you define an overall minimum spend and then add any priced Plans you want to include + * in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that + * consumes the separate Products which are priced using the included Plans. At billing, the minimum + * spend you've defined for the Plan Group is applied: + * * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the + * Plan Group will be active for the Account. + * + * **Plan Group Notes:** + * * You can only add *one Plan for the same Product* to a Plan Group. See the + * [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more + * details on creating Plan Groups. + * * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be + * attached to that Account to create an AccountPlanGroup. + * + * **AcountPlanGroup - Notes and Constraints:** + * * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this + * creates an AccountPlanGroup. However, the m3ter data model *does not support a separate + * AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a + * `planGroupId` is used instead of a `planId` when it's created. See the + * [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) + * call in this section and + * [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) + * in our main User Documentation. + * * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to + * create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be + * active at any one time for an Account* is preserved: + * * Multiple attached Plan Groups on an Account can have overlapping dates only if none of the + * Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group + * to an Account with Plan Groups already attached and: + * * The new Plan Group contains a Product Plan that also belongs to a Plan Group already + * attached to the Account. + * * The dates for these "matched Plan" Plan Groups being active for the Account would overlap. + * * Then you'll receive an error and the attachment will be blocked. + */ class AccountPlanServiceImpl internal constructor(private val clientOptions: ClientOptions) : AccountPlanService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountService.kt index c6520bc5..a59feb28 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountService.kt @@ -21,6 +21,33 @@ import com.m3ter.models.AccountSearchResponse import com.m3ter.models.AccountUpdateParams import java.util.function.Consumer +/** + * Endpoints for Account related operations such as creation, update, list and delete. An Account + * represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than one + * of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate bills + * for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan Template + * to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but not + * all of the Prepayment is prepaid, you can use a customized billing schedule for outstanding + * fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can then + * set up billing for the Parent/Child Account usage to have the end-customer billed once for the + * Parent Account, instead of having separate bills issued for usage against each of their multiple + * Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that only the ``name``, ``address``, or ``emailAddress`` fields contain any end-customer PII data + * on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ interface AccountService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountServiceImpl.kt index c566c607..0a4006bb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AccountServiceImpl.kt @@ -34,6 +34,33 @@ import com.m3ter.models.AccountUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Account related operations such as creation, update, list and delete. An Account + * represents one of your end-customer accounts. + * + * Accounts do not belong to a Product to allow for cases where an end customer takes more than one + * of your Products, and the charges for these Products differ. + * + * You typically attach a priced Plan or Plan Template to an Account before you can generate bills + * for the Account: + * - If a customer consumes several of your Products, you can attach a priced Plan or Plan Template + * to the Account for charging against each Product. + * - If an Account is charged solely on the basis of an agreed Prepayment/Commitment amount but not + * all of the Prepayment is prepaid, you can use a customized billing schedule for outstanding + * fees without having to attach a Plan to the Account to generate Bills. + * + * You can create Child Accounts for end customers who hold multiple Accounts with you. You can then + * set up billing for the Parent/Child Account usage to have the end-customer billed once for the + * Parent Account, instead of having separate bills issued for usage against each of their multiple + * Accounts. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that only the ``name``, ``address``, or ``emailAddress`` fields contain any end-customer PII data + * on any Accounts you create. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + */ class AccountServiceImpl internal constructor(private val clientOptions: ClientOptions) : AccountService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationService.kt index ecf2b68b..b9bf9ae2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationService.kt @@ -15,6 +15,30 @@ import com.m3ter.models.AggregationRetrieveParams import com.m3ter.models.AggregationUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted Meter + * field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing Product + * Plans and apply usage-based pricing to your products and services. You might also want to + * aggregate raw data measures for other purposes, such as to feed into analytical or business + * performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, which + * apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation to + * them to derive pricing metrics needed to serve more complex usage-based pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing and + * billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ interface AggregationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationServiceImpl.kt index ee27e25a..2e872472 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AggregationServiceImpl.kt @@ -27,6 +27,30 @@ import com.m3ter.models.AggregationUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Aggregations. + * + * An Aggregation links to a Meter and targets a Data Field or Derived Field on the Meter. You + * define the method of aggregation used to convert the usage data collected by the targeted Meter + * field into a numerical unit of measurement. + * + * You can then use the unit of measurement an Aggregation yields as a metric for pricing Product + * Plans and apply usage-based pricing to your products and services. You might also want to + * aggregate raw data measures for other purposes, such as to feed into analytical or business + * performance tools. + * + * **Notes:** + * * **Contrast with Compound Aggregations**. Standard or simple Aggregations of this type, which + * apply an aggregation method directly to Meter usage data fields, are contrasted with + * [Compound Aggregations](https://www.m3ter.com/docs/api#tag/CompoundAggregation). A Compound + * Aggregation typically references one or more simple Aggregations and applies a calculation to + * them to derive pricing metrics needed to serve more complex usage-based pricing scenarios. + * * **Segmented Aggregations**. Segmented Aggregations allow you to segment the usage data + * collected by a single Meter. This capability is very useful for implementing some pricing and + * billing use cases. See + * [Segmented Aggregations](https://www.m3ter.com/docs/guides/usage-data-aggregations/segmented-aggregations) + * in our main documentation for more details. + */ class AggregationServiceImpl internal constructor(private val clientOptions: ClientOptions) : AggregationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationService.kt index 799e4565..4e8e8edb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationService.kt @@ -10,6 +10,13 @@ import com.m3ter.models.AuthenticationGetBearerTokenParams import com.m3ter.models.AuthenticationGetBearerTokenResponse import java.util.function.Consumer +/** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the Client + * Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your Organization - + * that is, as an API user. + */ interface AuthenticationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationServiceImpl.kt index 158f9af8..3a4f4250 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/AuthenticationServiceImpl.kt @@ -19,6 +19,13 @@ import com.m3ter.models.AuthenticationGetBearerTokenParams import com.m3ter.models.AuthenticationGetBearerTokenResponse import java.util.function.Consumer +/** + * Endpoint for retrieving a JSON Web Token (JWT) bearer token for a ServiceUser using the Client + * Credentials Grant flow. + * + * A ServiceUser represents the automated process you want to grant access to your Organization - + * that is, as an API user. + */ class AuthenticationServiceImpl internal constructor(private val clientOptions: ClientOptions) : AuthenticationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceService.kt index 8621d463..8f3d5874 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceService.kt @@ -18,6 +18,54 @@ import com.m3ter.services.blocking.balances.TransactionScheduleService import com.m3ter.services.blocking.balances.TransactionService import java.util.function.Consumer +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ interface BalanceService { /** @@ -32,10 +80,74 @@ interface BalanceService { */ fun withOptions(modifier: Consumer): BalanceService + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ fun transactions(): TransactionService + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun chargeSchedules(): ChargeScheduleService + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun transactionSchedules(): TransactionScheduleService /** @@ -178,10 +290,76 @@ interface BalanceService { */ fun withOptions(modifier: Consumer): BalanceService.WithRawResponse + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ fun transactions(): TransactionService.WithRawResponse + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun chargeSchedules(): ChargeScheduleService.WithRawResponse + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ fun transactionSchedules(): TransactionScheduleService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceServiceImpl.kt index 33c4b772..0253ab64 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BalanceServiceImpl.kt @@ -33,6 +33,54 @@ import com.m3ter.services.blocking.balances.TransactionServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ class BalanceServiceImpl internal constructor(private val clientOptions: ClientOptions) : BalanceService { @@ -55,10 +103,74 @@ class BalanceServiceImpl internal constructor(private val clientOptions: ClientO override fun withOptions(modifier: Consumer): BalanceService = BalanceServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types for + * your Organization, and then use one of these Transaction Types when you add a specific + * Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service consumption. + * You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as + * an initial commitment, which allows them to use the service and gain an accurate insight + * into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent + * Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A customer + * might pay the entire or only part of the agreed amount upfront, but ***the commitment or + * prepayment amount is payable regardless of the actual usage by the customer of your service + * or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period + * or when you as service provider want to add a credit to a customer Account. This Balance + * credit can then be drawn-down against for billing the Account for usage, minimum spend, + * standing charges, or recurring charges due. Balances therefore serve payment use cases in a + * more flexible way, for example to be used for a "Free Credit" sign-up scheme you offer to + * encourage sales or to enhance customer satisfaction by adding credit to an Account to + * compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit on + * an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ override fun transactions(): TransactionService = transactions + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun chargeSchedules(): ChargeScheduleService = chargeSchedules + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun transactionSchedules(): TransactionScheduleService = transactionSchedules override fun create(params: BalanceCreateParams, requestOptions: RequestOptions): Balance = @@ -106,10 +218,76 @@ class BalanceServiceImpl internal constructor(private val clientOptions: ClientO clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative + * Transaction amounts for the Balance. To do this, you must first define Transaction Types + * for your Organization, and then use one of these Transaction Types when you add a + * specific Transaction to a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their + * Account, which can then be draw-down against charges due for product or service + * consumption. You can include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an + * initial free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This + * acts as an initial commitment, which allows them to use the service and gain an + * accurate insight into their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to + * subsequent Bills as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have + * agreed to pay for consuming your product or services across a full contract term. A + * customer might pay the entire or only part of the agreed amount upfront, but ***the + * commitment or prepayment amount is payable regardless of the actual usage by the customer + * of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used + * when a customer wants to add a credit amount to their Account at any time during the + * service period or when you as service provider want to add a credit to a customer + * Account. This Balance credit can then be drawn-down against for billing the Account for + * usage, minimum spend, standing charges, or recurring charges due. Balances therefore + * serve payment use cases in a more flexible way, for example to be used for a "Free + * Credit" sign-up scheme you offer to encourage sales or to enhance customer satisfaction + * by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at + * Organization or individual Account level the order in which any Balance/Commitment credit + * on an Account is drawn-down - Balance amounts first or Commitment/Prepayment amounts + * first. + */ override fun transactions(): TransactionService.WithRawResponse = transactions + /** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun chargeSchedules(): ChargeScheduleService.WithRawResponse = chargeSchedules + /** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ override fun transactionSchedules(): TransactionScheduleService.WithRawResponse = transactionSchedules diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigService.kt index a2b68657..44c7e198 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigService.kt @@ -11,6 +11,18 @@ import com.m3ter.models.BillConfigRetrieveParams import com.m3ter.models.BillConfigUpdateParams import java.util.function.Consumer +/** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - any + * Bill with a service period end date on or before the set date will be locked and cannot be + * updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the specified + * lock date, then you'll receive an error. + */ interface BillConfigService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigServiceImpl.kt index 0000c694..0dc29e10 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillConfigServiceImpl.kt @@ -20,6 +20,18 @@ import com.m3ter.models.BillConfigRetrieveParams import com.m3ter.models.BillConfigUpdateParams import java.util.function.Consumer +/** + * Endpoints for updating and retreiving the Bill Configuration for an Organization. The + * Organization represents your company as a direct customer of the m3ter service. + * + * You can use the **Update BillConfig** endpoint to set a global lock date for **all** Bills - any + * Bill with a service period end date on or before the set date will be locked and cannot be + * updated. + * + * **Warning: Ensure all Bills are Approved!** If you try to set a global lock date when there + * remains Bills in a *Pending* state whose service period end date is on or before the specified + * lock date, then you'll receive an error. + */ class BillConfigServiceImpl internal constructor(private val clientOptions: ClientOptions) : BillConfigService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobService.kt index 5467ffbe..a4517751 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobService.kt @@ -15,6 +15,17 @@ import com.m3ter.models.BillJobResponse import com.m3ter.models.BillJobRetrieveParams import java.util.function.Consumer +/** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different billing + * management purposes. For example, some historical usage data has come in for an Account and you + * want to run a Bill for a specific date on that Account to check that the Bill is showing + * correctly for the charges due on the new usage data. + */ interface BillJobService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobServiceImpl.kt index a0d3bef2..567766e8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillJobServiceImpl.kt @@ -27,6 +27,17 @@ import com.m3ter.models.BillJobRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, retrieving, listing, and cancelling Bill Jobs. + * + * Bill Jobs are critical components in billing management, providing asynchronous mechanisms to + * calculate and handle bills. + * + * Bill Jobs give you the flexibiity to run Bills manually for Accounts to suit different billing + * management purposes. For example, some historical usage data has come in for an Account and you + * want to run a Bill for a specific date on that Account to check that the Bill is showing + * correctly for the charges due on the new usage data. + */ class BillJobServiceImpl internal constructor(private val clientOptions: ClientOptions) : BillJobService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillService.kt index 090bae22..4638e849 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillService.kt @@ -23,6 +23,15 @@ import com.m3ter.services.blocking.bills.DebitLineItemService import com.m3ter.services.blocking.bills.LineItemService import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface BillService { /** @@ -37,10 +46,34 @@ interface BillService { */ fun withOptions(modifier: Consumer): BillService + /** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items + * for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ fun creditLineItems(): CreditLineItemService + /** + * Endpoints for Debit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for + * calls you can use to create and manage Debit Reasons for your Organization. + */ fun debitLineItems(): DebitLineItemService + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ fun lineItems(): LineItemService /** @@ -288,10 +321,34 @@ interface BillService { */ fun withOptions(modifier: Consumer): BillService.WithRawResponse + /** + * Endpoints for Credit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line + * items for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ fun creditLineItems(): CreditLineItemService.WithRawResponse + /** + * Endpoints for Debit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items + * for Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section + * for calls you can use to create and manage Debit Reasons for your Organization. + */ fun debitLineItems(): DebitLineItemService.WithRawResponse + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ fun lineItems(): LineItemService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillServiceImpl.kt index 90671fcc..46ca4b02 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/BillServiceImpl.kt @@ -38,6 +38,15 @@ import com.m3ter.services.blocking.bills.LineItemServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class BillServiceImpl internal constructor(private val clientOptions: ClientOptions) : BillService { private val withRawResponse: BillService.WithRawResponse by lazy { @@ -59,10 +68,34 @@ class BillServiceImpl internal constructor(private val clientOptions: ClientOpti override fun withOptions(modifier: Consumer): BillService = BillServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items + * for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ override fun creditLineItems(): CreditLineItemService = creditLineItems + /** + * Endpoints for Debit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for + * calls you can use to create and manage Debit Reasons for your Organization. + */ override fun debitLineItems(): DebitLineItemService = debitLineItems + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights into + * the consumption patterns and charges of your end-customer Accounts. + */ override fun lineItems(): LineItemService = lineItems override fun retrieve( @@ -137,10 +170,34 @@ class BillServiceImpl internal constructor(private val clientOptions: ClientOpti clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for Credit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line + * items for Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ override fun creditLineItems(): CreditLineItemService.WithRawResponse = creditLineItems + /** + * Endpoints for Debit line item related operations such as creation, update, list and + * delete. These are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items + * for Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section + * for calls you can use to create and manage Debit Reasons for your Organization. + */ override fun debitLineItems(): DebitLineItemService.WithRawResponse = debitLineItems + /** + * Endpoints for billing operations such as creating, updating, listing,downloading, and + * deleting Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based + * pricing Plans applied for the Products the Account consumes. These endpoints enable + * interaction with the billing system, allowing you to obtain billing details and insights + * into the consumption patterns and charges of your end-customer Accounts. + */ override fun lineItems(): LineItemService.WithRawResponse = lineItems private val retrieveHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeService.kt index acf71d5f..424b0594 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeService.kt @@ -18,6 +18,26 @@ import com.m3ter.models.ChargeUpdateParams import com.m3ter.models.ChargeUpdateResponse import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account billing. + * Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill date, + * a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create balance + * fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ interface ChargeService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeServiceImpl.kt index d10031a9..48f4661d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ChargeServiceImpl.kt @@ -30,6 +30,26 @@ import com.m3ter.models.ChargeUpdateResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Charges. + * + * Create Charges for your end-customer Accounts to create ad-hoc line items for Account billing. + * Charges are: + * * Created for either debit or credit amounts. + * * Linked to a Product for accounting purposes. + * * Optionally linked to a Contract. + * * Given a specific date for billing. When a bill job has run for the specified Charge bill date, + * a Charge appears as an Ad-hoc line item on the Bill. + * * Assigned a service period. + * * Available in any currency defined for your Organization. See + * [Creating Charges for Accounts](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-charges-for-accounts) + * in our main user documentation for more details. + * + * Alternatively, you can create a Charge for a Balance on an end-customer Account to create balance + * fee line items for Account billing. See + * [Creating Charges for Balances](https://www.m3ter.com/docs/guides/end-customer-accounts/creating-balances-for-accounts/creating-charges-for-balances) + * in our main user documentation for more details. + */ class ChargeServiceImpl internal constructor(private val clientOptions: ClientOptions) : ChargeService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentService.kt index 877cfa07..9e70fe12 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentService.kt @@ -17,6 +17,50 @@ import com.m3ter.models.CommitmentSearchResponse import com.m3ter.models.CommitmentUpdateParams import java.util.function.Consumer +/** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed to + * pay a fixed minimum amount throughout the contract period. ***The commitment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use them + * to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming your + * product or services across a full contract term. A customer might pay the entire or only part of + * the agreed amount upfront, but ***the prepayment amount is payable regardless of the actual usage + * by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Prepayment credit on an Account is + * drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the customer + * Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ interface CommitmentService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentServiceImpl.kt index efedfdd7..1877c4f9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CommitmentServiceImpl.kt @@ -29,6 +29,50 @@ import com.m3ter.models.CommitmentUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints that manage Commitments *(also known as Prepayments)* in the context of usage-based + * pricing and billing. A Commitment represents an agreement where the end-customer has agreed to + * pay a fixed minimum amount throughout the contract period. ***The commitment amount is payable + * regardless of the actual usage by the customer of your service or product.*** + * + * These endpoints enable the creation, updating, retrieval, and deletion of Commitments. Use them + * to manage your customer's Commitments and ensure optimal revenue recognition: + * * Specify which type of charges can draw-down against a Commitment amount on an Account at + * billing: usage, minimum spend, standing charges, or recurring charges. + * * Define overage surcharge percentages, which are applied when the usage charges exceed the + * agreed Commitment amount within the contract duration. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments/Prepayments are used for amounts end-customers have agreed to pay for consuming your + * product or services across a full contract term. A customer might pay the entire or only part of + * the agreed amount upfront, but ***the prepayment amount is payable regardless of the actual usage + * by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Prepayments/Commitments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Prepayment credit on an Account is + * drawn-down - Balance amounts first or Prepayment amounts first. + * + * #### Billing for Commitments + * + * If not all of an agreed Commitment amount is paid at the start of an end-customer contract + * period, you can choose one of two options for billing the outstanding fees due on the customer + * Account: + * - Select a Product *Plan to bill with*. + * - Define a *schedule of billing dates*. + */ class CommitmentServiceImpl internal constructor(private val clientOptions: ClientOptions) : CommitmentService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationService.kt index 0babf425..6252456b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationService.kt @@ -16,6 +16,38 @@ import com.m3ter.models.CompoundAggregationRetrieveParams import com.m3ter.models.CompoundAggregationUpdateParams import java.util.function.Consumer +/** + * Endpoints for Compound Aggregation related operations such as creation, update, list and delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a calculation + * to one or more simple Aggregations or Custom Fields. These numerical measures can then be used as + * pricing metrics to price your Product Plans, enabling you to implement a wide range of + * usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and any + * product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the same + * Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any Global + * simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity per + * unit** defined or a **Rounding** defined, these will not be factored into the value used by the + * calculation. For example, if the simple Aggregation referenced has a base value of 100 and has + * **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the base value of + * 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ interface CompoundAggregationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationServiceImpl.kt index bcafa232..46f898a0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CompoundAggregationServiceImpl.kt @@ -28,6 +28,38 @@ import com.m3ter.models.CompoundAggregationUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Compound Aggregation related operations such as creation, update, list and delete. + * + * Use Compound Aggregations to create numerical measures from usage data by applying a calculation + * to one or more simple Aggregations or Custom Fields. These numerical measures can then be used as + * pricing metrics to price your Product Plans, enabling you to implement a wide range of + * usage-based pricing use cases. + * + * You can create two types of Compound Aggregation: + * + * **Global** + * - Pricing: Not tied to any specific product and can be used to price Plans belonging to any + * Product. + * - Calculation: can reference all simple Aggregations - both Global simple Aggregations and any + * product-specific simple Aggregations. + * + * **Product-specific** + * - Pricing: belong to a specific Product and can only be used to price Plans belonging to the same + * Product. + * - Calculation: can reference any simple Aggregations belonging to the same Product and any Global + * simple Aggregations. + * + * **IMPORTANT!** If a simple Aggregation referenced by a Compound Aggregation has a **Quantity per + * unit** defined or a **Rounding** defined, these will not be factored into the value used by the + * calculation. For example, if the simple Aggregation referenced has a base value of 100 and has + * **Quantity per unit** set at 10, the Compound Aggregation calculation *will use the base value of + * 100 not 10*. + * + * To better understand and use Compound Aggregations, refer to the example + * [Compound Aggregation Use Case](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/compound-aggregations#example-use-case) + * in the m3ter documentation. + */ class CompoundAggregationServiceImpl internal constructor(private val clientOptions: ClientOptions) : CompoundAggregationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractService.kt index 036a2fac..7823dab7 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractService.kt @@ -17,6 +17,15 @@ import com.m3ter.models.ContractRetrieveParams import com.m3ter.models.ContractUpdateParams import java.util.function.Consumer +/** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ interface ContractService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractServiceImpl.kt index 6ecb4aca..b2fb9e8c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ContractServiceImpl.kt @@ -29,6 +29,15 @@ import com.m3ter.models.ContractUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Contract related operations such as creation, update, list and delete. + * + * Contracts are created for Accounts, which are your end-user customers. Contracts can be used for: + * * **Accounts Reporting**. To serve your general accounting operations and processes, you can + * report on total Contract values for an Account. + * * **Contract Billing**. Various billing entities associated with an Account can be linked to + * Contracts on the Account to meet your specific Contract billing use cases. + */ class ContractServiceImpl internal constructor(private val clientOptions: ClientOptions) : ContractService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentService.kt index 958835c2..3170c8af 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentService.kt @@ -15,6 +15,18 @@ import com.m3ter.models.CounterAdjustmentRetrieveParams import com.m3ter.models.CounterAdjustmentUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based pricing, + * you can then create CounterAdjustments for the Account using that Counter to ensure the Account + * is billed according to the number of Counter units the Account subscribes to in a given billing + * period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ interface CounterAdjustmentService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentServiceImpl.kt index e984933e..db3ae311 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterAdjustmentServiceImpl.kt @@ -27,6 +27,18 @@ import com.m3ter.models.CounterAdjustmentUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterAdjustments. + * + * If you attach a Plan to an Account which is priced using a Counter to apply unit-based pricing, + * you can then create CounterAdjustments for the Account using that Counter to ensure the Account + * is billed according to the number of Counter units the Account subscribes to in a given billing + * period. + * + * See + * [Understanding and Creating Counter Adjustments for Accounts](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counter-adjustments-for-accounts) + * for more information. + */ class CounterAdjustmentServiceImpl internal constructor(private val clientOptions: ClientOptions) : CounterAdjustmentService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingService.kt index 1baa761b..728ff057 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingService.kt @@ -15,6 +15,16 @@ import com.m3ter.models.CounterPricingRetrieveParams import com.m3ter.models.CounterPricingUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ interface CounterPricingService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingServiceImpl.kt index 1ac630d9..d139171a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterPricingServiceImpl.kt @@ -27,6 +27,16 @@ import com.m3ter.models.CounterPricingUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting CounterPricing. + * + * Create the CounterPricing for a Plan/PlanTemplate using a Counter, and define a unit-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Creating Counters and Pricing Plans](https://www.m3ter.com/docs/guides/recurring-charges-counters/creating-counters) + * for more information. + */ class CounterPricingServiceImpl internal constructor(private val clientOptions: ClientOptions) : CounterPricingService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterService.kt index c1b9d1c5..2bd1bf2d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterService.kt @@ -15,6 +15,22 @@ import com.m3ter.models.CounterRetrieveParams import com.m3ter.models.CounterUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing metrics to + * apply a unit-based [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product + * Plans or Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your end-customer + * Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the Accounts + * and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) in + * our main user documentation for more details. + */ interface CounterService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterServiceImpl.kt index 73805ca0..92e0eb03 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CounterServiceImpl.kt @@ -27,6 +27,22 @@ import com.m3ter.models.CounterUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, retrieving, updating, or deleting Counters. + * + * You can create Counters for your m3ter Organization, which can then be used as pricing metrics to + * apply a unit-based [CounterPricing](https://www.m3ter.com/docs/api#tag/CounterPricing) to Product + * Plans or Plan Templates for recurring subscription charges on Accounts. + * + * Counters can then be used to post + * [CounterAdjustments](https://www.m3ter.com/docs/api#tag/CounterAdjustments) on your end-customer + * Accounts. + * + * Accounts are then billed in accordance with the CounterPricing on Plans attached to the Accounts + * and for the actual Counter quantities Accounts subscribe to. See + * [Recurring Charges: Counters](https://www.m3ter.com/docs/guides/recurring-charges-counters) in + * our main user documentation for more details. + */ class CounterServiceImpl internal constructor(private val clientOptions: ClientOptions) : CounterService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonService.kt index 7c1e9307..24b3ca24 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonService.kt @@ -15,6 +15,13 @@ import com.m3ter.models.CreditReasonRetrieveParams import com.m3ter.models.CreditReasonUpdateParams import java.util.function.Consumer +/** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit line + * item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ interface CreditReasonService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonServiceImpl.kt index 54a61bad..f118640a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CreditReasonServiceImpl.kt @@ -27,6 +27,13 @@ import com.m3ter.models.CreditReasonUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for CreditReason operations such as creation, update, list, and delete. + * + * You can create CreditReasons for your Organization, and then use them when creating a credit line + * item on a bill, or applying a product credit to a bill. CreditReasons provide contextual + * information as to why a credit was applied. + */ class CreditReasonServiceImpl internal constructor(private val clientOptions: ClientOptions) : CreditReasonService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyService.kt index 998e9449..3d9fdb03 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyService.kt @@ -15,6 +15,22 @@ import com.m3ter.models.CurrencyRetrieveParams import com.m3ter.models.CurrencyUpdateParams import java.util.function.Consumer +/** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities such + * as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides any + * currency settings in your pricing Plans. For example, if the Organization currency is set to USD + * and a pricing Plan used for an Account is set to GBP, the bill for an Account using that Plan is + * calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ interface CurrencyService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyServiceImpl.kt index f37461b2..9fb7cd90 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CurrencyServiceImpl.kt @@ -27,6 +27,22 @@ import com.m3ter.models.CurrencyUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Currency operations such as creation, update, list, and delete. Currencies are + * stored for your Organization, and can then be used to specify currencies on various entities such + * as plan groups and plan templates. + * + * **IMPORTANT!** The Currencies you want to use in your Organization must be created first. + * + * The currency you select for your Organization determines the billing currency and overrides any + * currency settings in your pricing Plans. For example, if the Organization currency is set to USD + * and a pricing Plan used for an Account is set to GBP, the bill for an Account using that Plan is + * calculated in GBP, and then each bill line item converted to USD amounts. + * + * Currency conversion rates are setup in the *OrganizationConfig*. For more details, see + * [Creating and Managing Currencies](https://www.m3ter.com/docs/guides/organization-and-access-management/viewing-and-editing-organization#creating-and-managing-currencies) + * in the m3ter Documentation. + */ class CurrencyServiceImpl internal constructor(private val clientOptions: ClientOptions) : CurrencyService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldService.kt index 5858937d..0aeec38b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldService.kt @@ -11,6 +11,83 @@ import com.m3ter.models.CustomFieldUpdateParams import com.m3ter.models.CustomFieldsResponse import java.util.function.Consumer +/** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all entities + * that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of the + * m3ter platform. Having this capability to store data in a free-hand fashion can prove very useful + * in helping you to meet specific usage-based pricing and other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by referencing + * them in Derived Field and Compound Aggregation calculations. Given the key role these + * calculations can play when implementing usage-based pricing schema, any Custom Fields you + * reference will then affect how the platform behaves. Referencing Custom Field values in your + * calculations offers a much wider scope of options when it comes to resolving complex usage-based + * pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity request + * and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to also + * add a Custom Field of the same name at the corresponding individual entity level. If you + * reference the Custom Field in a calculation, the value for the individual entity level field is + * used. If no field is defined at individual entity level, then the Organization level field + * value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity level + * for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global Meters*, + * you can also reference Custom Fields added to a Product in Derived Field calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization level + * Meter Custom Field will always be used*, even if you have defined a corresponding field at the + * individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ interface CustomFieldService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldServiceImpl.kt index c5c9d540..30669554 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/CustomFieldServiceImpl.kt @@ -20,6 +20,83 @@ import com.m3ter.models.CustomFieldUpdateParams import com.m3ter.models.CustomFieldsResponse import java.util.function.Consumer +/** + * Endpoints for retrieving and updating Custom Fields at the Organization level for all entities + * that support them. + * + * Custom Fields in m3ter allow you to store custom data in the form of number or string values + * against m3ter entities in a way that does not directly affect the normal working operation of the + * m3ter platform. Having this capability to store data in a free-hand fashion can prove very useful + * in helping you to meet specific usage-based pricing and other operational business use cases. + * + * However, you can exploit the values stored on Custom Fields in a more direct way by referencing + * them in Derived Field and Compound Aggregation calculations. Given the key role these + * calculations can play when implementing usage-based pricing schema, any Custom Fields you + * reference will then affect how the platform behaves. Referencing Custom Field values in your + * calculations offers a much wider scope of options when it comes to resolving complex usage-based + * pricing use cases. + * + * Custom Fields can be added to the following entities at Organizational level: + * * Organization + * * Account + * * AccountPlan + * * Aggregation + * * Compound Aggregation + * * Meter + * * Product + * * Plan + * * PlanTemplate + * * Contract + * + * These all follow the same pattern - a new *(optional)* field is available on the entity request + * and response bodies called "customFields" which is a object in this format: + * ``` + * "customFields": { + * "exampleCustomField1": 7.1, + * "exampleCustomField2": "stringValue" + * } + * ``` + * + * The value for a Custom Field can be a string or a number. + * + * **Using Custom Field values in calculations:** + * - You can add Custom Fields at two levels - the Organization level and the individual entity + * level. + * - The Organizational level field provides a default value and *must be added* if you want to also + * add a Custom Field of the same name at the corresponding individual entity level. If you + * reference the Custom Field in a calculation, the value for the individual entity level field is + * used. If no field is defined at individual entity level, then the Organization level field + * value is used. + * + * **Important: Constraints and Exceptions!** + * + * **Custom Fields at Organization Level**. Currently, you cannot create Custom Fields at the + * Organization-level for the following enitites: + * * Plan Group + * * Balance + * * Balance Transaction Schedule + * * Balance Charge Schedule + * + * Therefore you cannot reference the Custom Fields values created at the individual entity level + * for these entities in your Derived Field or Compound Aggregation calculations. + * + * **Derived Field Calculations**. You can *only reference Custom Fields* for the following + * entities: + * * Organization + * * Meter + * * Account + * + * However, if you are using Meters belonging to *a specific Product*, that is, not *Global Meters*, + * you can also reference Custom Fields added to a Product in Derived Field calculations. + * + * **Compound Aggregation Calculations - Meter Custom Fields**. The value of the *Organization level + * Meter Custom Field will always be used*, even if you have defined a corresponding field at the + * individual Meter level. + * + * See + * [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) + * in the m3ter documentation for more information. + */ class CustomFieldServiceImpl internal constructor(private val clientOptions: ClientOptions) : CustomFieldService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportService.kt index bd1658cd..508aa8bb 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportService.kt @@ -6,13 +6,41 @@ import com.google.errorprone.annotations.MustBeClosed import com.m3ter.core.ClientOptions import com.m3ter.core.RequestOptions import com.m3ter.core.http.HttpResponseFor +import com.m3ter.models.AdHocOperationalDataRequest import com.m3ter.models.AdHocResponse +import com.m3ter.models.AdHocUsageDataRequest import com.m3ter.models.DataExportCreateAdhocParams import com.m3ter.services.blocking.dataExports.DestinationService import com.m3ter.services.blocking.dataExports.JobService import com.m3ter.services.blocking.dataExports.ScheduleService import java.util.function.Consumer +/** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports to + * export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export has + * been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface DataExportService { /** @@ -27,10 +55,63 @@ interface DataExportService { */ fun withOptions(modifier: Consumer): DataExportService + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through + * to the specified Destination. However, the export file is also made available for you to + * download it locally. You can set up and run Data Exports without defining a Destination. The + * data is not exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun destinations(): DestinationService fun jobs(): JobService + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set + * up an Export Schedule to export one of two types of data from your m3ter Organization - + * either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under + * a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun schedules(): ScheduleService /** @@ -85,6 +166,47 @@ interface DataExportService { requestOptions: RequestOptions = RequestOptions.none(), ): AdHocResponse + /** @see createAdhoc */ + fun createAdhoc( + body: DataExportCreateAdhocParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): AdHocResponse = + createAdhoc(DataExportCreateAdhocParams.builder().body(body).build(), requestOptions) + + /** @see createAdhoc */ + fun createAdhoc(body: DataExportCreateAdhocParams.Body): AdHocResponse = + createAdhoc(body, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): AdHocResponse = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocOperationalDataRequest( + adHocOperationalDataRequest + ), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc(adHocOperationalDataRequest: AdHocOperationalDataRequest): AdHocResponse = + createAdhoc(adHocOperationalDataRequest, RequestOptions.none()) + + /** @see createAdhoc */ + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): AdHocResponse = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocUsageDataRequest(adHocUsageDataRequest), + requestOptions, + ) + + /** @see createAdhoc */ + fun createAdhoc(adHocUsageDataRequest: AdHocUsageDataRequest): AdHocResponse = + createAdhoc(adHocUsageDataRequest, RequestOptions.none()) + /** A view of [DataExportService] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -97,10 +219,65 @@ interface DataExportService { modifier: Consumer ): DataExportService.WithRawResponse + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are + * available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent + * through to the specified Destination. However, the export file is also made available for + * you to download it locally. You can set up and run Data Exports without defining a + * Destination. The data is not exported but the compiled export file is made available for + * downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if + * Data Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun destinations(): DestinationService.WithRawResponse fun jobs(): JobService.WithRawResponse + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can + * set up an Export Schedule to export one of two types of data from your m3ter + * Organization - either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data + * under a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ fun schedules(): ScheduleService.WithRawResponse /** @@ -117,5 +294,56 @@ interface DataExportService { params: DataExportCreateAdhocParams, requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc( + body: DataExportCreateAdhocParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + createAdhoc(DataExportCreateAdhocParams.builder().body(body).build(), requestOptions) + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc(body: DataExportCreateAdhocParams.Body): HttpResponseFor = + createAdhoc(body, RequestOptions.none()) + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocOperationalDataRequest( + adHocOperationalDataRequest + ), + requestOptions, + ) + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc( + adHocOperationalDataRequest: AdHocOperationalDataRequest + ): HttpResponseFor = + createAdhoc(adHocOperationalDataRequest, RequestOptions.none()) + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + createAdhoc( + DataExportCreateAdhocParams.Body.ofAdHocUsageDataRequest(adHocUsageDataRequest), + requestOptions, + ) + + /** @see createAdhoc */ + @MustBeClosed + fun createAdhoc( + adHocUsageDataRequest: AdHocUsageDataRequest + ): HttpResponseFor = + createAdhoc(adHocUsageDataRequest, RequestOptions.none()) } } diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportServiceImpl.kt index 5fe4d005..bccf37e4 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DataExportServiceImpl.kt @@ -25,6 +25,32 @@ import com.m3ter.services.blocking.dataExports.ScheduleService import com.m3ter.services.blocking.dataExports.ScheduleServiceImpl import java.util.function.Consumer +/** + * Endpoints for triggering one-off, ad-hoc Data Exports. You can set up and run ad-hoc Exports to + * export two kinds of data from your m3ter Organization: + * * Usage data. + * * Operational data for entities. + * + * **Ad-Hoc Export Destinations** When setting up and running an ad-hoc Export: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportAdHoc endpoints will only be available if Data Export has + * been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class DataExportServiceImpl internal constructor(private val clientOptions: ClientOptions) : DataExportService { @@ -43,10 +69,63 @@ class DataExportServiceImpl internal constructor(private val clientOptions: Clie override fun withOptions(modifier: Consumer): DataExportService = DataExportServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through + * to the specified Destination. However, the export file is also made available for you to + * download it locally. You can set up and run Data Exports without defining a Destination. The + * data is not exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun destinations(): DestinationService = destinations override fun jobs(): JobService = jobs + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set + * up an Export Schedule to export one of two types of data from your m3ter Organization - + * either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under + * a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this + * API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun schedules(): ScheduleService = schedules override fun createAdhoc( @@ -81,10 +160,65 @@ class DataExportServiceImpl internal constructor(private val clientOptions: Clie clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are + * available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent + * through to the specified Destination. However, the export file is also made available for + * you to download it locally. You can set up and run Data Exports without defining a + * Destination. The data is not exported but the compiled export file is made available for + * downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if + * Data Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun destinations(): DestinationService.WithRawResponse = destinations override fun jobs(): JobService.WithRawResponse = jobs + /** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can + * set up an Export Schedule to export one of two types of data from your m3ter + * Organization - either *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data + * under a single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of + * this API Reference. When the export runs, the data is sent through to the sepecified + * Destination. However, the export file is also made available for you to download it + * locally. + * * You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview + * release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data + * Export has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in + * touch with m3ter Support or your m3ter contact. + */ override fun schedules(): ScheduleService.WithRawResponse = schedules private val createAdhocHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonService.kt index 396c6f04..c5d5fe67 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonService.kt @@ -15,6 +15,13 @@ import com.m3ter.models.DebitReasonRetrieveParams import com.m3ter.models.DebitReasonUpdateParams import java.util.function.Consumer +/** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit line + * item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ interface DebitReasonService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonServiceImpl.kt index 5da03974..bb4b4466 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/DebitReasonServiceImpl.kt @@ -27,6 +27,13 @@ import com.m3ter.models.DebitReasonUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for DebitReason operations such as creation, update, list, and delete. + * + * You can create DebitReasons for your Organization, and then use them when creating a debit line + * item on a bill, or applying a product debit to a bill. DebitReasons provide contextual + * information as to why a debit was applied. + */ class DebitReasonServiceImpl internal constructor(private val clientOptions: ClientOptions) : DebitReasonService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventService.kt index cefbc359..bc6f0de9 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventService.kt @@ -16,6 +16,78 @@ import com.m3ter.models.EventResponse import com.m3ter.models.EventRetrieveParams import java.util.function.Consumer +/** + * This section provides Endpoints for operations that allow you to retrieve detailed information + * about individual Events, list all Events or specific Event Types, and explore dynamic fields + * available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation of a + * new Prepayment/Commitment for an Account. Each Event is classified under an Event Type framework, + * providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated for + * a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a state + * change at creation, update, or deletion of the entity, you can use API calls to create and + * configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, which you + * can set up by referencing Date/Time fields on configuration and billing entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent out + * via webhooks when the Event occurs and any conditions you've built into the Notification rule's + * calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by the + * Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ interface EventService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventServiceImpl.kt index a2d2d7b8..de4e1bd0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/EventServiceImpl.kt @@ -27,6 +27,78 @@ import com.m3ter.models.EventRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * This section provides Endpoints for operations that allow you to retrieve detailed information + * about individual Events, list all Events or specific Event Types, and explore dynamic fields + * available for each Event Type. + * + * Events encompass specific instances of state changes within the system, such as the creation of a + * new Prepayment/Commitment for an Account. Each Event is classified under an Event Type framework, + * providing context about what kind of change occurred to generate the Event. + * + * **Events for Configuration and Billing Entities** + * + * Many Event Types cover common configuration and billing objects, where the Event is generated for + * a state change of one of these objects - for when the configuration or billing object is + * **created**, **deleted**, or **updated**. + * + * For example: + * * configuration.commitment.created + * * configuration.commitment.deleted + * * configuration.commitment.updated + * * configuration.account.created + * * configuration.account.deleted + * * configuration.account.updated + * * billing.bill.created + * * billing.bill.deleted + * * billing.bill.created + * + * **Events for Errors or Failures** + * + * There are also Event Types for certain kinds of error that can occur: + * * For an Integration: + * * validation + * * authentication + * * perform + * * missing account mapping + * * disabled + * * For a Usage Data Ingest Submission: + * * validation failure + * * For Data Export Jobs: + * * data export job failure + * + * **Scheduled Events** + * + * In addition to system-generated Events that occur when a configuration entity undergoes a state + * change at creation, update, or deletion of the entity, you can use API calls to create and + * configure *Scheduled Event Configurations*. Scheduled Events are custom Event types, which you + * can set up by referencing Date/Time fields on configuration and billing entities. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference for more details. + * + * **Notifications for Events** + * + * You can create Notification rules based on Events and these rules can reference and apply + * calculations to the Event's fields. This allows you to set up customized alerts to be sent out + * via webhooks when the Event occurs and any conditions you've built into the Notification rule's + * calculation are satisfied. + * + * See the [Notifications](https://www.m3ter.com/docs/api#tag/Notifications) section for more + * details. + * + * **Other Events** + * + * When Events occur, they can cause other Events, such as when a Notification is triggered by the + * Event it is based on. For these Events there are currently two categories: + * * Notification + * * IntegrationEvent + * + * Also see + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * and + * [Object Definitions and API Calls](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/object-definitions-and-api-calls) + * in the m3ter documentation for more guidance. + */ class EventServiceImpl internal constructor(private val clientOptions: ClientOptions) : EventService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingService.kt index 8668d0e3..79eb920f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingService.kt @@ -19,6 +19,19 @@ import com.m3ter.models.ExternalMappingRetrieveParams import com.m3ter.models.ExternalMappingUpdateParams import java.util.function.Consumer +/** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities in + * the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the local + * system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at a + * later date, edit or delete them. + */ interface ExternalMappingService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingServiceImpl.kt index ccc9e1a1..c8df3e0e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ExternalMappingServiceImpl.kt @@ -33,6 +33,19 @@ import com.m3ter.models.ExternalMappingUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for managing External Mapping related operations such as creation, update, list and + * delete. + * + * When you integrate your 3rd-party systems with the m3ter platform, a mapping between entities in + * the local system *(m3ter)* and external systems is constructed. This *External Mapping* is + * crucial in scenarios where data from external systems is consumed or where data from the local + * system is to be synchronized with external systems. + * + * When you are working to set up your Integrations and want to test or troubleshoot your + * implementation before going live, you might need to create External Mappings manually and, at a + * later date, edit or delete them. + */ class ExternalMappingServiceImpl internal constructor(private val clientOptions: ClientOptions) : ExternalMappingService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationService.kt index 1b869162..d2fbda98 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationService.kt @@ -21,6 +21,25 @@ import com.m3ter.models.IntegrationConfigurationUpdateParams import com.m3ter.models.IntegrationConfigurationUpdateResponse import java.util.function.Consumer +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ interface IntegrationConfigurationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationServiceImpl.kt index 1470876f..426cb479 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/IntegrationConfigurationServiceImpl.kt @@ -33,6 +33,25 @@ import com.m3ter.models.IntegrationConfigurationUpdateResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ class IntegrationConfigurationServiceImpl internal constructor(private val clientOptions: ClientOptions) : IntegrationConfigurationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableService.kt index 35ff52b4..7df37525 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableService.kt @@ -18,6 +18,20 @@ import com.m3ter.services.blocking.lookupTables.LookupTableRevisionDataService import com.m3ter.services.blocking.lookupTables.LookupTableRevisionService import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. Use + * them for currency conversion, pricing tiers, discount rates, and similar scenarios where you + * require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables have + * been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableService { /** @@ -32,8 +46,53 @@ interface LookupTableService { */ fun withOptions(modifier: Consumer): LookupTableService + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisions(): LookupTableRevisionService + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionData(): LookupTableRevisionDataService /** Create a new Lookup Table. */ @@ -177,8 +236,54 @@ interface LookupTableService { modifier: Consumer ): LookupTableService.WithRawResponse + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, + * and extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations + * that reference the Lookup Table, the data values defined for the published Revision are + * used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisions(): LookupTableRevisionService.WithRawResponse + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionData(): LookupTableRevisionDataService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableServiceImpl.kt index 1768eb63..6f7d24f0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/LookupTableServiceImpl.kt @@ -31,6 +31,20 @@ import com.m3ter.services.blocking.lookupTables.LookupTableRevisionServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Lookup Tables. + * + * Lookup Tables enable you to manage dynamic data mappings that your calculations reference. Use + * them for currency conversion, pricing tiers, discount rates, and similar scenarios where you + * require values to change operationally but for calculation logic to remain constant. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table endpoints will only be available if Lookup Tables have + * been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableServiceImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableService { @@ -51,8 +65,53 @@ class LookupTableServiceImpl internal constructor(private val clientOptions: Cli override fun withOptions(modifier: Consumer): LookupTableService = LookupTableServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisions(): LookupTableRevisionService = lookupTableRevisions + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionData(): LookupTableRevisionDataService = lookupTableRevisionData override fun create( @@ -112,9 +171,55 @@ class LookupTableServiceImpl internal constructor(private val clientOptions: Cli clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, + * and extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup + * keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft + * Revisions, but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations + * that reference the Lookup Table, the data values defined for the published Revision are + * used. + * * When you want different, updated data values to be used, publish the draft Revision + * containing the required new values. The currently published Revision is archived + * automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisions(): LookupTableRevisionService.WithRawResponse = lookupTableRevisions + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionData(): LookupTableRevisionDataService.WithRawResponse = lookupTableRevisionData diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterService.kt index 053bd2cb..bd0da599 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterService.kt @@ -15,6 +15,42 @@ import com.m3ter.models.MeterRetrieveParams import com.m3ter.models.MeterUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect usage + * data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that any fields you configure for Meters, such as Data Fields or Derived Fields, do not contain + * any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ interface MeterService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterServiceImpl.kt index 7fdbeac7..659ef011 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/MeterServiceImpl.kt @@ -27,6 +27,42 @@ import com.m3ter.models.MeterUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Meters. + * + * Use Meters to submit usage data for the consumption of your products and services by end + * customers. This usage data then becomes the basis for setting up usage-based pricing for your + * products and services. + * + * Examples of usage data collected in Meters: + * * Number of logins. + * * Duration of session. + * * Amount of data downloaded. + * + * To collect usage data and ingest it into the platform, you can define two types of fields for + * Meters: + * - `dataFields` Used to collect raw usage data measures - numeric quantitative data values or + * non-numeric point data values. + * - `derivedFields` Used to derive usage data measures that are the result of applying a + * calculation to `dataFields`, `customFields`, or system `Timestamp` fields. + * + * You can also: + * - Create `customFields` for a Meter, which allows you to attach custom data to the Meter as + * name/value pairs. + * - Create Global Meters, which are not tied to a specific Product and allow you to collect usage + * data that will form the basis of usage-based pricing across multiple Products. + * + * **IMPORTANT! - use of PII:** The use of any of your end-customers' Personally Identifiable + * Information (PII) in m3ter is restricted to a few fields on the **Account** entity. Please ensure + * that any fields you configure for Meters, such as Data Fields or Derived Fields, do not contain + * any end-customer PII data. See the + * [Introduction section](https://www.m3ter.com/docs/api#section/Introduction) above for more + * details. + * + * See also: + * - [Reviewing Meter + * Options](https://www.m3ter.com/docs/guides/setting-up-usage-data-meters-and-aggregations/reviewing-meter-options). + */ class MeterServiceImpl internal constructor(private val clientOptions: ClientOptions) : MeterService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationService.kt index a3a9449b..5b0ed90e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationService.kt @@ -15,6 +15,32 @@ import com.m3ter.models.NotificationConfigurationRetrieveParams import com.m3ter.models.NotificationConfigurationUpdateParams import java.util.function.Consumer +/** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base a + * Notification on a specific Event type, you can include a calculation that references the fields + * available on that Event type to define precise conditions that must be met for the Notification + * to be triggered when an Event of that type occurs. In this way, you can set up highly customized + * Notifications that act as timely alerts to inform you about significant occurrences within your + * Organization. For instance, if you provide a sign-up bonus to new end-customer Accounts, you can + * set up a Notification to alert you when an end-customer Account has used up a certain percentage + * of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ interface NotificationConfigurationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationServiceImpl.kt index c0815987..35cb9156 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/NotificationConfigurationServiceImpl.kt @@ -27,6 +27,32 @@ import com.m3ter.models.NotificationConfigurationUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * This section provides endpoints for managing Event Notifications. + * + * You can create Notifications based on system Events generated by the platform. When you base a + * Notification on a specific Event type, you can include a calculation that references the fields + * available on that Event type to define precise conditions that must be met for the Notification + * to be triggered when an Event of that type occurs. In this way, you can set up highly customized + * Notifications that act as timely alerts to inform you about significant occurrences within your + * Organization. For instance, if you provide a sign-up bonus to new end-customer Accounts, you can + * set up a Notification to alert you when an end-customer Account has used up a certain percentage + * of their bonus credit. + * + * You can also set up Notifications based on Scheduled Event types you've created for your + * Organization. See the + * [ScheduledEventConfigurations](https://www.m3ter.com/docs/api#tag/ScheduledEventConfigurations) + * section of this API Reference and + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our user documentation. + * + * For more details on Event types and their fields, see the + * [Events](https://www.m3ter.com/docs/api#tag/Events) section. + * + * For detailed guidance on working with Events and Notifications, refer to the + * [Utilizing Events and Notifications](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications) + * section of the m3ter user documentation. + */ class NotificationConfigurationServiceImpl internal constructor(private val clientOptions: ClientOptions) : NotificationConfigurationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigService.kt index a0ed9103..0152ca8b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigService.kt @@ -12,6 +12,30 @@ import com.m3ter.models.OrganizationConfigRetrieveParams import com.m3ter.models.OrganizationConfigUpdateParams import java.util.function.Consumer +/** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ interface OrganizationConfigService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigServiceImpl.kt index 58593f53..85db4fee 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/OrganizationConfigServiceImpl.kt @@ -20,6 +20,30 @@ import com.m3ter.models.OrganizationConfigRetrieveParams import com.m3ter.models.OrganizationConfigUpdateParams import java.util.function.Consumer +/** + * Endpoints for retrieving or updating the Organization Config. + * + * Organization represents your company as a direct customer of m3ter. Use Organization + * configuration to define *Organization-wide* settings. For example: + * - Timezone. + * - Currencies and currency conversions. + * - Billing operations settings, such as: + * - Epoch dates to control first billing dates. + * - Whether to bill customer accounts in advance/in arrears for standing charge amounts, + * minimum spend amounts, and commitment fees. + * + * For other aspects of your Organization setup and configuration, see the following sections in + * this API Reference: + * * [Custom Fields](https://www.m3ter.com/docs/api#tag/CustomField) + * * [Currencies](https://www.m3ter.com/docs/api#tag/Currency) + * * [Credit Reasons](https://www.m3ter.com/docs/api#tag/CreditReason) + * * [Debit Reason](https://www.m3ter.com/docs/api#tag/DebitReason) + * * [Transaction Types](https://www.m3ter.com/docs/api#tag/TransactionType) + * + * See also: + * - [Managing your + * Organization](https://www.m3ter.com/docs/guides/managing-organization-and-users/viewing-and-editing-organization). + */ class OrganizationConfigServiceImpl internal constructor(private val clientOptions: ClientOptions) : OrganizationConfigService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyService.kt index 1eb7e553..0a3a1a86 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyService.kt @@ -31,6 +31,17 @@ import com.m3ter.models.PermissionPolicyRetrieveParams import com.m3ter.models.PermissionPolicyUpdateParams import java.util.function.Consumer +/** + * Endpoints for Permission Policy related operations such as creation, update, add and retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users *(people)* + * and Service Users *(automated processes with direct API access)*. This enables you to control + * precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ interface PermissionPolicyService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyServiceImpl.kt index 55c7458c..bdff24d1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PermissionPolicyServiceImpl.kt @@ -43,6 +43,17 @@ import com.m3ter.models.PermissionPolicyUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Permission Policy related operations such as creation, update, add and retrieve. + * + * Permission Policies can restrict or grant access to specific resources for both Users *(people)* + * and Service Users *(automated processes with direct API access)*. This enables you to control + * precisely what a User can do in your m3ter Organization. + * + * For more details, see + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/organization-and-access-management/creating-and-managing-permissions#permission-policy-statements---available-actions-and-resources) + * in our main Documentation. + */ class PermissionPolicyServiceImpl internal constructor(private val clientOptions: ClientOptions) : PermissionPolicyService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkService.kt index b5fd0dd4..a6b409d1 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkService.kt @@ -15,6 +15,12 @@ import com.m3ter.models.PlanGroupLinkRetrieveParams import com.m3ter.models.PlanGroupLinkUpdateParams import java.util.function.Consumer +/** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ interface PlanGroupLinkService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkServiceImpl.kt index 88e2242e..f5ce0b65 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupLinkServiceImpl.kt @@ -27,6 +27,12 @@ import com.m3ter.models.PlanGroupLinkUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for PlanGroupLink related operations such as creation, update, list and delete. + * + * PlanGroupLinks are the intersection table between a PlanGroup and its associated Plans. A + * PlanGroupLink is only created when at least 1 Plan is linked to a PlanGroup. + */ class PlanGroupLinkServiceImpl internal constructor(private val clientOptions: ClientOptions) : PlanGroupLinkService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupService.kt index 8cebc01d..400c8a65 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupService.kt @@ -15,6 +15,14 @@ import com.m3ter.models.PlanGroupRetrieveParams import com.m3ter.models.PlanGroupUpdateParams import java.util.function.Consumer +/** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach to + * efficiently handle various uses cases across different plans. For example applying a minimum + * spend amount at billing, across several of your products or features that are each priced + * separately. + */ interface PlanGroupService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupServiceImpl.kt index c2e31d41..30336472 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanGroupServiceImpl.kt @@ -27,6 +27,14 @@ import com.m3ter.models.PlanGroupUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for PlanGroup related operations such as creation, update, retrieve, list and delete. + * + * PlanGroups are constructs that group multiple plans together. This enables a unified approach to + * efficiently handle various uses cases across different plans. For example applying a minimum + * spend amount at billing, across several of your products or features that are each priced + * separately. + */ class PlanGroupServiceImpl internal constructor(private val clientOptions: ClientOptions) : PlanGroupService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanService.kt index 01738b2f..aedd638c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanService.kt @@ -15,6 +15,25 @@ import com.m3ter.models.PlanRetrieveParams import com.m3ter.models.PlanUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your products + * or services. Each Plan inherits general billing attributes or pricing structure from its parent + * Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can configure + * the exact pricing structures for Plans to charge customers that consume one or more of your + * Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ interface PlanService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanServiceImpl.kt index 4c6c1e81..ec6c0daa 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanServiceImpl.kt @@ -27,6 +27,25 @@ import com.m3ter.models.PlanUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Plans. + * + * A Plan is based on a PlanTemplate and represents a specific pricing plan for one of your products + * or services. Each Plan inherits general billing attributes or pricing structure from its parent + * Plan Template. Some attributes can be overriden for the specific Plan. + * + * When you've created the Plan Templates and Plans you need for your Products, you can configure + * the exact pricing structures for Plans to charge customers that consume one or more of your + * Products. + * + * You can then attach the appropriately priced Plans to customer Accounts to create + * [Account Plans](https://www.m3ter.com/docs/api#tag/AccountPlan) and enable charges to be + * calculated correctly for billing against those Accounts. + * + * See also: + * - [Reviewing Options for Plans and Plan + * Templates](https://www.m3ter.com/docs/guides/working-with-plan-templates-and-plans/reviewing-configuration-options-for-plans-and-plan-templates). + */ class PlanServiceImpl internal constructor(private val clientOptions: ClientOptions) : PlanService { private val withRawResponse: PlanService.WithRawResponse by lazy { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateService.kt index 3a3556d1..64235554 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateService.kt @@ -15,6 +15,16 @@ import com.m3ter.models.PlanTemplateRetrieveParams import com.m3ter.models.PlanTemplateUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the billing + * operations you want applied to your products. PlanTemplates avoid repetition in configuration + * work - many Plans will share settings for billing operations and differ only in the details of + * their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ interface PlanTemplateService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateServiceImpl.kt index 46dd029d..f2e2f82b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PlanTemplateServiceImpl.kt @@ -27,6 +27,16 @@ import com.m3ter.models.PlanTemplateUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting PlanTemplates. + * + * Use PlanTemplates to define default values for Plans. These default values control the billing + * operations you want applied to your products. PlanTemplates avoid repetition in configuration + * work - many Plans will share settings for billing operations and differ only in the details of + * their pricing structures. + * + * A PlanTemplate is linked to a Product, and each Plan is a child of a PlanTemplate. + */ class PlanTemplateServiceImpl internal constructor(private val clientOptions: ClientOptions) : PlanTemplateService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingService.kt index 85495365..7b8ee42a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingService.kt @@ -15,6 +15,16 @@ import com.m3ter.models.PricingRetrieveParams import com.m3ter.models.PricingUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a usage-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ interface PricingService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingServiceImpl.kt index 4de443b9..404a2718 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/PricingServiceImpl.kt @@ -27,6 +27,16 @@ import com.m3ter.models.PricingUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Pricing. + * + * Create the Pricing for a Plan/PlanTemplate with usage data Aggregations, and define a usage-based + * pricing structure for charging end customer Accounts put on the Plan. + * + * See + * [Reviewing Pricing Options for Plans and Plan Templates](https://www.m3ter.com/docs/guides/pricing-plans/reviewing-pricing-options-and-pricing-plans) + * for more information. + */ class PricingServiceImpl internal constructor(private val clientOptions: ClientOptions) : PricingService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductService.kt index c2569086..9d69a40c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductService.kt @@ -15,6 +15,13 @@ import com.m3ter.models.ProductRetrieveParams import com.m3ter.models.ProductUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act as a + * container for the Meters, Aggregations, Pricing, and Plans required to implement usage-based and + * other pricing models for your Organization. + */ interface ProductService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductServiceImpl.kt index 65739c26..6e24b48b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ProductServiceImpl.kt @@ -27,6 +27,13 @@ import com.m3ter.models.ProductUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Products. + * + * A Product represents the products and services you offer to your end customers. Products act as a + * container for the Meters, Aggregations, Pricing, and Plans required to implement usage-based and + * other pricing models for your Organization. + */ class ProductServiceImpl internal constructor(private val clientOptions: ClientOptions) : ProductService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupService.kt index 33b98c94..92eac9dd 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupService.kt @@ -21,6 +21,46 @@ import com.m3ter.models.ResourceGroupRetrieveParams import com.m3ter.models.ResourceGroupUpdateParams import java.util.function.Consumer +/** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who has + * been given access to your Organization can and cannot do. For example, you might want to create a + * Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural functional + * grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned to + * Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is useful + * for cases where you want to create Permission Policies which allow or deny access to a specific + * subset of resources. For example, grant a user access to only some of the Plans in your + * Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including ResourceGroups + * themselves. This allows you to nest ResourceGroups to support hierarchies of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of type = + * `user`. You can then retrieve a list of the User Resource Groups a user belongs to. For more + * details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ interface ResourceGroupService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupServiceImpl.kt index aefb7a3a..f88c4160 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ResourceGroupServiceImpl.kt @@ -35,6 +35,46 @@ import com.m3ter.models.ResourceGroupUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for ResourceGroup related operations such as creation, update, list and delete. + * + * ResourceGroups are used in the context of Permission Policies, which controls what a User who has + * been given access to your Organization can and cannot do. For example, you might want to create a + * Permissions Policy that denies Users the ability to retrieve Meters. + * + * Resources are defined as m3ter Resource Identifiers *(MRIs)* in the format: + * ``` + * service:resource-type/item-type/id + * ``` + * + * Where: + * * service is a distinct part of the overall m3ter system, and which forms a natural functional + * grouping, such as "config" or "billing". + * * resource-type is the resource type item accessed - for example: "Plan", "Meter", "Bill" + * * item-type is one of: + * * "item" - to specify an individual item. + * * "group" - to specify a resource group. + * * id is the resource group id or the resource item id + * + * Resources can be assigned to one or more ResourceGroups. For example, a Plan can be assigned to + * Plan ResourceGroups, a Meter can be assigned to Meter ResourceGroups, and so on. This is useful + * for cases where you want to create Permission Policies which allow or deny access to a specific + * subset of resources. For example, grant a user access to only some of the Plans in your + * Organization. + * + * This concept of grouping resources applies to every resource in m3ter, including ResourceGroups + * themselves. This allows you to nest ResourceGroups to support hierarchies of groups. + * + * See + * [Understanding, Creating, and Managing Permission Policies](https://www.m3ter.com/docs/guides/managing-organization-and-users/creating-and-managing-permissions) + * in the m3ter documentation for more information. + * + * **Note: User Resource Groups** You can create a User Resource Group to group resources of type = + * `user`. You can then retrieve a list of the User Resource Groups a user belongs to. For more + * details, see the + * [Retrieve OrgUser Groups](https://www.m3ter.com/docs/api#tag/OrgUsers/operation/GetOrgUserGroups) + * call in the OrgUsers section. + */ class ResourceGroupServiceImpl internal constructor(private val clientOptions: ClientOptions) : ResourceGroupService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationService.kt index a4264be2..bd8edc62 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationService.kt @@ -15,6 +15,18 @@ import com.m3ter.models.ScheduledEventConfigurationRetrieveParams import com.m3ter.models.ScheduledEventConfigurationUpdateParams import java.util.function.Consumer +/** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra degree + * of flexibility over and above system-generated Events for setting up Notifications based on + * Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ interface ScheduledEventConfigurationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationServiceImpl.kt index ef408859..74297140 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/ScheduledEventConfigurationServiceImpl.kt @@ -27,6 +27,18 @@ import com.m3ter.models.ScheduledEventConfigurationUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for retrieving and managing scheduled Events' configurations. + * + * Scheduled Event Configurations define custom Event types that reference Date/Time fields + * belonging to configuration and billing entities. They therefore provide you with an extra degree + * of flexibility over and above system-generated Events for setting up Notifications based on + * Events. + * + * For more details, see the + * [Working with Scheduled Events](https://www.m3ter.com/docs/guides/alerts-events-and-notifications/utilizing-events-and-notifications/working-with-scheduled-events) + * in our Documenation. + */ class ScheduledEventConfigurationServiceImpl internal constructor(private val clientOptions: ClientOptions) : ScheduledEventConfigurationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementService.kt index 19612374..0d5d21f5 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementService.kt @@ -14,6 +14,15 @@ import com.m3ter.services.blocking.statements.StatementDefinitionService import com.m3ter.services.blocking.statements.StatementJobService import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface StatementService { /** @@ -28,8 +37,28 @@ interface StatementService { */ fun withOptions(modifier: Consumer): StatementService + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + */ fun statementJobs(): StatementJobService + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ fun statementDefinitions(): StatementDefinitionService /** @@ -160,8 +189,29 @@ interface StatementService { */ fun withOptions(modifier: Consumer): StatementService.WithRawResponse + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + */ fun statementJobs(): StatementJobService.WithRawResponse + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown + * the usage responsible for the monthly charge on a Bill into weekly portions in Bill + * statements. + */ fun statementDefinitions(): StatementDefinitionService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementServiceImpl.kt index 515b5d39..0162ad05 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/StatementServiceImpl.kt @@ -27,6 +27,15 @@ import com.m3ter.services.blocking.statements.StatementJobServiceImpl import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class StatementServiceImpl internal constructor(private val clientOptions: ClientOptions) : StatementService { @@ -47,8 +56,28 @@ class StatementServiceImpl internal constructor(private val clientOptions: Clien override fun withOptions(modifier: Consumer): StatementService = StatementServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + */ override fun statementJobs(): StatementJobService = statementJobs + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the + * usage charges that appear on the bill, helping your end customers better understand those + * charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ override fun statementDefinitions(): StatementDefinitionService = statementDefinitions override fun createCsv( @@ -93,8 +122,29 @@ class StatementServiceImpl internal constructor(private val clientOptions: Clien clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + */ override fun statementJobs(): StatementJobService.WithRawResponse = statementJobs + /** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of + * the usage charges that appear on the bill, helping your end customers better understand + * those charges, and gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown + * the usage responsible for the monthly charge on a Bill into weekly portions in Bill + * statements. + */ override fun statementDefinitions(): StatementDefinitionService.WithRawResponse = statementDefinitions diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeService.kt index c8c27656..b0d72f51 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeService.kt @@ -15,6 +15,18 @@ import com.m3ter.models.TransactionTypeRetrieveParams import com.m3ter.models.TransactionTypeUpdateParams import java.util.function.Consumer +/** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating and + * updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've created + * for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ interface TransactionTypeService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeServiceImpl.kt index 1ecd3d74..22ba4250 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/TransactionTypeServiceImpl.kt @@ -27,6 +27,18 @@ import com.m3ter.models.TransactionTypeUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for TransactionType operations such as creation, update, list, retrieve, and delete. + * + * You can create TransactionTypes for your Organization, which can then be used when creating and + * updating Balances. Example TransactionTypes: "Balance Amount" or "Add Funds". + * + * For details on creating a Transaction amount for a Balance using a TransactionType you've created + * for your Organization, see the + * [Create Balance Transaction](https://www.m3ter.com/docs/api#tag/Balances/operation/PostBalanceTransaction) + * call in the [Balances](https://www.m3ter.com/docs/api#tag/Balances) section of this API + * Reference. + */ class TransactionTypeServiceImpl internal constructor(private val clientOptions: ClientOptions) : TransactionTypeService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageService.kt index f677a4b9..f3e81981 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageService.kt @@ -30,6 +30,34 @@ interface UsageService { */ fun withOptions(modifier: Consumer): UsageService + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun fileUploads(): FileUploadService /** @@ -177,6 +205,34 @@ interface UsageService { */ fun withOptions(modifier: Consumer): UsageService.WithRawResponse + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun fileUploads(): FileUploadService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageServiceImpl.kt index 5eaa0b15..1e6e6013 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UsageServiceImpl.kt @@ -39,6 +39,34 @@ class UsageServiceImpl internal constructor(private val clientOptions: ClientOpt override fun withOptions(modifier: Consumer): UsageService = UsageServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun fileUploads(): FileUploadService = fileUploads override fun getFailedIngestDownloadUrl( @@ -79,6 +107,34 @@ class UsageServiceImpl internal constructor(private val clientOptions: ClientOpt clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun fileUploads(): FileUploadService.WithRawResponse = fileUploads private val getFailedIngestDownloadUrlHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserService.kt index 122b8bb2..65d186a3 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserService.kt @@ -36,6 +36,27 @@ interface UserService { */ fun withOptions(modifier: Consumer): UserService + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept + * the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and + * use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ fun invitations(): InvitationService /** @@ -271,6 +292,27 @@ interface UserService { */ fun withOptions(modifier: Consumer): UserService.WithRawResponse + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up + * an invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they + * accept the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link + * and use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be + * invited to create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ fun invitations(): InvitationService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserServiceImpl.kt index 463c5880..7b806581 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/UserServiceImpl.kt @@ -48,6 +48,27 @@ class UserServiceImpl internal constructor(private val clientOptions: ClientOpti override fun withOptions(modifier: Consumer): UserService = UserServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept + * the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and + * use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ override fun invitations(): InvitationService = invitations override fun retrieve( @@ -105,6 +126,27 @@ class UserServiceImpl internal constructor(private val clientOptions: ClientOpti clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other + * people to join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up + * an invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they + * accept the invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link + * and use their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be + * invited to create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ override fun invitations(): InvitationService.WithRawResponse = invitations private val retrieveHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookService.kt index 9f1effdc..3e29115d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookService.kt @@ -16,6 +16,25 @@ import com.m3ter.models.WebhookSetActiveParams import com.m3ter.models.WebhookUpdateParams import java.util.function.Consumer +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ interface WebhookService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookServiceImpl.kt index bfee23e1..15a63ce0 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/WebhookServiceImpl.kt @@ -28,6 +28,25 @@ import com.m3ter.models.WebhookUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * A suite of endpoints for configuring and managing third party integrations within the m3ter + * platform. The integration endpoints in this section facilitate various operations such as + * creating, updating, listing, and deletion of integrations. + * + * m3ter integrations enable seamless data synchronization and mapping with external systems + * required in core business processes. These processes often include sales, pricing, billing and + * invoicing, and general finance. + * + * With m3ter integrations, you can establish robust connections with popular business platforms, + * enhancing your operational capabilities. For example: + * * Chargebee + * * Salesforce + * * Stripe + * * Netsuite + * * Paddle + * * Xero + * * QuickBooks + */ class WebhookServiceImpl internal constructor(private val clientOptions: ClientOptions) : WebhookService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleService.kt index 02fefa50..0d44212f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleService.kt @@ -20,6 +20,13 @@ import com.m3ter.models.BalanceChargeScheduleUpdateParams import com.m3ter.models.BalanceChargeScheduleUpdateResponse import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ interface ChargeScheduleService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleServiceImpl.kt index a57fae6d..c561540e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/ChargeScheduleServiceImpl.kt @@ -32,6 +32,13 @@ import com.m3ter.models.BalanceChargeScheduleUpdateResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting BalanceChargeSchedules. + * + * **NOTE!** The BalanceChargeSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ class ChargeScheduleServiceImpl internal constructor(private val clientOptions: ClientOptions) : ChargeScheduleService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleService.kt index 6b858a39..dfafee99 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleService.kt @@ -16,6 +16,13 @@ import com.m3ter.models.BalanceTransactionScheduleUpdateParams import com.m3ter.models.ScheduleResponse import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ interface TransactionScheduleService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleServiceImpl.kt index 768f7158..970aff00 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionScheduleServiceImpl.kt @@ -28,6 +28,13 @@ import com.m3ter.models.ScheduleResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting BalanceTransactionSchedules. + * + * **NOTE!** The BalanceTransactionSchedule feature is available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. + */ class TransactionScheduleServiceImpl internal constructor(private val clientOptions: ClientOptions) : TransactionScheduleService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionService.kt index bfe2f21a..cac4f88b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionService.kt @@ -14,6 +14,54 @@ import com.m3ter.models.BalanceTransactionSummaryResponse import com.m3ter.models.TransactionResponse import java.util.function.Consumer +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ interface TransactionService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionServiceImpl.kt index 5dc4bc9f..a565f459 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/balances/TransactionServiceImpl.kt @@ -26,6 +26,54 @@ import com.m3ter.models.TransactionResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/retrieving/updating/deleting Balances on Accounts. + * + * When you have created a Balance for an Account, you can create a positive or negative Transaction + * amounts for the Balance. To do this, you must first define Transaction Types for your + * Organization, and then use one of these Transaction Types when you add a specific Transaction to + * a Balance - see the + * [Create TransactionType](https://www.m3ter.com/docs/api#tag/TransactionType/operation/CreateTransactionType) + * call in the Transaction Type section in this API Reference for more details. + * + * Balances are typically used when a customer prepays an amount to add a credit to their Account, + * which can then be draw-down against charges due for product or service consumption. You can + * include options to top-up the original Balance. + * + * Examples of how Balances for end customer Accounts can be used: + * * Onboarding Balance/Free Trials. Offering an onboarding incentive to new customers as an initial + * free credit Balance on their Account. + * * Balance as initial commitment. Add a Balance amount to a new customer Account. This acts as an + * initial commitment, which allows them to use the service and gain an accurate insight into + * their usage level. + * * Managing Customer Satisfaction. Use Balance as credits that will be applied to subsequent Bills + * as compensation for acknowledged service delivery issues. + * * Facilitating Balance Adjustments: + * * Apply negative amounts to immediately write-off outstanding Balances. + * + * #### What is the difference between Balances and Commitments/Prepayments? + * + * To manage credit amounts for your end-customer Accounts, you can use Balances or + * Commitments/Prepayments. However, these two kinds of credits for Accounts serve different + * purposes. + * + * Commitments - also referred to as Prepayments - are used for amounts end-customers have agreed to + * pay for consuming your product or services across a full contract term. A customer might pay the + * entire or only part of the agreed amount upfront, but ***the commitment or prepayment amount is + * payable regardless of the actual usage by the customer of your service or product.*** + * + * In contrast, a Balance - often referred to as a Top-Up or Prepaid draw-down - is used when a + * customer wants to add a credit amount to their Account at any time during the service period or + * when you as service provider want to add a credit to a customer Account. This Balance credit can + * then be drawn-down against for billing the Account for usage, minimum spend, standing charges, or + * recurring charges due. Balances therefore serve payment use cases in a more flexible way, for + * example to be used for a "Free Credit" sign-up scheme you offer to encourage sales or to enhance + * customer satisfaction by adding credit to an Account to compensate for service delivery issues. + * + * You can use Commitments/Prepayments and Balances together on Account, and define at Organization + * or individual Account level the order in which any Balance/Commitment credit on an Account is + * drawn-down - Balance amounts first or Commitment/Prepayment amounts first. + */ class TransactionServiceImpl internal constructor(private val clientOptions: ClientOptions) : TransactionService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemService.kt index 9add43b7..ae5c912a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemService.kt @@ -15,6 +15,13 @@ import com.m3ter.models.BillCreditLineItemUpdateParams import com.m3ter.models.CreditLineItemResponse import java.util.function.Consumer +/** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items for + * Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ interface CreditLineItemService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemServiceImpl.kt index 413e24e4..7d9bfe27 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/CreditLineItemServiceImpl.kt @@ -27,6 +27,13 @@ import com.m3ter.models.CreditLineItemResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Credit line item related operations such as creation, update, list and delete. + * These are line items on Bills that are specifically related to Credits. + * + * You use the Credit Reasons created for your Organization when you create Credit line items for + * Bills. See [CreditReason](https://www.m3ter.com/docs/api#tag/CreditReason). + */ class CreditLineItemServiceImpl internal constructor(private val clientOptions: ClientOptions) : CreditLineItemService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemService.kt index e70fe435..13650d62 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemService.kt @@ -15,6 +15,14 @@ import com.m3ter.models.BillDebitLineItemUpdateParams import com.m3ter.models.DebitLineItemResponse import java.util.function.Consumer +/** + * Endpoints for Debit line item related operations such as creation, update, list and delete. These + * are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for calls + * you can use to create and manage Debit Reasons for your Organization. + */ interface DebitLineItemService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemServiceImpl.kt index 7fbfee29..082a23ec 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/DebitLineItemServiceImpl.kt @@ -27,6 +27,14 @@ import com.m3ter.models.DebitLineItemResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for Debit line item related operations such as creation, update, list and delete. These + * are line items on Bills that are specifically related to Debits. + * + * You use the Debit Reasons created for your Organization when you create Debit line items for + * Bills. See the [DebitReason](https://www.m3ter.com/docs/api#tag/DebitReason) section for calls + * you can use to create and manage Debit Reasons for your Organization. + */ class DebitLineItemServiceImpl internal constructor(private val clientOptions: ClientOptions) : DebitLineItemService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemService.kt index a1a85394..8ad5d8ed 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemService.kt @@ -12,6 +12,15 @@ import com.m3ter.models.BillLineItemRetrieveParams import com.m3ter.models.LineItemResponse import java.util.function.Consumer +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ interface LineItemService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemServiceImpl.kt index da8065d2..827e15d2 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/bills/LineItemServiceImpl.kt @@ -23,6 +23,15 @@ import com.m3ter.models.LineItemResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for billing operations such as creating, updating, listing,downloading, and deleting + * Bills. + * + * Bills are generated for an Account, and are calculated in accordance with the usage-based pricing + * Plans applied for the Products the Account consumes. These endpoints enable interaction with the + * billing system, allowing you to obtain billing details and insights into the consumption patterns + * and charges of your end-customer Accounts. + */ class LineItemServiceImpl internal constructor(private val clientOptions: ClientOptions) : LineItemService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationService.kt index 35918e7f..a902d326 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationService.kt @@ -10,14 +10,40 @@ import com.m3ter.models.DataExportDestinationCreateParams import com.m3ter.models.DataExportDestinationCreateResponse import com.m3ter.models.DataExportDestinationDeleteParams import com.m3ter.models.DataExportDestinationDeleteResponse +import com.m3ter.models.DataExportDestinationGoogleCloudStorageRequest import com.m3ter.models.DataExportDestinationListPage import com.m3ter.models.DataExportDestinationListParams import com.m3ter.models.DataExportDestinationRetrieveParams import com.m3ter.models.DataExportDestinationRetrieveResponse +import com.m3ter.models.DataExportDestinationS3Request import com.m3ter.models.DataExportDestinationUpdateParams import com.m3ter.models.DataExportDestinationUpdateResponse import java.util.function.Consumer +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through to + * the specified Destination. However, the export file is also made available for you to download it + * locally. You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface DestinationService { /** @@ -56,6 +82,55 @@ interface DestinationService { requestOptions: RequestOptions = RequestOptions.none(), ): DataExportDestinationCreateResponse + /** @see create */ + fun create( + body: DataExportDestinationCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportDestinationCreateResponse = + create(DataExportDestinationCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create(body: DataExportDestinationCreateParams.Body): DataExportDestinationCreateResponse = + create(body, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportDestinationCreateResponse = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationS3Request( + dataExportDestinationS3Request + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request + ): DataExportDestinationCreateResponse = + create(dataExportDestinationS3Request, RequestOptions.none()) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportDestinationCreateResponse = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationGoogleCloudStorageRequest( + dataExportDestinationGoogleCloudStorageRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest + ): DataExportDestinationCreateResponse = + create(dataExportDestinationGoogleCloudStorageRequest, RequestOptions.none()) + /** Retrieve an Export Destination for the given UUID. */ fun retrieve(id: String): DataExportDestinationRetrieveResponse = retrieve(id, DataExportDestinationRetrieveParams.none()) @@ -220,6 +295,64 @@ interface DestinationService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** @see create */ + @MustBeClosed + fun create( + body: DataExportDestinationCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create(DataExportDestinationCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + @MustBeClosed + fun create( + body: DataExportDestinationCreateParams.Body + ): HttpResponseFor = + create(body, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create( + DataExportDestinationCreateParams.Body.ofDataExportDestinationS3Request( + dataExportDestinationS3Request + ), + requestOptions, + ) + + /** @see create */ + @MustBeClosed + fun create( + dataExportDestinationS3Request: DataExportDestinationS3Request + ): HttpResponseFor = + create(dataExportDestinationS3Request, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create( + DataExportDestinationCreateParams.Body + .ofDataExportDestinationGoogleCloudStorageRequest( + dataExportDestinationGoogleCloudStorageRequest + ), + requestOptions, + ) + + /** @see create */ + @MustBeClosed + fun create( + dataExportDestinationGoogleCloudStorageRequest: + DataExportDestinationGoogleCloudStorageRequest + ): HttpResponseFor = + create(dataExportDestinationGoogleCloudStorageRequest, RequestOptions.none()) + /** * Returns a raw HTTP response for `get * /organizations/{orgId}/dataexports/destinations/{id}`, but is otherwise the same as diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationServiceImpl.kt index 5c2ac8ec..894d3497 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/DestinationServiceImpl.kt @@ -30,6 +30,30 @@ import com.m3ter.models.DataExportDestinationUpdateResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export Destinations. + * + * Before you can configure and run either + * [Export Schedules](https://www.m3ter.com/docs/api#tag/ExportSchedule) or + * [Ad-Hoc Exports](https://www.m3ter.com/docs/api#tag/ExportAdHoc), you can set up Export + * Destinations. Currently, two options for setting up Data Export Destinations are available: + * * S3 buckets on your AWS account. + * * Buckets in your Google Cloud Storage account. + * + * **NOTE: Exporting without a Destination?** When a Data Export runs, the data is sent through to + * the specified Destination. However, the export file is also made available for you to download it + * locally. You can set up and run Data Exports without defining a Destination. The data is not + * exported but the compiled export file is made available for downloading locally. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportDestination endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class DestinationServiceImpl internal constructor(private val clientOptions: ClientOptions) : DestinationService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleService.kt index d358e790..bfd51857 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleService.kt @@ -16,8 +16,38 @@ import com.m3ter.models.DataExportScheduleRetrieveParams import com.m3ter.models.DataExportScheduleRetrieveResponse import com.m3ter.models.DataExportScheduleUpdateParams import com.m3ter.models.DataExportScheduleUpdateResponse +import com.m3ter.models.OperationalDataExportScheduleRequest +import com.m3ter.models.UsageDataExportScheduleRequest import java.util.function.Consumer +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set up + * an Export Schedule to export one of two types of data from your m3ter Organization - either + * *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under a + * single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ interface ScheduleService { /** @@ -77,6 +107,53 @@ interface ScheduleService { requestOptions: RequestOptions = RequestOptions.none(), ): DataExportScheduleCreateResponse + /** @see create */ + fun create( + body: DataExportScheduleCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportScheduleCreateResponse = + create(DataExportScheduleCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + fun create(body: DataExportScheduleCreateParams.Body): DataExportScheduleCreateResponse = + create(body, RequestOptions.none()) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportScheduleCreateResponse = + create( + DataExportScheduleCreateParams.Body.ofOperationalDataExportScheduleRequest( + operationalDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest + ): DataExportScheduleCreateResponse = + create(operationalDataExportScheduleRequest, RequestOptions.none()) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): DataExportScheduleCreateResponse = + create( + DataExportScheduleCreateParams.Body.ofUsageDataExportScheduleRequest( + usageDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest + ): DataExportScheduleCreateResponse = + create(usageDataExportScheduleRequest, RequestOptions.none()) + /** * Retrieve a Data Export Schedule for the given UUID. Each Schedule can be configured for * exporting *only one* of either Usage or Operational data. @@ -246,6 +323,60 @@ interface ScheduleService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** @see create */ + @MustBeClosed + fun create( + body: DataExportScheduleCreateParams.Body, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create(DataExportScheduleCreateParams.builder().body(body).build(), requestOptions) + + /** @see create */ + @MustBeClosed + fun create( + body: DataExportScheduleCreateParams.Body + ): HttpResponseFor = create(body, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create( + DataExportScheduleCreateParams.Body.ofOperationalDataExportScheduleRequest( + operationalDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + @MustBeClosed + fun create( + operationalDataExportScheduleRequest: OperationalDataExportScheduleRequest + ): HttpResponseFor = + create(operationalDataExportScheduleRequest, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + create( + DataExportScheduleCreateParams.Body.ofUsageDataExportScheduleRequest( + usageDataExportScheduleRequest + ), + requestOptions, + ) + + /** @see create */ + @MustBeClosed + fun create( + usageDataExportScheduleRequest: UsageDataExportScheduleRequest + ): HttpResponseFor = + create(usageDataExportScheduleRequest, RequestOptions.none()) + /** * Returns a raw HTTP response for `get /organizations/{orgId}/dataexports/schedules/{id}`, * but is otherwise the same as [ScheduleService.retrieve]. diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleServiceImpl.kt index df9dba2e..b06bdde8 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/dataExports/ScheduleServiceImpl.kt @@ -30,6 +30,34 @@ import com.m3ter.models.DataExportScheduleUpdateResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, updating, retrieving, or deleting Data Export schedules. You can set up + * an Export Schedule to export one of two types of data from your m3ter Organization - either + * *Usage data* or *Operational data* for entities. + * + * **NOTE:** You cannot create a single Export Schedule for exporting *both types of data under a + * single Schedule*. + * + * **Export Destinations** When creating an Export Schedule: + * * You can define one or more Export Destinations - see the + * [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API + * Reference. When the export runs, the data is sent through to the sepecified Destination. + * However, the export file is also made available for you to download it locally. + * * You can set up and run Data Exports without defining a Destination. The data is not exported + * but the compiled export file is made available for downloading locally. + * * For details on downloading an export file, see the + * [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) + * endpoint in this API Reference. + * + * **Preview Version!** The Data Export feature is currently available only in Preview release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Preview release definition. ExportSchedule endpoints will only be available if Data Export + * has been enabled for your Organization. For more details see + * [Data Export(Preview)](https://www.m3ter.com/docs/guides/data-exports) in our main User + * documentation. If you're interested in previewing the Data Export feature, please get in touch + * with m3ter Support or your m3ter contact. + */ class ScheduleServiceImpl internal constructor(private val clientOptions: ClientOptions) : ScheduleService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataService.kt index b96de585..111d8f9f 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataService.kt @@ -27,6 +27,27 @@ import com.m3ter.models.LookupTableLookupTableRevisionDataUpdateResponse import com.m3ter.services.blocking.lookupTables.lookupTableRevisionData.LookupTableRevisionDataJobService import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionDataService { /** @@ -41,6 +62,28 @@ interface LookupTableRevisionDataService { */ fun withOptions(modifier: Consumer): LookupTableRevisionDataService + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobService /** List Lookup Table Revision Data items for the given UUID. */ @@ -379,6 +422,28 @@ interface LookupTableRevisionDataService { modifier: Consumer ): LookupTableRevisionDataService.WithRawResponse + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataServiceImpl.kt index 876fa321..6edaa270 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionDataServiceImpl.kt @@ -39,6 +39,27 @@ import com.m3ter.services.blocking.lookupTables.lookupTableRevisionData.LookupTa import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionDataServiceImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionDataService { @@ -59,6 +80,28 @@ internal constructor(private val clientOptions: ClientOptions) : LookupTableRevi clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. + * See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobService = lookupTableRevisionDataJobs @@ -152,6 +195,28 @@ internal constructor(private val clientOptions: ClientOptions) : LookupTableRevi clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use + * upsert operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release + * version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available + * if Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ override fun lookupTableRevisionDataJobs(): LookupTableRevisionDataJobService.WithRawResponse = lookupTableRevisionDataJobs diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionService.kt index af64a5d9..8ae1ad0d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionService.kt @@ -16,6 +16,26 @@ import com.m3ter.models.LookupTableLookupTableRevisionUpdateStatusParams import com.m3ter.models.LookupTableRevisionResponse import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft Revisions, + * but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision containing + * the required new values. The currently published Revision is archived automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceImpl.kt index 23d52605..8f888782 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceImpl.kt @@ -28,6 +28,26 @@ import com.m3ter.models.LookupTableRevisionResponse import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Lookup Table Revisions. + * + * Lookup Tables utilize a "Table and Revision" model, which lets you update data cleanly, and + * extend the schema without modifying existing calculations: + * * Create Revisions for a Lookup Table, which you can use to define data schema and lookup keys. + * * Populate draft Revisions with data values. You can create and edit multiple draft Revisions, + * but only one can be published at any given time. + * * Publish a Revision to activate it. When you use Lookup functions in your calculations that + * reference the Lookup Table, the data values defined for the published Revision are used. + * * When you want different, updated data values to be used, publish the draft Revision containing + * the required new values. The currently published Revision is archived automatically. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision endpoints will only be available if Lookup + * Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionServiceImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobService.kt index 68441eee..e25c18ac 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobService.kt @@ -16,6 +16,27 @@ import com.m3ter.models.LookupTableLookupTableRevisionDataLookupTableRevisionDat import com.m3ter.models.LookupTableLookupTableRevisionDataLookupTableRevisionDataJobRetrieveResponse import java.util.function.Consumer +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ interface LookupTableRevisionDataJobService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceImpl.kt index 428d3985..a35ae9dc 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/lookupTables/lookupTableRevisionData/LookupTableRevisionDataJobServiceImpl.kt @@ -28,6 +28,27 @@ import com.m3ter.models.LookupTableLookupTableRevisionDataLookupTableRevisionDat import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating/updating/deleting Data for specific Lookup Table Revisions. + * + * When you've added fields to create a data schema for a Lookup Table Revision, you can use upsert + * operations to create or update the data values for those fields: + * * Use [Upsert LookupTableRevisionData](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionData) + * to upsert some or all of a Revision's field data values. + * * Use [Upsert LookupTableRevisionData Entry](https://www.m3ter.com/docs/api#tag/LookupTableRevisionData/operation/PutLookupTableRevisionDataEntry) + * to upsert an individual Revision field's data value. + * + * **NOTES:** + * * You can only create or update field data values for DRAFT Revisions. + * * You cannot change the field data values for PUBLISHED Revisions. + * + * **Beta Version!** The Lookup Table feature is currently available in Beta release version. See + * [Feature Release Stages](https://www.m3ter.com/docs/guides/getting-started/feature-release-stages) + * for Beta release definition. Lookup Table Revision Data endpoints will only be available if + * Lookup Tables have been enabled for your Organization. For more details see + * [Lookup Tables (Beta)](https://www.m3ter.com/docs/guides/lookup-tables) in our main User + * documentation. + */ class LookupTableRevisionDataJobServiceImpl internal constructor(private val clientOptions: ClientOptions) : LookupTableRevisionDataJobService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionService.kt index db7857ce..56682a3b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionService.kt @@ -15,6 +15,17 @@ import com.m3ter.models.StatementStatementDefinitionRetrieveParams import com.m3ter.models.StatementStatementDefinitionUpdateParams import java.util.function.Consumer +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ interface StatementDefinitionService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionServiceImpl.kt index 3497070c..9c29b45c 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementDefinitionServiceImpl.kt @@ -27,6 +27,17 @@ import com.m3ter.models.StatementStatementDefinitionUpdateParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for listing, creating, updating, retrieving, or deleting Statement Definitions. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + * + * Statement Definitions specify the way billed usage will be aggregated and compiled in the + * Statement. For example, if you are billing customers monthly, you might want to breakdown the + * usage responsible for the monthly charge on a Bill into weekly portions in Bill statements. + */ class StatementDefinitionServiceImpl internal constructor(private val clientOptions: ClientOptions) : StatementDefinitionService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobService.kt index 96c4a4d7..cb3b7007 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobService.kt @@ -15,6 +15,15 @@ import com.m3ter.models.StatementStatementJobListParams import com.m3ter.models.StatementStatementJobRetrieveParams import java.util.function.Consumer +/** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + */ interface StatementJobService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceImpl.kt index 97f3353a..067dd76e 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceImpl.kt @@ -27,6 +27,15 @@ import com.m3ter.models.StatementStatementJobRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating, retrieving, listing, and cancelling statement jobs. + * + * StatementJobs are tasks to asynchronously calculate and generate a bill statement. + * + * Bill statements are informative backing sheets to invoices. They provide a breakdown of the usage + * charges that appear on the bill, helping your end customers better understand those charges, and + * gain a clearer picture of their usage over the billing period. + */ class StatementJobServiceImpl internal constructor(private val clientOptions: ClientOptions) : StatementJobService { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadService.kt index 0009c5d4..a27f551d 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadService.kt @@ -11,6 +11,33 @@ import com.m3ter.models.UsageFileUploadGenerateUploadUrlResponse import com.m3ter.services.blocking.usage.fileUploads.JobService import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ interface FileUploadService { /** @@ -25,6 +52,34 @@ interface FileUploadService { */ fun withOptions(modifier: Consumer): FileUploadService + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun jobs(): JobService /** @@ -64,6 +119,34 @@ interface FileUploadService { modifier: Consumer ): FileUploadService.WithRawResponse + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ fun jobs(): JobService.WithRawResponse /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadServiceImpl.kt index 9b8cc829..be85741b 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/FileUploadServiceImpl.kt @@ -21,6 +21,33 @@ import com.m3ter.services.blocking.usage.fileUploads.JobService import com.m3ter.services.blocking.usage.fileUploads.JobServiceImpl import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ class FileUploadServiceImpl internal constructor(private val clientOptions: ClientOptions) : FileUploadService { @@ -35,6 +62,34 @@ class FileUploadServiceImpl internal constructor(private val clientOptions: Clie override fun withOptions(modifier: Consumer): FileUploadService = FileUploadServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL + * as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the + * Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun jobs(): JobService = jobs override fun generateUploadUrl( @@ -61,6 +116,34 @@ class FileUploadServiceImpl internal constructor(private val clientOptions: Clie clientOptions.toBuilder().apply(modifier::accept).build() ) + /** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data + * measurements directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and + * submit a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an + * upload job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload + * URL as the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the + * Console UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file + * upload service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter + * Console using a `CSV` formatted file you've prepared for usage data measurements ingest + * for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ override fun jobs(): JobService.WithRawResponse = jobs private val generateUploadUrlHandler: Handler = diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobService.kt index a31e4aae..6b956f0a 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobService.kt @@ -14,6 +14,33 @@ import com.m3ter.models.UsageFileUploadJobListParams import com.m3ter.models.UsageFileUploadJobRetrieveParams import java.util.function.Consumer +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ interface JobService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobServiceImpl.kt index 576c6cb1..3eaaa891 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/usage/fileUploads/JobServiceImpl.kt @@ -25,6 +25,33 @@ import com.m3ter.models.UsageFileUploadJobRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for submitting usage data measurements to the m3ter platform: + * - **Directly:** You can use the **Submit Measurements** call to submit raw data measurements + * directly using the **Ingest API**. + * - **Indirectly:** You can use the platform's file upload service calls to prepare for and submit + * a file for data ingest using the **Config API**. + * + * To use the file upload service: + * - First, make a **Generate an upload URL** call to obtain a temporary upload URL and an upload + * job ID. + * - You can then upload your data measurements file using a `PUT` request using the upload URL as + * the endpoint. + * - Any errors are reported via the normal + * [Alerts](https://www.m3ter.com/docs/guides/viewing-and-managing-alerts) service in the Console + * UI. + * - If any issues occur with a file upload, you can use the upload job ID with other file upload + * service calls we provide to troubleshoot and resolve issues. + * + * **Note:** You can also perform a File Upload via a Meter's Details page in the m3ter Console + * using a `CSV` formatted file you've prepared for usage data measurements ingest for the Meter. + * + * In the m3ter documentation, see also: + * - [Optimizing Measurement + * Submissions](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits). + * - [File Uploads for Data + * Ingest](https://www.m3ter.com/docs/guides/submitting-usage-data/file-uploads-for-data-ingest) + */ class JobServiceImpl internal constructor(private val clientOptions: ClientOptions) : JobService { private val withRawResponse: JobService.WithRawResponse by lazy { diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationService.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationService.kt index c4600a98..91d6fb69 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationService.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationService.kt @@ -13,6 +13,27 @@ import com.m3ter.models.UserInvitationListParams import com.m3ter.models.UserInvitationRetrieveParams import java.util.function.Consumer +/** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other people to + * join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept the + * invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and use + * their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ interface InvitationService { /** diff --git a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationServiceImpl.kt b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationServiceImpl.kt index 446a8e29..d09219c6 100644 --- a/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationServiceImpl.kt +++ b/sdk-java-core/src/main/kotlin/com/m3ter/services/blocking/users/InvitationServiceImpl.kt @@ -25,6 +25,27 @@ import com.m3ter.models.UserInvitationRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull +/** + * Endpoints for creating and retrieving user invitations. Use invitations to invite other people to + * join your m3ter Organization. + * + * An invitation sends an email inviting someone to join your Organization. When you set up an + * invitation, you can: + * * Assign the required permission policies to control what the invitee can do when they accept the + * invite and join your Organization. + * * Set a date for when the invitation will expire. + * * Set a date for when the invited user's access will expire. + * + * When the invitee receives the invitation email: + * * If the invitee is already a m3ter user and has a m3ter account, they can click a link and use + * their credentials to log into your Organization. + * * If the invitee is not a m3ter user and does not have a m3ter account, they'll be invited to + * create a m3ter account before logging into your Organization. + * + * See + * [Inviting Users to your Organization](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users#inviting-users-to-your-organization) + * in our user documentation for more details. + */ class InvitationServiceImpl internal constructor(private val clientOptions: ClientOptions) : InvitationService { diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/TestServerExtension.kt b/sdk-java-core/src/test/kotlin/com/m3ter/TestServerExtension.kt index 31d01d01..ebc0ea4d 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/TestServerExtension.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/TestServerExtension.kt @@ -15,25 +15,12 @@ class TestServerExtension : BeforeAllCallback, ExecutionCondition { } catch (e: Exception) { throw RuntimeException( """ - The test suite will not run without a mock Prism server running against your OpenAPI spec. + The test suite will not run without a mock server running against your OpenAPI spec. You can set the environment variable `SKIP_MOCK_TESTS` to `true` to skip running any tests that require the mock server. - To fix: - - 1. Install Prism (requires Node 16+): - - With npm: - $ npm install -g @stoplight/prism-cli - - With yarn: - $ yarn global add @stoplight/prism-cli - - 2. Run the mock server - - To run the server, pass in the path of your OpenAPI spec to the prism command: - $ prism mock path/to/your.openapi.yml + To fix run `./scripts/mock` in a separate terminal. """ .trimIndent(), e, diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/core/ClientOptionsTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/core/ClientOptionsTest.kt index bbf9c84c..1a95699f 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/core/ClientOptionsTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/core/ClientOptionsTest.kt @@ -16,6 +16,38 @@ internal class ClientOptionsTest { private val httpClient = mock() + @Test + fun putHeader_canOverwriteDefaultHeader() { + val clientOptions = + ClientOptions.builder() + .httpClient(httpClient) + .putHeader("User-Agent", "My User Agent") + .apiKey("My API Key") + .apiSecret("My API Secret") + .token("My Token") + .orgId("My Org ID") + .build() + + assertThat(clientOptions.headers.values("User-Agent")).containsExactly("My User Agent") + } + + @Test + fun toBuilder_bearerAuthCanBeUpdated() { + var clientOptions = + ClientOptions.builder() + .httpClient(httpClient) + .token("My Token") + .apiKey("My API Key") + .apiSecret("My API Secret") + .orgId("My Org ID") + .build() + + clientOptions = clientOptions.toBuilder().token("another My Token").build() + + assertThat(clientOptions.headers.values("Authorization")) + .containsExactly("Bearer another My Token") + } + @Test fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() { var clientOptions = diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/core/http/HttpRequestBodiesTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/HttpRequestBodiesTest.kt new file mode 100644 index 00000000..2dfa56e3 --- /dev/null +++ b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/HttpRequestBodiesTest.kt @@ -0,0 +1,729 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.m3ter.core.http + +import com.m3ter.core.MultipartField +import com.m3ter.core.jsonMapper +import java.io.ByteArrayOutputStream +import java.io.InputStream +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class HttpRequestBodiesTest { + + @Test + fun multipartFormData_serializesFieldWithFilename() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "file" to + MultipartField.builder() + .value("hello") + .filename("hello.txt") + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(output.size().toLong()).isEqualTo(body.contentLength()) + val boundary = body.contentType()!!.substringAfter("multipart/form-data; boundary=") + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="file"; filename="hello.txt" + |Content-Type: text/plain + | + |hello + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesFieldWithoutFilename() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "field" to + MultipartField.builder() + .value("value") + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(output.size().toLong()).isEqualTo(body.contentLength()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="field" + |Content-Type: text/plain + | + |value + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesInputStream() { + // Use `.buffered()` to get a non-ByteArrayInputStream, which hits the non-repeatable code + // path. + val inputStream = "stream content".byteInputStream().buffered() + val body = + multipartFormData( + jsonMapper(), + mapOf( + "data" to + MultipartField.builder() + .value(inputStream) + .contentType("application/octet-stream") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isFalse() + assertThat(body.contentLength()).isEqualTo(-1L) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="data" + |Content-Type: application/octet-stream + | + |stream content + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesByteArray() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "binary" to + MultipartField.builder() + .value("abc".toByteArray()) + .contentType("application/octet-stream") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="binary" + |Content-Type: application/octet-stream + | + |abc + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesBooleanValue() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "flag" to + MultipartField.builder() + .value(true) + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="flag" + |Content-Type: text/plain + | + |true + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesNumberValue() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "count" to + MultipartField.builder().value(42).contentType("text/plain").build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="count" + |Content-Type: text/plain + | + |42 + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesNullValueAsNoParts() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "present" to + MultipartField.builder() + .value("yes") + .contentType("text/plain") + .build(), + "absent" to + MultipartField.builder() + .value(null as String?) + .contentType("text/plain") + .build(), + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="present" + |Content-Type: text/plain + | + |yes + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesArray() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "items" to + MultipartField.builder>() + .value(listOf("alpha", "beta", "gamma")) + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="items" + |Content-Type: text/plain + | + |alpha,beta,gamma + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesObjectAsNestedParts() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "meta" to + MultipartField.builder>() + .value(mapOf("key1" to "val1", "key2" to "val2")) + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="meta[key1]" + |Content-Type: text/plain + | + |val1 + |--$boundary + |Content-Disposition: form-data; name="meta[key2]" + |Content-Type: text/plain + | + |val2 + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesMultipleFields() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "name" to + MultipartField.builder() + .value("Alice") + .contentType("text/plain") + .build(), + "age" to + MultipartField.builder().value(30).contentType("text/plain").build(), + "file" to + MultipartField.builder() + .value("file contents") + .filename("doc.txt") + .contentType("text/plain") + .build(), + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="name" + |Content-Type: text/plain + | + |Alice + |--$boundary + |Content-Disposition: form-data; name="age" + |Content-Type: text/plain + | + |30 + |--$boundary + |Content-Disposition: form-data; name="file"; filename="doc.txt" + |Content-Type: text/plain + | + |file contents + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_quotesSpecialCharactersInNameAndFilename() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "field\nname" to + MultipartField.builder() + .value("value") + .filename("file\r\"name.txt") + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="field%0Aname"; filename="file%0D%22name.txt" + |Content-Type: text/plain + | + |value + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_writeIsRepeatable() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "field" to + MultipartField.builder() + .value("repeatable") + .contentType("text/plain") + .build() + ), + ) + + val output1 = ByteArrayOutputStream() + body.writeTo(output1) + val output2 = ByteArrayOutputStream() + body.writeTo(output2) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output1.size().toLong()) + val boundary = boundary(body) + val expected = + """ + |--$boundary + |Content-Disposition: form-data; name="field" + |Content-Type: text/plain + | + |repeatable + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + assertThat(output1.toString("UTF-8")).isEqualTo(expected) + assertThat(output2.toString("UTF-8")).isEqualTo(expected) + } + + @Test + fun multipartFormData_serializesByteArrayInputStream() { + // ByteArrayInputStream is specifically handled as repeatable with known content length. + val inputStream = "byte array stream".byteInputStream() + val body = + multipartFormData( + jsonMapper(), + mapOf( + "data" to + MultipartField.builder() + .value(inputStream) + .contentType("application/octet-stream") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="data" + |Content-Type: application/octet-stream + | + |byte array stream + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesInputStreamWithFilename() { + // Use `.buffered()` to get a non-ByteArrayInputStream, which hits the non-repeatable code + // path. + val inputStream = "file data".byteInputStream().buffered() + val body = + multipartFormData( + jsonMapper(), + mapOf( + "upload" to + MultipartField.builder() + .value(inputStream) + .filename("upload.bin") + .contentType("application/octet-stream") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isFalse() + assertThat(body.contentLength()).isEqualTo(-1L) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="upload"; filename="upload.bin" + |Content-Type: application/octet-stream + | + |file data + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesNestedArrayInObject() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "data" to + MultipartField.builder>>() + .value(mapOf("tags" to listOf("a", "b"))) + .contentType("text/plain") + .build() + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="data[tags]" + |Content-Type: text/plain + | + |a,b + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_contentLengthIsUnknownWhenInputStreamPresent() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "text" to + MultipartField.builder() + .value("hello") + .contentType("text/plain") + .build(), + "stream" to + MultipartField.builder() + // Use `.buffered()` to get a non-ByteArrayInputStream, which hits the + // non-repeatable code path. + .value("data".byteInputStream().buffered()) + .contentType("application/octet-stream") + .build(), + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isFalse() + assertThat(body.contentLength()).isEqualTo(-1L) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="text" + |Content-Type: text/plain + | + |hello + |--$boundary + |Content-Disposition: form-data; name="stream" + |Content-Type: application/octet-stream + | + |data + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesEmptyArray() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "required" to + MultipartField.builder() + .value("present") + .contentType("text/plain") + .build(), + "items" to + MultipartField.builder>() + .value(emptyList()) + .contentType("text/plain") + .build(), + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="required" + |Content-Type: text/plain + | + |present + |--$boundary + |Content-Disposition: form-data; name="items" + |Content-Type: text/plain + | + | + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + @Test + fun multipartFormData_serializesEmptyObject() { + val body = + multipartFormData( + jsonMapper(), + mapOf( + "required" to + MultipartField.builder() + .value("present") + .contentType("text/plain") + .build(), + "meta" to + MultipartField.builder>() + .value(emptyMap()) + .contentType("text/plain") + .build(), + ), + ) + + val output = ByteArrayOutputStream() + body.writeTo(output) + + assertThat(body.repeatable()).isTrue() + assertThat(body.contentLength()).isEqualTo(output.size().toLong()) + val boundary = boundary(body) + assertThat(output.toString("UTF-8")) + .isEqualTo( + """ + |--$boundary + |Content-Disposition: form-data; name="required" + |Content-Type: text/plain + | + |present + |--$boundary-- + | + """ + .trimMargin() + .replace("\n", "\r\n") + ) + } + + private fun boundary(body: HttpRequestBody): String = + body.contentType()!!.substringAfter("multipart/form-data; boundary=") +} diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/core/http/LoggingHttpClientTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/LoggingHttpClientTest.kt new file mode 100644 index 00000000..5f9b99e1 --- /dev/null +++ b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/LoggingHttpClientTest.kt @@ -0,0 +1,1000 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.m3ter.core.http + +import com.m3ter.core.LogLevel +import com.m3ter.core.RequestOptions +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.IOException +import java.io.InputStream +import java.io.OutputStream +import java.io.PrintStream +import java.nio.charset.StandardCharsets +import java.time.Clock +import java.time.Instant +import java.time.ZoneOffset +import java.util.concurrent.CompletableFuture +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatThrownBy +import org.junit.jupiter.api.AfterEach +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.parallel.ResourceLock +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.ValueSource + +@ResourceLock("stderr") +internal class LoggingHttpClientTest { + + private lateinit var originalErr: PrintStream + private lateinit var errContent: ByteArrayOutputStream + + @BeforeEach + fun beforeEach() { + originalErr = System.err + errContent = ByteArrayOutputStream() + System.setErr(PrintStream(errContent)) + } + + @AfterEach + fun afterEach() { + System.setErr(originalErr) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun offLevel_noOutput(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.OFF) + + val response = client.execute(simpleGetRequest(), async).apply { body().readBytes() } + + assertThat(response.statusCode()).isEqualTo(200) + assertThat(stderrOutput()).isEmpty() + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsGetRequest(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsPostRequestWithBodySize(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client.execute(postRequestWithBody("""{"key":"value"}"""), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (15-byte body) + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsRequestWithUnknownLengthBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.INFO) + + client + .execute(postRequestWithBody("""{"key":"value"}""", contentLength = -1L), async) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (unknown-length body) + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsResponseStatusAndDuration(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:01.234Z"), + ) + val client = loggingClient(fakeHttpClient(statusCode = 201), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 201 (1s 234ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_logsResponseContentLength(async: Boolean) { + val headers = + Headers.builder().put("Content-Length", "42").put("Content-Type", "text/plain").build() + val client = loggingClient(fakeHttpClient(responseHeaders = headers), LogLevel.INFO) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (0s, 42-byte body) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_doesNotLogHeaders(async: Boolean) { + val headers = Headers.builder().put("X-Custom", "visible").build() + val client = loggingClient(fakeHttpClient(responseHeaders = headers), LogLevel.INFO) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .putHeader("X-Request-Custom", "req-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1 + |<-- 200 (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsGetWithEndMarker(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestAndResponseHeaders(async: Boolean) { + val responseHeaders = + Headers.builder() + .put("X-Response-Id", "abc-123") + .put("Content-Type", "text/plain") + .build() + val client = + loggingClient(fakeHttpClient(responseHeaders = responseHeaders), LogLevel.DEBUG) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("X-Custom", "my-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |X-Custom: my-value + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain + |X-Response-Id: abc-123 + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_redactsSensitiveHeaders(async: Boolean) { + val client = + loggingClient( + fakeHttpClient(), + LogLevel.DEBUG, + redactedHeaders = setOf("Authorization", "X-Secret"), + ) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("Authorization", "Bearer token-123") + .putHeader("X-Secret", "secret-value") + .putHeader("X-Public", "public-value") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |Authorization: ██ + |X-Public: public-value + |X-Secret: ██ + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_redactsHeadersCaseInsensitively(async: Boolean) { + val client = + loggingClient( + fakeHttpClient(), + LogLevel.DEBUG, + redactedHeaders = setOf("Authorization"), + ) + + client + .execute( + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("test") + .putHeader("authorization", "Bearer secret") + .build(), + async, + ) + .body() + .readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/test + |authorization: ██ + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + val body = """{"name":"test","value":42}""" + + client.execute(postRequestWithBody(body), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> POST https://api.example.com/v1/resources (26-byte body) + | + |{"name":"test","value":42} + |--> END POST (26-byte body) + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBody(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val response = client.execute(simpleGetRequest(), async) + val body = response.body().readBytes().toString(StandardCharsets.UTF_8) + + assertThat(body).isEqualTo(responseBody) + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id":1,"status":"ok"} + |<-- END HTTP (22-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsBinaryResponseBodyAsOmitted(async: Boolean) { + val binaryBody = ByteArray(256) { it.toByte() } + val client = loggingClient(fakeHttpClient(responseBody = binaryBody), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + | + |(binary body omitted) + |<-- END HTTP (256-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsMultilineResponseBody(async: Boolean) { + val multilineBody = "line1\nline2\nline3" + val headers = Headers.builder().put("Content-Type", "text/plain; charset=utf-8").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = multilineBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain; charset=utf-8 + | + |line1 + |line2 + |line3 + |<-- END HTTP (17-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBodyWithExplicitCharset(async: Boolean) { + val responseBody = "héllo wörld" + val headers = Headers.builder().put("Content-Type", "text/plain; charset=utf-8").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: text/plain; charset=utf-8 + | + |héllo wörld + |<-- END HTTP (13-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsResponseBodyWithNoContentType(async: Boolean) { + val responseBody = "plain text body" + val client = + loggingClient( + fakeHttpClient(responseBody = responseBody.toByteArray(StandardCharsets.UTF_8)), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + | + |plain text body + |<-- END HTTP (15-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEmptyResponseBody(async: Boolean) { + val client = loggingClient(fakeHttpClient(), LogLevel.DEBUG) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |<-- END HTTP (0-byte body) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerOnEarlyClose(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val body = client.execute(simpleGetRequest(), async).body() + body.read(ByteArray(5)) + body.close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id" + |<-- END HTTP (5-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerOnCloseWithoutReading(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).body().close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + |<-- END HTTP (0-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsEndHttpMarkerWhenResponseClosedAfterPartialRead(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + val response = client.execute(simpleGetRequest(), async) + response.body().read(ByteArray(5)) + response.close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + | + |{"id" + |<-- END HTTP (5-byte body, closed early) + | + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_doesNotLogEndHttpMarkerWhenResponseClosedWithoutBodyAccess(async: Boolean) { + val responseBody = """{"id":1,"status":"ok"}""" + val headers = Headers.builder().put("Content-Type", "application/json").build() + val client = + loggingClient( + fakeHttpClient( + responseHeaders = headers, + responseBody = responseBody.toByteArray(StandardCharsets.UTF_8), + ), + LogLevel.DEBUG, + ) + + client.execute(simpleGetRequest(), async).close() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- 200 (0s) + |Content-Type: application/json + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun errorLevel_logsRequestFailure(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:01.234Z"), + ) + val client = + loggingClient( + failingHttpClient(IOException("Connection refused")), + LogLevel.ERROR, + clock, + ) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException: Connection refused (1s 234ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun infoLevel_doesNotLogRequestFailure(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.INFO) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun debugLevel_logsRequestFailureAfterHeaders(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.DEBUG) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |--> END GET + | + |<-- !! IOException: Connection refused (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun errorLevel_logsRequestFailureWithoutMessage(async: Boolean) { + val client = loggingClient(failingHttpClient(IOException()), LogLevel.ERROR) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun offLevel_doesNotLogRequestFailure(async: Boolean) { + val client = + loggingClient(failingHttpClient(IOException("Connection refused")), LogLevel.OFF) + + assertThatThrownBy { client.execute(simpleGetRequest(), async) } + + assertThat(stderrOutput()).isEmpty() + } + + @Test + fun errorLevel_logsExecuteAsyncSynchronousThrow() { + val error = IOException("Connection refused") + val client = + loggingClient( + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse = throw UnsupportedOperationException() + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = throw error + + override fun close() {} + }, + LogLevel.ERROR, + ) + + assertThatThrownBy { client.execute(simpleGetRequest(), async = true) }.isSameAs(error) + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- !! IOException: Connection refused (0s) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun durationFormat_seconds(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:00:02.500Z"), + ) + val client = loggingClient(fakeHttpClient(), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (2s 500ms) + |""" + .trimMargin() + ) + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun durationFormat_minutesAndSeconds(async: Boolean) { + val clock = + clockFrom( + Instant.parse("1998-04-21T00:00:00Z"), + Instant.parse("1998-04-21T00:01:40.467Z"), + ) + val client = loggingClient(fakeHttpClient(), LogLevel.INFO, clock) + + client.execute(simpleGetRequest(), async).body().readBytes() + + assertThat(stderrOutput()) + .isEqualTo( + """ + |--> GET https://api.example.com/v1/resources + |<-- 200 (1m 40s 467ms) + |""" + .trimMargin() + ) + } + + @Test + fun builder_toBuilder_roundtrips() { + val delegate = fakeHttpClient() + val clock = Clock.fixed(Instant.parse("1998-04-21T00:00:00Z"), ZoneOffset.UTC) + val client = + LoggingHttpClient.builder() + .httpClient(delegate) + .level(LogLevel.DEBUG) + .redactedHeaders(setOf("X-Secret")) + .clock(clock) + .build() + + val rebuilt = client.toBuilder().build() + + assertThat(rebuilt.httpClient).isSameAs(delegate) + assertThat(rebuilt.level).isEqualTo(LogLevel.DEBUG) + assertThat(rebuilt.redactedHeaders).containsExactly("X-Secret") + assertThat(rebuilt.clock).isEqualTo(clock) + } + + @Test + fun close_delegatesToUnderlyingClient() { + var closed = false + val delegate = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse = throw UnsupportedOperationException() + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = throw UnsupportedOperationException() + + override fun close() { + closed = true + } + } + val client = loggingClient(delegate, LogLevel.OFF) + + client.close() + + assertThat(closed).isTrue() + } + + private fun stderrOutput(): String = errContent.toString("UTF-8") + + private fun loggingClient( + httpClient: HttpClient, + level: LogLevel, + clock: Clock = clockFrom(Instant.parse("1998-04-21T00:00:00Z")), + redactedHeaders: Set = + setOf("authorization", "api-key", "x-api-key", "cookie", "set-cookie"), + ): LoggingHttpClient = + LoggingHttpClient.builder() + .httpClient(httpClient) + .level(level) + .clock(clock) + .redactedHeaders(redactedHeaders) + .build() + + private fun simpleGetRequest(): HttpRequest = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .addPathSegment("resources") + .build() + + private fun postRequestWithBody( + body: String, + contentType: String = "application/json", + contentLength: Long? = null, + ): HttpRequest = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl("https://api.example.com") + .addPathSegment("v1") + .addPathSegment("resources") + .body( + object : HttpRequestBody { + private val bytes = body.toByteArray(StandardCharsets.UTF_8) + + override fun writeTo(outputStream: OutputStream) { + outputStream.write(bytes) + } + + override fun contentType(): String = contentType + + override fun contentLength(): Long = contentLength ?: bytes.size.toLong() + + override fun repeatable(): Boolean = true + + override fun close() {} + } + ) + .build() + + private fun fakeHttpClient( + statusCode: Int = 200, + responseHeaders: Headers = Headers.builder().build(), + responseBody: ByteArray = ByteArray(0), + ): HttpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse { + // Consume the request body if present to trigger logging. + request.body?.let { + val out = ByteArrayOutputStream() + it.writeTo(out) + } + return fakeResponse(statusCode, responseHeaders, responseBody) + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture = + CompletableFuture.completedFuture(execute(request, requestOptions)) + + override fun close() {} + } + + private fun failingHttpClient(error: Throwable): HttpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse { + request.body?.let { + val out = ByteArrayOutputStream() + it.writeTo(out) + } + throw error + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture { + val future = CompletableFuture() + future.completeExceptionally(error) + return future + } + + override fun close() {} + } + + private fun fakeResponse(statusCode: Int, headers: Headers, body: ByteArray): HttpResponse = + object : HttpResponse { + override fun statusCode(): Int = statusCode + + override fun headers(): Headers = headers + + override fun body(): InputStream = ByteArrayInputStream(body) + + override fun close() {} + } + + private fun clockFrom(vararg instants: Instant): Clock = + object : Clock() { + private var index = 0 + + override fun getZone() = ZoneOffset.UTC + + override fun withZone(zone: java.time.ZoneId?) = this + + override fun instant(): Instant { + val instant = instants[index % instants.size] + index++ + return instant + } + } + + private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = + if (async) executeAsync(request).get() else execute(request) +} diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/core/http/RetryingHttpClientTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/RetryingHttpClientTest.kt index 33fb15e4..124f55c8 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/core/http/RetryingHttpClientTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/core/http/RetryingHttpClientTest.kt @@ -1,6 +1,17 @@ +// File generated from our OpenAPI spec by Stainless. + package com.m3ter.core.http -import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.client.WireMock.equalTo +import com.github.tomakehurst.wiremock.client.WireMock.matching +import com.github.tomakehurst.wiremock.client.WireMock.ok +import com.github.tomakehurst.wiremock.client.WireMock.post +import com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor +import com.github.tomakehurst.wiremock.client.WireMock.resetAllScenarios +import com.github.tomakehurst.wiremock.client.WireMock.serviceUnavailable +import com.github.tomakehurst.wiremock.client.WireMock.stubFor +import com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo +import com.github.tomakehurst.wiremock.client.WireMock.verify import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.github.tomakehurst.wiremock.stubbing.Scenario @@ -9,7 +20,11 @@ import com.m3ter.core.RequestOptions import com.m3ter.core.Sleeper import com.m3ter.errors.M3terRetryableException import java.io.InputStream +import java.time.Clock import java.time.Duration +import java.time.OffsetDateTime +import java.time.ZoneOffset +import java.time.format.DateTimeFormatter import java.util.concurrent.CompletableFuture import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach @@ -25,6 +40,21 @@ internal class RetryingHttpClientTest { private lateinit var baseUrl: String private lateinit var httpClient: HttpClient + private class RecordingSleeper : Sleeper { + val durations = mutableListOf() + + override fun sleep(duration: Duration) { + durations.add(duration) + } + + override fun sleepAsync(duration: Duration): CompletableFuture { + durations.add(duration) + return CompletableFuture.completedFuture(null) + } + + override fun close() {} + } + @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { baseUrl = wmRuntimeInfo.httpBaseUrl @@ -75,7 +105,8 @@ internal class RetryingHttpClientTest { @ValueSource(booleans = [false, true]) fun execute(async: Boolean) { stubFor(post(urlPathEqualTo("/something")).willReturn(ok())) - val retryingClient = retryingHttpClientBuilder().build() + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).build() val response = retryingClient.execute( @@ -89,6 +120,7 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertThat(sleeper.durations).isEmpty() assertNoResponseLeaks() } @@ -100,8 +132,12 @@ internal class RetryingHttpClientTest { .withHeader("X-Some-Header", matching("stainless-java-retry-.+")) .willReturn(ok()) ) + val sleeper = RecordingSleeper() val retryingClient = - retryingHttpClientBuilder().maxRetries(2).idempotencyHeader("X-Some-Header").build() + retryingHttpClientBuilder(sleeper) + .maxRetries(2) + .idempotencyHeader("X-Some-Header") + .build() val response = retryingClient.execute( @@ -115,20 +151,20 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertThat(sleeper.durations).isEmpty() assertNoResponseLeaks() } @ParameterizedTest @ValueSource(booleans = [false, true]) fun execute_withRetryAfterHeader(async: Boolean) { + val retryAfterDate = "Wed, 21 Oct 2015 07:28:00 GMT" stubFor( post(urlPathEqualTo("/something")) // First we fail with a retry after header given as a date .inScenario("foo") .whenScenarioStateIs(Scenario.STARTED) - .willReturn( - serviceUnavailable().withHeader("Retry-After", "Wed, 21 Oct 2015 07:28:00 GMT") - ) + .willReturn(serviceUnavailable().withHeader("Retry-After", retryAfterDate)) .willSetStateTo("RETRY_AFTER_DATE") ) stubFor( @@ -147,7 +183,13 @@ internal class RetryingHttpClientTest { .willReturn(ok()) .willSetStateTo("COMPLETED") ) - val retryingClient = retryingHttpClientBuilder().maxRetries(2).build() + // Fix the clock to 5 seconds before the Retry-After date so the date-based backoff is + // deterministic. + val retryAfterDateTime = + OffsetDateTime.parse(retryAfterDate, DateTimeFormatter.RFC_1123_DATE_TIME) + val clock = Clock.fixed(retryAfterDateTime.minusSeconds(5).toInstant(), ZoneOffset.UTC) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper, clock).maxRetries(2).build() val response = retryingClient.execute( @@ -175,19 +217,20 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("2")), ) + assertThat(sleeper.durations) + .containsExactly(Duration.ofSeconds(5), Duration.ofMillis(1234)) assertNoResponseLeaks() } @ParameterizedTest @ValueSource(booleans = [false, true]) fun execute_withOverwrittenRetryCountHeader(async: Boolean) { + val retryAfterDate = "Wed, 21 Oct 2015 07:28:00 GMT" stubFor( post(urlPathEqualTo("/something")) .inScenario("foo") // first we fail with a retry after header given as a date .whenScenarioStateIs(Scenario.STARTED) - .willReturn( - serviceUnavailable().withHeader("Retry-After", "Wed, 21 Oct 2015 07:28:00 GMT") - ) + .willReturn(serviceUnavailable().withHeader("Retry-After", retryAfterDate)) .willSetStateTo("RETRY_AFTER_DATE") ) stubFor( @@ -197,7 +240,11 @@ internal class RetryingHttpClientTest { .willReturn(ok()) .willSetStateTo("COMPLETED") ) - val retryingClient = retryingHttpClientBuilder().maxRetries(2).build() + val retryAfterDateTime = + OffsetDateTime.parse(retryAfterDate, DateTimeFormatter.RFC_1123_DATE_TIME) + val clock = Clock.fixed(retryAfterDateTime.minusSeconds(5).toInstant(), ZoneOffset.UTC) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper, clock).maxRetries(2).build() val response = retryingClient.execute( @@ -216,6 +263,7 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("42")), ) + assertThat(sleeper.durations).containsExactly(Duration.ofSeconds(5)) assertNoResponseLeaks() } @@ -236,7 +284,8 @@ internal class RetryingHttpClientTest { .willReturn(ok()) .willSetStateTo("COMPLETED") ) - val retryingClient = retryingHttpClientBuilder().maxRetries(1).build() + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).maxRetries(1).build() val response = retryingClient.execute( @@ -250,6 +299,7 @@ internal class RetryingHttpClientTest { assertThat(response.statusCode()).isEqualTo(200) verify(2, postRequestedFor(urlPathEqualTo("/something"))) + assertThat(sleeper.durations).containsExactly(Duration.ofMillis(10)) assertNoResponseLeaks() } @@ -290,21 +340,12 @@ internal class RetryingHttpClientTest { override fun close() = httpClient.close() } + val sleeper = RecordingSleeper() val retryingClient = RetryingHttpClient.builder() .httpClient(failingHttpClient) .maxRetries(2) - .sleeper( - object : Sleeper { - - override fun sleep(duration: Duration) {} - - override fun sleepAsync(duration: Duration): CompletableFuture = - CompletableFuture.completedFuture(null) - - override fun close() {} - } - ) + .sleeper(sleeper) .build() val response = @@ -328,25 +369,153 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("0")), ) + // Exponential backoff with jitter: 0.5s * jitter where jitter is in [0.75, 1.0]. + assertThat(sleeper.durations).hasSize(1) + assertThat(sleeper.durations[0]).isBetween(Duration.ofMillis(375), Duration.ofMillis(500)) + assertNoResponseLeaks() + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withExponentialBackoff(async: Boolean) { + stubFor(post(urlPathEqualTo("/something")).willReturn(serviceUnavailable())) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).maxRetries(3).build() + + val response = + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(baseUrl) + .addPathSegment("something") + .build(), + async, + ) + + // All retries exhausted; the last 503 response is returned. + assertThat(response.statusCode()).isEqualTo(503) + verify(4, postRequestedFor(urlPathEqualTo("/something"))) + // Exponential backoff with jitter: backoff = min(0.5 * 2^(retries-1), 8) * jitter where + // jitter is in [0.75, 1.0]. + assertThat(sleeper.durations).hasSize(3) + // retries=1: 0.5s * [0.75, 1.0] + assertThat(sleeper.durations[0]).isBetween(Duration.ofMillis(375), Duration.ofMillis(500)) + // retries=2: 1s * [0.75, 1.0] + assertThat(sleeper.durations[1]).isBetween(Duration.ofMillis(750), Duration.ofMillis(1000)) + // retries=3: 2s * [0.75, 1.0] + assertThat(sleeper.durations[2]).isBetween(Duration.ofMillis(1500), Duration.ofMillis(2000)) assertNoResponseLeaks() } - private fun retryingHttpClientBuilder() = - RetryingHttpClient.builder() - .httpClient(httpClient) - // Use a no-op `Sleeper` to make the test fast. - .sleeper( - object : Sleeper { + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withExponentialBackoffCap(async: Boolean) { + stubFor(post(urlPathEqualTo("/something")).willReturn(serviceUnavailable())) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).maxRetries(6).build() - override fun sleep(duration: Duration) {} + val response = + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(baseUrl) + .addPathSegment("something") + .build(), + async, + ) - override fun sleepAsync(duration: Duration): CompletableFuture = - CompletableFuture.completedFuture(null) + assertThat(response.statusCode()).isEqualTo(503) + verify(7, postRequestedFor(urlPathEqualTo("/something"))) + assertThat(sleeper.durations).hasSize(6) + // retries=5: backoff hits the 8s cap * [0.75, 1.0] + assertThat(sleeper.durations[4]).isBetween(Duration.ofMillis(6000), Duration.ofMillis(8000)) + // retries=6: still capped at 8s * [0.75, 1.0] + assertThat(sleeper.durations[5]).isBetween(Duration.ofMillis(6000), Duration.ofMillis(8000)) + assertNoResponseLeaks() + } - override fun close() {} - } + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withRetryAfterMsPriorityOverRetryAfter(async: Boolean) { + stubFor( + post(urlPathEqualTo("/something")) + .inScenario("foo") + .whenScenarioStateIs(Scenario.STARTED) + .willReturn( + serviceUnavailable() + .withHeader("Retry-After-Ms", "50") + .withHeader("Retry-After", "2") + ) + .willSetStateTo("RETRY") + ) + stubFor( + post(urlPathEqualTo("/something")) + .inScenario("foo") + .whenScenarioStateIs("RETRY") + .willReturn(ok()) + .willSetStateTo("COMPLETED") + ) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).maxRetries(1).build() + + val response = + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(baseUrl) + .addPathSegment("something") + .build(), + async, + ) + + assertThat(response.statusCode()).isEqualTo(200) + // Retry-After-Ms (50ms) takes priority over Retry-After (2s). + assertThat(sleeper.durations).containsExactly(Duration.ofMillis(50)) + assertNoResponseLeaks() + } + + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withRetryAfterUnparseable(async: Boolean) { + stubFor( + post(urlPathEqualTo("/something")) + .inScenario("foo") + .whenScenarioStateIs(Scenario.STARTED) + .willReturn(serviceUnavailable().withHeader("Retry-After", "not-a-date-or-number")) + .willSetStateTo("RETRY") + ) + stubFor( + post(urlPathEqualTo("/something")) + .inScenario("foo") + .whenScenarioStateIs("RETRY") + .willReturn(ok()) + .willSetStateTo("COMPLETED") + ) + val sleeper = RecordingSleeper() + val retryingClient = retryingHttpClientBuilder(sleeper).maxRetries(1).build() + + val response = + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(baseUrl) + .addPathSegment("something") + .build(), + async, ) + assertThat(response.statusCode()).isEqualTo(200) + // Unparseable Retry-After falls through to exponential backoff. + assertThat(sleeper.durations).hasSize(1) + assertThat(sleeper.durations[0]).isBetween(Duration.ofMillis(375), Duration.ofMillis(500)) + assertNoResponseLeaks() + } + + private fun retryingHttpClientBuilder( + sleeper: RecordingSleeper, + clock: Clock = Clock.systemUTC(), + ) = RetryingHttpClient.builder().httpClient(httpClient).sleeper(sleeper).clock(clock) + private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = if (async) executeAsync(request).get() else execute(request) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableListPageResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableListPageResponseTest.kt index 5a701142..56807cad 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableListPageResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableListPageResponseTest.kt @@ -33,11 +33,11 @@ internal class LookupTableListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -80,11 +80,11 @@ internal class LookupTableListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -131,11 +131,11 @@ internal class LookupTableListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionCreateParamsTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionCreateParamsTest.kt index 2105a6c2..f9ba2f35 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionCreateParamsTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionCreateParamsTest.kt @@ -19,16 +19,16 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -59,7 +59,7 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) @@ -82,16 +82,16 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -112,16 +112,16 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -151,7 +151,7 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) @@ -172,7 +172,7 @@ internal class LookupTableLookupTableRevisionCreateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponseTest.kt index 1b7f38a1..004f521a 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionListPageResponseTest.kt @@ -30,11 +30,11 @@ internal class LookupTableLookupTableRevisionListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -60,11 +60,11 @@ internal class LookupTableLookupTableRevisionListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -94,11 +94,11 @@ internal class LookupTableLookupTableRevisionListPageResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionUpdateParamsTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionUpdateParamsTest.kt index 7969f432..6e27cfa9 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionUpdateParamsTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableLookupTableRevisionUpdateParamsTest.kt @@ -20,16 +20,16 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -61,7 +61,7 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) @@ -86,16 +86,16 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -116,16 +116,16 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -156,7 +156,7 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) @@ -177,7 +177,7 @@ internal class LookupTableLookupTableRevisionUpdateParamsTest { .type(LookupTableRevisionRequest.Field.Type.STRING) .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .build() ) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableResponseTest.kt index ce30e760..414b0c0c 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableResponseTest.kt @@ -30,11 +30,11 @@ internal class LookupTableResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -72,11 +72,11 @@ internal class LookupTableResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -121,11 +121,11 @@ internal class LookupTableResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionRequestTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionRequestTest.kt index 700070e2..1a92c4e0 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionRequestTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionRequestTest.kt @@ -18,16 +18,16 @@ internal class LookupTableRevisionRequestTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -42,14 +42,14 @@ internal class LookupTableRevisionRequestTest { .containsExactly( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build(), LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build(), ) - assertThat(lookupTableRevisionRequest.keys()).containsExactly("foo", "bar", "baz") + assertThat(lookupTableRevisionRequest.keys()).containsExactly("string") assertThat(lookupTableRevisionRequest.name()).isEqualTo("x") assertThat(lookupTableRevisionRequest.customFields()) .contains( @@ -70,16 +70,16 @@ internal class LookupTableRevisionRequestTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionResponseTest.kt index d11fe1a8..618f37b1 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/LookupTableRevisionResponseTest.kt @@ -28,11 +28,11 @@ internal class LookupTableRevisionResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -56,12 +56,11 @@ internal class LookupTableRevisionResponseTest { .containsExactly( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) assertThat(lookupTableRevisionResponse.itemCount()).contains(0L) - assertThat(lookupTableRevisionResponse.keys().getOrNull()) - .containsExactly("foo", "bar", "baz") + assertThat(lookupTableRevisionResponse.keys().getOrNull()).containsExactly("string") assertThat(lookupTableRevisionResponse.lastModifiedBy()).contains("lastModifiedBy") assertThat(lookupTableRevisionResponse.name()).contains("name") assertThat(lookupTableRevisionResponse.startDate()) @@ -88,11 +87,11 @@ internal class LookupTableRevisionResponseTest { .addField( LookupTableRevisionResponse.Field.builder() .type(LookupTableRevisionResponse.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .itemCount(0L) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .lastModifiedBy("lastModifiedBy") .name("name") .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementJobResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementJobResponseTest.kt index f8f36df0..e500a52a 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementJobResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementJobResponseTest.kt @@ -20,6 +20,7 @@ internal class StatementJobResponseTest { .csvStatementStatus(StatementJobResponse.CsvStatementStatus.LATEST) .dtCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dtLastModified(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .filters(StatementJobResponse.Filters.builder().addMeterId("string").build()) .includeCsvFormat(true) .jsonStatementStatus(StatementJobResponse.JsonStatementStatus.LATEST) .lastModifiedBy("lastModifiedBy") @@ -39,6 +40,8 @@ internal class StatementJobResponseTest { .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(statementJobResponse.dtLastModified()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(statementJobResponse.filters()) + .contains(StatementJobResponse.Filters.builder().addMeterId("string").build()) assertThat(statementJobResponse.includeCsvFormat()).contains(true) assertThat(statementJobResponse.jsonStatementStatus()) .contains(StatementJobResponse.JsonStatementStatus.LATEST) @@ -64,6 +67,7 @@ internal class StatementJobResponseTest { .csvStatementStatus(StatementJobResponse.CsvStatementStatus.LATEST) .dtCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dtLastModified(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .filters(StatementJobResponse.Filters.builder().addMeterId("string").build()) .includeCsvFormat(true) .jsonStatementStatus(StatementJobResponse.JsonStatementStatus.LATEST) .lastModifiedBy("lastModifiedBy") diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParamsTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParamsTest.kt index 58bf4da6..bb5034a6 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParamsTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateBatchParamsTest.kt @@ -12,6 +12,11 @@ internal class StatementStatementJobCreateBatchParamsTest { StatementStatementJobCreateBatchParams.builder() .orgId("orgId") .addBillId("string") + .filters( + StatementStatementJobCreateBatchParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -32,6 +37,11 @@ internal class StatementStatementJobCreateBatchParamsTest { StatementStatementJobCreateBatchParams.builder() .orgId("orgId") .addBillId("string") + .filters( + StatementStatementJobCreateBatchParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -39,6 +49,12 @@ internal class StatementStatementJobCreateBatchParamsTest { val body = params._body() assertThat(body.billIds()).containsExactly("string") + assertThat(body.filters()) + .contains( + StatementStatementJobCreateBatchParams.Filters.builder() + .addMeterId("string") + .build() + ) assertThat(body.includeCsvFormat()).contains(true) assertThat(body.version()).contains(0L) } diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateParamsTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateParamsTest.kt index 17968246..4d0f70f3 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateParamsTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobCreateParamsTest.kt @@ -12,6 +12,9 @@ internal class StatementStatementJobCreateParamsTest { StatementStatementJobCreateParams.builder() .orgId("orgId") .billId("x") + .filters( + StatementStatementJobCreateParams.Filters.builder().addMeterId("string").build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -32,6 +35,9 @@ internal class StatementStatementJobCreateParamsTest { StatementStatementJobCreateParams.builder() .orgId("orgId") .billId("x") + .filters( + StatementStatementJobCreateParams.Filters.builder().addMeterId("string").build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -39,6 +45,10 @@ internal class StatementStatementJobCreateParamsTest { val body = params._body() assertThat(body.billId()).isEqualTo("x") + assertThat(body.filters()) + .contains( + StatementStatementJobCreateParams.Filters.builder().addMeterId("string").build() + ) assertThat(body.includeCsvFormat()).contains(true) assertThat(body.version()).contains(0L) } diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobListPageResponseTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobListPageResponseTest.kt index 3b87207e..d12ecf55 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobListPageResponseTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/models/StatementStatementJobListPageResponseTest.kt @@ -23,6 +23,9 @@ internal class StatementStatementJobListPageResponseTest { .csvStatementStatus(StatementJobResponse.CsvStatementStatus.LATEST) .dtCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dtLastModified(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .filters( + StatementJobResponse.Filters.builder().addMeterId("string").build() + ) .includeCsvFormat(true) .jsonStatementStatus(StatementJobResponse.JsonStatementStatus.LATEST) .lastModifiedBy("lastModifiedBy") @@ -45,6 +48,7 @@ internal class StatementStatementJobListPageResponseTest { .csvStatementStatus(StatementJobResponse.CsvStatementStatus.LATEST) .dtCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dtLastModified(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .filters(StatementJobResponse.Filters.builder().addMeterId("string").build()) .includeCsvFormat(true) .jsonStatementStatus(StatementJobResponse.JsonStatementStatus.LATEST) .lastModifiedBy("lastModifiedBy") @@ -71,6 +75,9 @@ internal class StatementStatementJobListPageResponseTest { .csvStatementStatus(StatementJobResponse.CsvStatementStatus.LATEST) .dtCreated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .dtLastModified(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .filters( + StatementJobResponse.Filters.builder().addMeterId("string").build() + ) .includeCsvFormat(true) .jsonStatementStatus(StatementJobResponse.JsonStatementStatus.LATEST) .lastModifiedBy("lastModifiedBy") diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncTest.kt index f3490b9a..fe554ed4 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/services/async/lookupTables/LookupTableRevisionServiceAsyncTest.kt @@ -41,16 +41,16 @@ internal class LookupTableRevisionServiceAsyncTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -116,16 +116,16 @@ internal class LookupTableRevisionServiceAsyncTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncTest.kt index 9d00d231..a264e8ac 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/services/async/statements/StatementJobServiceAsyncTest.kt @@ -31,6 +31,11 @@ internal class StatementJobServiceAsyncTest { StatementStatementJobCreateParams.builder() .orgId("orgId") .billId("x") + .filters( + StatementStatementJobCreateParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -117,6 +122,11 @@ internal class StatementJobServiceAsyncTest { StatementStatementJobCreateBatchParams.builder() .orgId("orgId") .addBillId("string") + .filters( + StatementStatementJobCreateBatchParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceTest.kt index 6990224e..e562cb6e 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/lookupTables/LookupTableRevisionServiceTest.kt @@ -41,16 +41,16 @@ internal class LookupTableRevisionServiceTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() @@ -114,16 +114,16 @@ internal class LookupTableRevisionServiceTest { .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) .addField( LookupTableRevisionRequest.Field.builder() .type(LookupTableRevisionRequest.Field.Type.STRING) - .name("lookupfield") + .name("lookuptablerevisionfieldkey") .build() ) - .keys(listOf("foo", "bar", "baz")) + .addKey("string") .name("x") .customFields( LookupTableRevisionRequest.CustomFields.builder() diff --git a/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceTest.kt b/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceTest.kt index 2245b5fe..fb09b141 100644 --- a/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceTest.kt +++ b/sdk-java-core/src/test/kotlin/com/m3ter/services/blocking/statements/StatementJobServiceTest.kt @@ -31,6 +31,11 @@ internal class StatementJobServiceTest { StatementStatementJobCreateParams.builder() .orgId("orgId") .billId("x") + .filters( + StatementStatementJobCreateParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() @@ -113,6 +118,11 @@ internal class StatementJobServiceTest { StatementStatementJobCreateBatchParams.builder() .orgId("orgId") .addBillId("string") + .filters( + StatementStatementJobCreateBatchParams.Filters.builder() + .addMeterId("string") + .build() + ) .includeCsvFormat(true) .version(0L) .build() diff --git a/sdk-java-proguard-test/build.gradle.kts b/sdk-java-proguard-test/build.gradle.kts index f75aba2b..ed8227b0 100644 --- a/sdk-java-proguard-test/build.gradle.kts +++ b/sdk-java-proguard-test/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { testImplementation(project(":sdk-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") }