diff --git a/api.md b/api.md index 1494c41..0074768 100644 --- a/api.md +++ b/api.md @@ -14,7 +14,7 @@ item from that page on, and `pages()` every page, fetching the next ones on dema the response body as received. The async client's pages have `nextPage()`, `forEach(...)`, `forEachPage(...)` and `toList()`, returning `CompletableFuture`s. -[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Checkout sessions](#checkout-sessions) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage) · [Webhook endpoints](#webhook-endpoints) · [Webhook endpoints endpoints](#webhook-endpoints-endpoints) +[Add ons](#add-ons) · [Add ons entitlements](#add-ons-entitlements) · [Batch jobs](#batch-jobs) · [Budgets](#budgets) · [Checkout sessions](#checkout-sessions) · [Checks](#checks) · [Connect](#connect) · [Coupons](#coupons) · [Credit notes](#credit-notes) · [Credit units](#credit-units) · [Credit units prices](#credit-units-prices) · [Credits](#credits) · [Credits grants](#credits-grants) · [Credits wallets](#credits-wallets) · [Custom properties](#custom-properties) · [Customers](#customers) · [Entitlements](#entitlements) · [Events](#events) · [Features](#features) · [Invoices](#invoices) · [Metrics](#metrics) · [Oauth](#oauth) · [Oauth apps](#oauth-apps) · [Plans](#plans) · [Plans versions](#plans-versions) · [Product families](#product-families) · [Products](#products) · [Products entitlements](#products-entitlements) · [Subscriptions](#subscriptions) · [Usage](#usage) · [Usage customer](#usage-customer) · [Usage costs](#usage-costs) · [Usage costs customer](#usage-costs-customer) · [Usage costs subscription](#usage-costs-subscription) · [Webhook endpoints](#webhook-endpoints) · [Webhook endpoints endpoints](#webhook-endpoints-endpoints) ## Add ons @@ -48,6 +48,17 @@ the response body as received. The async client's pages have `nextPage()`, `forE | `BatchJobDetailResponse client.batchJobs().retrieve(String batchJobId)` | `GET /api/v1/batch-jobs/{batch_job_id}` | [`BatchJobDetailResponse`](src/main/java/com/meteroid/models/BatchJobDetailResponse.java) | | `BatchJobsListFailuresPage client.batchJobs().listFailures(String batchJobId, [BatchJobsListFailuresOptions options])` | `GET /api/v1/batch-jobs/{batch_job_id}/failures` | [page](src/main/java/com/meteroid/api/BatchJobsListFailuresPage.java) of [`BatchJobItemFailureResponse`](src/main/java/com/meteroid/models/BatchJobItemFailureResponse.java), with the properties of [`BatchJobFailuresResponse`](src/main/java/com/meteroid/models/BatchJobFailuresResponse.java) | +## Budgets + +[`client.budgets()`](src/main/java/com/meteroid/api/Budgets.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `BudgetsListPage client.budgets().list(String idOrAlias, [BudgetsListOptions options])` | `GET /api/v1/customers/{id_or_alias}/budgets` | [page](src/main/java/com/meteroid/api/BudgetsListPage.java) of [`Budget`](src/main/java/com/meteroid/models/Budget.java), with the properties of [`BudgetListResponse`](src/main/java/com/meteroid/models/BudgetListResponse.java) | +| `Budget client.budgets().create(String idOrAlias, String idempotencyKey, CreateBudgetRequest createBudgetRequest)` | `POST /api/v1/customers/{id_or_alias}/budgets` | [`Budget`](src/main/java/com/meteroid/models/Budget.java) | +| `Budget client.budgets().update(String idOrAlias, String budgetId, String idempotencyKey, PatchBudgetRequest patchBudgetRequest)` | `PATCH /api/v1/customers/{id_or_alias}/budgets/{budget_id}` | [`Budget`](src/main/java/com/meteroid/models/Budget.java) | +| `Budget client.budgets().archive(String idOrAlias, String budgetId, String idempotencyKey)` | `POST /api/v1/customers/{id_or_alias}/budgets/{budget_id}/archive` | [`Budget`](src/main/java/com/meteroid/models/Budget.java) | + ## Checkout sessions [`client.checkoutSessions()`](src/main/java/com/meteroid/api/CheckoutSessions.java) @@ -59,6 +70,14 @@ the response body as received. The async client's pages have `nextPage()`, `forE | `GetCheckoutSessionResponse client.checkoutSessions().retrieve(String id)` | `GET /api/v1/checkout-sessions/{id}` | [`GetCheckoutSessionResponse`](src/main/java/com/meteroid/models/GetCheckoutSessionResponse.java) | | `CancelCheckoutSessionResponse client.checkoutSessions().cancel(String id)` | `POST /api/v1/checkout-sessions/{id}/cancel` | [`CancelCheckoutSessionResponse`](src/main/java/com/meteroid/models/CancelCheckoutSessionResponse.java) | +## Checks + +[`client.checks()`](src/main/java/com/meteroid/api/Checks.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `EntitlementCheck client.checks().checkEntitlement(String idOrAlias, String featureIdOrCode, [ChecksCheckEntitlementOptions options])` | `GET /api/v1/customers/{id_or_alias}/entitlements/{feature_id_or_code}/check` | [`EntitlementCheck`](src/main/java/com/meteroid/models/EntitlementCheck.java) | + ## Connect [`client.connect()`](src/main/java/com/meteroid/api/Connect.java) @@ -66,7 +85,7 @@ the response body as received. The async client's pages have `nextPage()`, `forE | Method | Request | Returns | | --- | --- | --- | | `ConnectedAccountsResponse client.connect().listConnectedAccounts()` | `GET /api/v1/connected-accounts` | [`ConnectedAccountsResponse`](src/main/java/com/meteroid/models/ConnectedAccountsResponse.java) | -| `ConnectedAccount client.connect().createConnectedAccount(CreateConnectedAccountRequest createConnectedAccountRequest)` | `POST /api/v1/connected-accounts` | [`ConnectedAccount`](src/main/java/com/meteroid/models/ConnectedAccount.java) | +| `CreateConnectedAccountResponse client.connect().createConnectedAccount(CreateConnectedAccountRequest createConnectedAccountRequest)` | `POST /api/v1/connected-accounts` | [`CreateConnectedAccountResponse`](src/main/java/com/meteroid/models/CreateConnectedAccountResponse.java) | | `ConnectedAccount client.connect().retrieveConnectedAccount(String id)` | `GET /api/v1/connected-accounts/{id}` | [`ConnectedAccount`](src/main/java/com/meteroid/models/ConnectedAccount.java) | | `void client.connect().disconnectAccount(String id)` | `DELETE /api/v1/connected-accounts/{id}` | nothing | | `OnboardingLinkResponse client.connect().createOnboardingLink(String id, CreateOnboardingLinkRequest createOnboardingLinkRequest)` | `POST /api/v1/connected-accounts/{id}/onboarding` | [`OnboardingLinkResponse`](src/main/java/com/meteroid/models/OnboardingLinkResponse.java) | @@ -98,6 +117,55 @@ the response body as received. The async client's pages have `nextPage()`, `forE | `byte[] client.creditNotes().download(String creditNoteId)` | `GET /api/v1/credit-notes/{credit_note_id}/download` | bytes | | `byte[] client.creditNotes().downloadXml(String creditNoteId)` | `GET /api/v1/credit-notes/{credit_note_id}/xml` | bytes | +## Credit units + +[`client.creditUnits()`](src/main/java/com/meteroid/api/CreditUnits.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `CreditUnitListResponse client.creditUnits().list([CreditUnitsListOptions options])` | `GET /api/v1/credit-units` | [`CreditUnitListResponse`](src/main/java/com/meteroid/models/CreditUnitListResponse.java) | +| `CreditUnit client.creditUnits().create(CreditUnitCreateRequest creditUnitCreateRequest)` | `POST /api/v1/credit-units` | [`CreditUnit`](src/main/java/com/meteroid/models/CreditUnit.java) | +| `CreditUnit client.creditUnits().retrieve(String id)` | `GET /api/v1/credit-units/{id}` | [`CreditUnit`](src/main/java/com/meteroid/models/CreditUnit.java) | +| `CreditUnit client.creditUnits().update(String id, CreditUnitUpdateRequest creditUnitUpdateRequest)` | `PATCH /api/v1/credit-units/{id}` | [`CreditUnit`](src/main/java/com/meteroid/models/CreditUnit.java) | + +### Credit units prices + +[`client.creditUnits().prices()`](src/main/java/com/meteroid/api/CreditUnitsPrices.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `CreditUnitPriceListResponse client.creditUnits().prices().list(String id, [CreditUnitsPricesListOptions options])` | `GET /api/v1/credit-units/{id}/prices` | [`CreditUnitPriceListResponse`](src/main/java/com/meteroid/models/CreditUnitPriceListResponse.java) | +| `CreditUnitPrice client.creditUnits().prices().update(String id, String currency, CreditUnitPriceSetRequest creditUnitPriceSetRequest)` | `PUT /api/v1/credit-units/{id}/prices/{currency}` | [`CreditUnitPrice`](src/main/java/com/meteroid/models/CreditUnitPrice.java) | +| `CreditUnitPrice client.creditUnits().prices().archive(String id, String currency)` | `DELETE /api/v1/credit-units/{id}/prices/{currency}` | [`CreditUnitPrice`](src/main/java/com/meteroid/models/CreditUnitPrice.java) | + +## Credits + +[`client.credits()`](src/main/java/com/meteroid/api/Credits.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `CreditsListCustomerCreditLedgerPage client.credits().listCustomerCreditLedger(String idOrAlias, [CreditsListCustomerCreditLedgerOptions options])` | `GET /api/v1/customers/{id_or_alias}/credit-ledger` | [page](src/main/java/com/meteroid/api/CreditsListCustomerCreditLedgerPage.java) of [`LedgerEntry`](src/main/java/com/meteroid/models/LedgerEntry.java), with the properties of [`LedgerListResponse`](src/main/java/com/meteroid/models/LedgerListResponse.java) | +| `TopUpResponse client.credits().createCustomerTopUp(String idOrAlias, String idempotencyKey, CreateTopUpRequest createTopUpRequest)` | `POST /api/v1/customers/{id_or_alias}/top-ups` | [`TopUpResponse`](src/main/java/com/meteroid/models/TopUpResponse.java) | + +### Credits grants + +[`client.credits().grants()`](src/main/java/com/meteroid/api/CreditsGrants.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `CreditsGrantsListPage client.credits().grants().list(String idOrAlias, [CreditsGrantsListOptions options])` | `GET /api/v1/customers/{id_or_alias}/credit-grants` | [page](src/main/java/com/meteroid/api/CreditsGrantsListPage.java) of [`CreditGrant`](src/main/java/com/meteroid/models/CreditGrant.java), with the properties of [`CreditGrantListResponse`](src/main/java/com/meteroid/models/CreditGrantListResponse.java) | +| `CreditGrant client.credits().grants().create(String idOrAlias, String idempotencyKey, CreateCreditGrantRequest createCreditGrantRequest)` | `POST /api/v1/customers/{id_or_alias}/credit-grants` | [`CreditGrant`](src/main/java/com/meteroid/models/CreditGrant.java) | + +### Credits wallets + +[`client.credits().wallets()`](src/main/java/com/meteroid/api/CreditsWallets.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `WalletListResponse client.credits().wallets().list(String idOrAlias, [CreditsWalletsListOptions options])` | `GET /api/v1/customers/{id_or_alias}/wallets` | [`WalletListResponse`](src/main/java/com/meteroid/models/WalletListResponse.java) | +| `WalletCheck client.credits().wallets().check(String idOrAlias, [CreditsWalletsCheckOptions options])` | `GET /api/v1/customers/{id_or_alias}/wallets/check` | [`WalletCheck`](src/main/java/com/meteroid/models/WalletCheck.java) | +| `Wallet client.credits().wallets().update(String idOrAlias, String currency, String idempotencyKey, PatchWalletRequest patchWalletRequest)` | `PATCH /api/v1/customers/{id_or_alias}/wallets/{currency}` | [`Wallet`](src/main/java/com/meteroid/models/Wallet.java) | + ## Custom properties [`client.customProperties()`](src/main/java/com/meteroid/api/CustomProperties.java) @@ -284,10 +352,43 @@ the response body as received. The async client's pages have `nextPage()`, `forE | Method | Request | Returns | | --- | --- | --- | -| `UsageResponse client.usage().retrieveCustomer(String customerId, LocalDate startDate, LocalDate endDate, [UsageRetrieveCustomerOptions options])` | `GET /api/v1/usage/customer/{customer_id}` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) | | `UsageResponse client.usage().retrieveSubscription(String subscriptionId, [UsageRetrieveSubscriptionOptions options])` | `GET /api/v1/usage/subscription/{subscription_id}` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) | | `UsageResponse client.usage().retrieveSummary(LocalDate startDate, LocalDate endDate, [UsageRetrieveSummaryOptions options])` | `GET /api/v1/usage/summary` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) | +### Usage customer + +[`client.usage().customer()`](src/main/java/com/meteroid/api/UsageCustomer.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `UsageResponse client.usage().customer().retrieve(String customerId, LocalDate startDate, LocalDate endDate, [UsageCustomerRetrieveOptions options])` | `GET /api/v1/usage/customer/{customer_id}` | [`UsageResponse`](src/main/java/com/meteroid/models/UsageResponse.java) | +| `UnattributedUsageResponse client.usage().customer().retrieveUnattributed(String customerId, [UsageCustomerRetrieveUnattributedOptions options])` | `GET /api/v1/usage/customer/{customer_id}/unattributed` | [`UnattributedUsageResponse`](src/main/java/com/meteroid/models/UnattributedUsageResponse.java) | + +## Usage costs + +[`client.usageCosts()`](src/main/java/com/meteroid/api/UsageCosts.java) + +| Method | Request | Returns | +| --- | --- | --- | + +### Usage costs customer + +[`client.usageCosts().customer()`](src/main/java/com/meteroid/api/UsageCostsCustomer.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `UsageCostListResponse client.usageCosts().customer().listCosts(String customerId, String metric, ListCustomerUsageCostsGranularity granularity, OffsetDateTime from, OffsetDateTime to, [UsageCostsCustomerListCostsOptions options])` | `GET /api/v1/usage/customer/{customer_id}/costs` | [`UsageCostListResponse`](src/main/java/com/meteroid/models/UsageCostListResponse.java) | +| `UsageEventListResponse client.usageCosts().customer().listEvents(String customerId, String metric, OffsetDateTime from, OffsetDateTime to, [UsageCostsCustomerListEventsOptions options])` | `GET /api/v1/usage/customer/{customer_id}/events` | [`UsageEventListResponse`](src/main/java/com/meteroid/models/UsageEventListResponse.java) | + +### Usage costs subscription + +[`client.usageCosts().subscription()`](src/main/java/com/meteroid/api/UsageCostsSubscription.java) + +| Method | Request | Returns | +| --- | --- | --- | +| `UsageCostListResponse client.usageCosts().subscription().listCosts(String subscriptionId, String metric, ListSubscriptionUsageCostsGranularity granularity, OffsetDateTime from, OffsetDateTime to, [UsageCostsSubscriptionListCostsOptions options])` | `GET /api/v1/usage/subscription/{subscription_id}/costs` | [`UsageCostListResponse`](src/main/java/com/meteroid/models/UsageCostListResponse.java) | +| `UsageEventListResponse client.usageCosts().subscription().listEvents(String subscriptionId, String metric, OffsetDateTime from, OffsetDateTime to, [UsageCostsSubscriptionListEventsOptions options])` | `GET /api/v1/usage/subscription/{subscription_id}/events` | [`UsageEventListResponse`](src/main/java/com/meteroid/models/UsageEventListResponse.java) | + ## Webhook endpoints [`client.webhookEndpoints()`](src/main/java/com/meteroid/api/WebhookEndpoints.java) diff --git a/src/main/java/com/meteroid/Meteroid.java b/src/main/java/com/meteroid/Meteroid.java index 02ab491..255a7f4 100644 --- a/src/main/java/com/meteroid/Meteroid.java +++ b/src/main/java/com/meteroid/Meteroid.java @@ -3,10 +3,14 @@ import com.meteroid.api.AddOns; import com.meteroid.api.BatchJobs; +import com.meteroid.api.Budgets; import com.meteroid.api.CheckoutSessions; +import com.meteroid.api.Checks; import com.meteroid.api.Connect; import com.meteroid.api.Coupons; import com.meteroid.api.CreditNotes; +import com.meteroid.api.CreditUnits; +import com.meteroid.api.Credits; import com.meteroid.api.CustomProperties; import com.meteroid.api.Customers; import com.meteroid.api.Entitlements; @@ -21,6 +25,7 @@ import com.meteroid.api.Products; import com.meteroid.api.Subscriptions; import com.meteroid.api.Usage; +import com.meteroid.api.UsageCosts; import com.meteroid.api.WebhookEndpoints; import com.meteroid.internal.MeteroidAuth; import com.meteroid.internal.MeteroidHttpClient; @@ -58,10 +63,14 @@ public final class Meteroid implements AutoCloseable { private final MeteroidAsync async; private final AddOns addOns; private final BatchJobs batchJobs; + private final Budgets budgets; private final CheckoutSessions checkoutSessions; + private final Checks checks; private final Connect connect; private final Coupons coupons; private final CreditNotes creditNotes; + private final CreditUnits creditUnits; + private final Credits credits; private final CustomProperties customProperties; private final Customers customers; private final Entitlements entitlements; @@ -76,6 +85,7 @@ public final class Meteroid implements AutoCloseable { private final Products products; private final Subscriptions subscriptions; private final Usage usage; + private final UsageCosts usageCosts; private final WebhookEndpoints webhookEndpoints; /** @@ -131,10 +141,14 @@ public Meteroid(MeteroidOptions options) { this.httpClient = new MeteroidHttpClient(parsedUrl, defaultHeaders, options, auth); this.addOns = new AddOns(httpClient); this.batchJobs = new BatchJobs(httpClient); + this.budgets = new Budgets(httpClient); this.checkoutSessions = new CheckoutSessions(httpClient); + this.checks = new Checks(httpClient); this.connect = new Connect(httpClient); this.coupons = new Coupons(httpClient); this.creditNotes = new CreditNotes(httpClient); + this.creditUnits = new CreditUnits(httpClient); + this.credits = new Credits(httpClient); this.customProperties = new CustomProperties(httpClient); this.customers = new Customers(httpClient); this.entitlements = new Entitlements(httpClient); @@ -149,6 +163,7 @@ public Meteroid(MeteroidOptions options) { this.products = new Products(httpClient); this.subscriptions = new Subscriptions(httpClient); this.usage = new Usage(httpClient); + this.usageCosts = new UsageCosts(httpClient); this.webhookEndpoints = new WebhookEndpoints(httpClient); this.withRawResponse = new WithRawResponse(); this.async = new MeteroidAsync(this); @@ -213,6 +228,15 @@ public BatchJobs batchJobs() { return batchJobs; } + /** + * The {@code budgets} operations. + * + * @return the operations + */ + public Budgets budgets() { + return budgets; + } + /** * The {@code checkout_sessions} operations. * @@ -222,6 +246,15 @@ public CheckoutSessions checkoutSessions() { return checkoutSessions; } + /** + * The {@code checks} operations. + * + * @return the operations + */ + public Checks checks() { + return checks; + } + /** * The {@code connect} operations. * @@ -249,6 +282,24 @@ public CreditNotes creditNotes() { return creditNotes; } + /** + * The {@code credit_units} operations. + * + * @return the operations + */ + public CreditUnits creditUnits() { + return creditUnits; + } + + /** + * The {@code credits} operations. + * + * @return the operations + */ + public Credits credits() { + return credits; + } + /** * The {@code custom_properties} operations. * @@ -375,6 +426,15 @@ public Usage usage() { return usage; } + /** + * The {@code usage_costs} operations. + * + * @return the operations + */ + public UsageCosts usageCosts() { + return usageCosts; + } + /** * The {@code webhook_endpoints} operations. * @@ -406,6 +466,15 @@ public BatchJobs.WithRawResponse batchJobs() { return batchJobs.withRawResponse(); } + /** + * The {@code budgets} operations. + * + * @return the operations + */ + public Budgets.WithRawResponse budgets() { + return budgets.withRawResponse(); + } + /** * The {@code checkout_sessions} operations. * @@ -415,6 +484,15 @@ public CheckoutSessions.WithRawResponse checkoutSessions() { return checkoutSessions.withRawResponse(); } + /** + * The {@code checks} operations. + * + * @return the operations + */ + public Checks.WithRawResponse checks() { + return checks.withRawResponse(); + } + /** * The {@code connect} operations. * @@ -442,6 +520,24 @@ public CreditNotes.WithRawResponse creditNotes() { return creditNotes.withRawResponse(); } + /** + * The {@code credit_units} operations. + * + * @return the operations + */ + public CreditUnits.WithRawResponse creditUnits() { + return creditUnits.withRawResponse(); + } + + /** + * The {@code credits} operations. + * + * @return the operations + */ + public Credits.WithRawResponse credits() { + return credits.withRawResponse(); + } + /** * The {@code custom_properties} operations. * @@ -568,6 +664,15 @@ public Usage.WithRawResponse usage() { return usage.withRawResponse(); } + /** + * The {@code usage_costs} operations. + * + * @return the operations + */ + public UsageCosts.WithRawResponse usageCosts() { + return usageCosts.withRawResponse(); + } + /** * The {@code webhook_endpoints} operations. * diff --git a/src/main/java/com/meteroid/MeteroidAsync.java b/src/main/java/com/meteroid/MeteroidAsync.java index 664ea14..6d22b7d 100644 --- a/src/main/java/com/meteroid/MeteroidAsync.java +++ b/src/main/java/com/meteroid/MeteroidAsync.java @@ -3,10 +3,14 @@ import com.meteroid.api.AddOnsAsync; import com.meteroid.api.BatchJobsAsync; +import com.meteroid.api.BudgetsAsync; import com.meteroid.api.CheckoutSessionsAsync; +import com.meteroid.api.ChecksAsync; import com.meteroid.api.ConnectAsync; import com.meteroid.api.CouponsAsync; import com.meteroid.api.CreditNotesAsync; +import com.meteroid.api.CreditUnitsAsync; +import com.meteroid.api.CreditsAsync; import com.meteroid.api.CustomPropertiesAsync; import com.meteroid.api.CustomersAsync; import com.meteroid.api.EntitlementsAsync; @@ -21,6 +25,7 @@ import com.meteroid.api.ProductsAsync; import com.meteroid.api.SubscriptionsAsync; import com.meteroid.api.UsageAsync; +import com.meteroid.api.UsageCostsAsync; import com.meteroid.api.WebhookEndpointsAsync; /** @@ -33,10 +38,14 @@ public final class MeteroidAsync implements AutoCloseable { private final WithRawResponse withRawResponse; private final AddOnsAsync addOns; private final BatchJobsAsync batchJobs; + private final BudgetsAsync budgets; private final CheckoutSessionsAsync checkoutSessions; + private final ChecksAsync checks; private final ConnectAsync connect; private final CouponsAsync coupons; private final CreditNotesAsync creditNotes; + private final CreditUnitsAsync creditUnits; + private final CreditsAsync credits; private final CustomPropertiesAsync customProperties; private final CustomersAsync customers; private final EntitlementsAsync entitlements; @@ -51,16 +60,21 @@ public final class MeteroidAsync implements AutoCloseable { private final ProductsAsync products; private final SubscriptionsAsync subscriptions; private final UsageAsync usage; + private final UsageCostsAsync usageCosts; private final WebhookEndpointsAsync webhookEndpoints; MeteroidAsync(Meteroid sync) { this.sync = sync; this.addOns = new AddOnsAsync(sync.addOns()); this.batchJobs = new BatchJobsAsync(sync.batchJobs()); + this.budgets = new BudgetsAsync(sync.budgets()); this.checkoutSessions = new CheckoutSessionsAsync(sync.checkoutSessions()); + this.checks = new ChecksAsync(sync.checks()); this.connect = new ConnectAsync(sync.connect()); this.coupons = new CouponsAsync(sync.coupons()); this.creditNotes = new CreditNotesAsync(sync.creditNotes()); + this.creditUnits = new CreditUnitsAsync(sync.creditUnits()); + this.credits = new CreditsAsync(sync.credits()); this.customProperties = new CustomPropertiesAsync(sync.customProperties()); this.customers = new CustomersAsync(sync.customers()); this.entitlements = new EntitlementsAsync(sync.entitlements()); @@ -75,6 +89,7 @@ public final class MeteroidAsync implements AutoCloseable { this.products = new ProductsAsync(sync.products()); this.subscriptions = new SubscriptionsAsync(sync.subscriptions()); this.usage = new UsageAsync(sync.usage()); + this.usageCosts = new UsageCostsAsync(sync.usageCosts()); this.webhookEndpoints = new WebhookEndpointsAsync(sync.webhookEndpoints()); this.withRawResponse = new WithRawResponse(); } @@ -115,6 +130,15 @@ public BatchJobsAsync batchJobs() { return batchJobs; } + /** + * The {@code budgets} operations. + * + * @return the operations + */ + public BudgetsAsync budgets() { + return budgets; + } + /** * The {@code checkout_sessions} operations. * @@ -124,6 +148,15 @@ public CheckoutSessionsAsync checkoutSessions() { return checkoutSessions; } + /** + * The {@code checks} operations. + * + * @return the operations + */ + public ChecksAsync checks() { + return checks; + } + /** * The {@code connect} operations. * @@ -151,6 +184,24 @@ public CreditNotesAsync creditNotes() { return creditNotes; } + /** + * The {@code credit_units} operations. + * + * @return the operations + */ + public CreditUnitsAsync creditUnits() { + return creditUnits; + } + + /** + * The {@code credits} operations. + * + * @return the operations + */ + public CreditsAsync credits() { + return credits; + } + /** * The {@code custom_properties} operations. * @@ -277,6 +328,15 @@ public UsageAsync usage() { return usage; } + /** + * The {@code usage_costs} operations. + * + * @return the operations + */ + public UsageCostsAsync usageCosts() { + return usageCosts; + } + /** * The {@code webhook_endpoints} operations. * @@ -314,6 +374,15 @@ public BatchJobsAsync.WithRawResponse batchJobs() { return batchJobs.withRawResponse(); } + /** + * The {@code budgets} operations. + * + * @return the operations + */ + public BudgetsAsync.WithRawResponse budgets() { + return budgets.withRawResponse(); + } + /** * The {@code checkout_sessions} operations. * @@ -323,6 +392,15 @@ public CheckoutSessionsAsync.WithRawResponse checkoutSessions() { return checkoutSessions.withRawResponse(); } + /** + * The {@code checks} operations. + * + * @return the operations + */ + public ChecksAsync.WithRawResponse checks() { + return checks.withRawResponse(); + } + /** * The {@code connect} operations. * @@ -350,6 +428,24 @@ public CreditNotesAsync.WithRawResponse creditNotes() { return creditNotes.withRawResponse(); } + /** + * The {@code credit_units} operations. + * + * @return the operations + */ + public CreditUnitsAsync.WithRawResponse creditUnits() { + return creditUnits.withRawResponse(); + } + + /** + * The {@code credits} operations. + * + * @return the operations + */ + public CreditsAsync.WithRawResponse credits() { + return credits.withRawResponse(); + } + /** * The {@code custom_properties} operations. * @@ -476,6 +572,15 @@ public UsageAsync.WithRawResponse usage() { return usage.withRawResponse(); } + /** + * The {@code usage_costs} operations. + * + * @return the operations + */ + public UsageCostsAsync.WithRawResponse usageCosts() { + return usageCosts.withRawResponse(); + } + /** * The {@code webhook_endpoints} operations. * diff --git a/src/main/java/com/meteroid/api/Budgets.java b/src/main/java/com/meteroid/api/Budgets.java new file mode 100644 index 0000000..c6600fa --- /dev/null +++ b/src/main/java/com/meteroid/api/Budgets.java @@ -0,0 +1,662 @@ +// this file is @generated +package com.meteroid.api; + +import com.meteroid.ApiResponse; +import com.meteroid.RequestOptions; +import com.meteroid.internal.MeteroidHttpClient; +import com.meteroid.internal.Utils; +import com.meteroid.models.Budget; +import com.meteroid.models.BudgetListResponse; +import com.meteroid.models.CreateBudgetRequest; +import com.meteroid.models.PatchBudgetRequest; + +import okhttp3.Headers; +import okhttp3.HttpUrl; + +import java.util.List; +import java.util.Objects; + +/** + * The {@code budgets} operations, blocking. {@link #withRawResponse()} has the same methods + * returning the status and headers along with the body. + */ +public final class Budgets { + private final MeteroidHttpClient client; + private final WithRawResponse withRawResponse; + + /** + * The operations, sending through {@code client}. + * + * @param client the HTTP client of the SDK + */ + public Budgets(MeteroidHttpClient client) { + this.client = client; + this.withRawResponse = new WithRawResponse(); + } + + /** + * The same operations, returning the status and headers along with the body. + * + * @return the operations + */ + public WithRawResponse withRawResponse() { + return withRawResponse; + } + + /** + * List budgets + * + *
A customer's budgets, oldest first, with their estimated spend in the current billing + * period. Archived ones are left out unless requested. + * + *
Beta: the request and response shapes of this endpoint may change before general + * availability. + * + * @param idOrAlias the {@code id_or_alias} path parameter + * @return the page: the response body, its items and the way to the next pages + */ + public BudgetsListPage list(final String idOrAlias) { + return list(idOrAlias, BudgetsListOptions.none(), RequestOptions.none()); + } + + /** + * List budgets + * + *
A customer's budgets, oldest first, with their estimated spend in the current billing + * period. Archived ones are left out unless requested. + * + *
Beta: the request and response shapes of this endpoint may change before general + * availability. + * + * @param idOrAlias the {@code id_or_alias} path parameter + * @param options the optional parameters + * @return the page: the response body, its items and the way to the next pages + */ + public BudgetsListPage list(final String idOrAlias, final BudgetsListOptions options) { + return list(idOrAlias, options, RequestOptions.none()); + } + + /** + * List budgets + * + *
A customer's budgets, oldest first, with their estimated spend in the current billing + * period. Archived ones are left out unless requested. + * + *
Beta: the request and response shapes of this endpoint may change before general + * availability. + * + * @param idOrAlias the {@code id_or_alias} path parameter + * @param requestOptions headers, timeout and retries of this call + * @return the page: the response body, its items and the way to the next pages + */ + public BudgetsListPage list(final String idOrAlias, final RequestOptions requestOptions) { + return list(idOrAlias, BudgetsListOptions.none(), requestOptions); + } + + /** + * List budgets + * + *
A customer's budgets, oldest first, with their estimated spend in the current billing + * period. Archived ones are left out unless requested. + * + *
Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page: the response body, its items and the way to the next pages
+ */
+ public BudgetsListPage list(
+ final String idOrAlias,
+ final BudgetsListOptions options,
+ final RequestOptions requestOptions) {
+ return pageOfList(
+ exchangeList(idOrAlias, options, requestOptions).send(),
+ idOrAlias,
+ options,
+ requestOptions);
+ }
+
+ MeteroidHttpClient.Exchange Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has one
+ * active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @return the response body
+ */
+ public Budget create(
+ final String idOrAlias,
+ final String idempotencyKey,
+ final CreateBudgetRequest createBudgetRequest) {
+ return create(idOrAlias, idempotencyKey, createBudgetRequest, RequestOptions.none());
+ }
+
+ /**
+ * Create a budget
+ *
+ * Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has one
+ * active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public Budget create(
+ final String idOrAlias,
+ final String idempotencyKey,
+ final CreateBudgetRequest createBudgetRequest,
+ final RequestOptions requestOptions) {
+ return exchangeCreate(idOrAlias, idempotencyKey, createBudgetRequest, requestOptions)
+ .send();
+ }
+
+ MeteroidHttpClient.Exchange Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @return the response body
+ */
+ public Budget update(
+ final String idOrAlias,
+ final String budgetId,
+ final String idempotencyKey,
+ final PatchBudgetRequest patchBudgetRequest) {
+ return update(
+ idOrAlias, budgetId, idempotencyKey, patchBudgetRequest, RequestOptions.none());
+ }
+
+ /**
+ * Update a budget
+ *
+ * Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public Budget update(
+ final String idOrAlias,
+ final String budgetId,
+ final String idempotencyKey,
+ final PatchBudgetRequest patchBudgetRequest,
+ final RequestOptions requestOptions) {
+ return exchangeUpdate(
+ idOrAlias, budgetId, idempotencyKey, patchBudgetRequest, requestOptions)
+ .send();
+ }
+
+ MeteroidHttpClient.Exchange Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @return the response body
+ */
+ public Budget archive(
+ final String idOrAlias, final String budgetId, final String idempotencyKey) {
+ return archive(idOrAlias, budgetId, idempotencyKey, RequestOptions.none());
+ }
+
+ /**
+ * Archive a budget
+ *
+ * Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public Budget archive(
+ final String idOrAlias,
+ final String budgetId,
+ final String idempotencyKey,
+ final RequestOptions requestOptions) {
+ return exchangeArchive(idOrAlias, budgetId, idempotencyKey, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @return the status, headers and page
+ */
+ public ApiResponse A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and page
+ */
+ public ApiResponse A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page
+ */
+ public ApiResponse A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page
+ */
+ public ApiResponse Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has
+ * one active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @return the status, headers and body
+ */
+ public ApiResponse Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has
+ * one active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @return the status, headers and body
+ */
+ public ApiResponse Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @return the page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @return the page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the page, once received
+ */
+ public CompletableFuture Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has one
+ * active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @return the response body, once received
+ */
+ public CompletableFuture Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has one
+ * active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @return the response body, once received
+ */
+ public CompletableFuture Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture A customer's budgets, oldest first, with their estimated spend in the current billing
+ * period. Archived ones are left out unless requested.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and page, once received
+ */
+ public CompletableFuture Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has
+ * one active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Sets a spending limit for one currency the customer is billed in, with alerts at
+ * percentages of it, on the customer's whole spend or on one subscription's. A customer has
+ * one active budget per currency, and per subscription.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param createBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Changes the amount, thresholds or behavior. Send the Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param patchBudgetRequest the request body
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Stops the budget from sending alerts and, for a HARD budget, from refusing access.
+ * Archiving an archived budget returns it unchanged.
+ *
+ * Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param budgetId the {@code budget_id} path parameter
+ * @param idempotencyKey the {@code Idempotency-Key} required parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Iterating it yields every item from this page on, fetching the next pages as the iteration
+ * goes.
+ */
+public final class BudgetsListPage extends Page Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @return the response body
+ */
+ public EntitlementCheck checkEntitlement(final String idOrAlias, final String featureIdOrCode) {
+ return checkEntitlement(
+ idOrAlias,
+ featureIdOrCode,
+ ChecksCheckEntitlementOptions.none(),
+ RequestOptions.none());
+ }
+
+ /**
+ * Check customer entitlement
+ *
+ * Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @return the response body
+ */
+ public EntitlementCheck checkEntitlement(
+ final String idOrAlias,
+ final String featureIdOrCode,
+ final ChecksCheckEntitlementOptions options) {
+ return checkEntitlement(idOrAlias, featureIdOrCode, options, RequestOptions.none());
+ }
+
+ /**
+ * Check customer entitlement
+ *
+ * Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public EntitlementCheck checkEntitlement(
+ final String idOrAlias,
+ final String featureIdOrCode,
+ final RequestOptions requestOptions) {
+ return checkEntitlement(
+ idOrAlias, featureIdOrCode, ChecksCheckEntitlementOptions.none(), requestOptions);
+ }
+
+ /**
+ * Check customer entitlement
+ *
+ * Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body
+ */
+ public EntitlementCheck checkEntitlement(
+ final String idOrAlias,
+ final String featureIdOrCode,
+ final ChecksCheckEntitlementOptions options,
+ final RequestOptions requestOptions) {
+ return exchangeCheckEntitlement(idOrAlias, featureIdOrCode, options, requestOptions).send();
+ }
+
+ MeteroidHttpClient.Exchange Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @return the status, headers and body
+ */
+ public ApiResponse Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and body
+ */
+ public ApiResponse Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body
+ */
+ public ApiResponse Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @return the response body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @return the response body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the response body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFuture Whether the customer may consume The answer reflects usage up to Beta: the request and response shapes of this endpoint may change before general
+ * availability.
+ *
+ * @param idOrAlias the {@code id_or_alias} path parameter
+ * @param featureIdOrCode the {@code feature_id_or_code} path parameter
+ * @param options the optional parameters
+ * @param requestOptions headers, timeout and retries of this call
+ * @return the status, headers and body, once received
+ */
+ public CompletableFutureversion you read as
+ * expected_version; a newer stored version, for instance after the customer edited
+ * it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer edited
+ * it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer
+ * edited it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer
+ * edited it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer edited
+ * it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer edited
+ * it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer
+ * edited it, is refused with 409.
+ *
+ * version you read as
+ * expected_version; a newer stored version, for instance after the customer
+ * edited it, is refused with 409.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now, given
+ * their entitlement, the hard budgets that count the feature's usage, and their prepaid credit.
+ * Boolean features answer from their enabled state; config features grant access and return
+ * their value. An ALLOW limit never refuses: in_overage
+ * tells when the requested units go beyond it. Sliding windows send no threshold webhooks. Pass
+ * the group as group[<property>]=<value>: it is required when the
+ * entitlement is grouped. Pass subscription_id when the usage belongs to one
+ * subscription, so that a hard budget on another subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old, and
+ * less than 10 seconds old once near_limit is true. A hard limit can therefore be
+ * exceeded by the usage of those few seconds. While near_limit is true, check
+ * before every request with its actual requested and do not cache the answer;
+ * retry_after_ms says when to check again. Use the check to gate access, not to
+ * bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * requested more of a feature right now,
+ * given their entitlement, the hard budgets that count the feature's usage, and their
+ * prepaid credit. Boolean features answer from their enabled state; config features grant
+ * access and return their value. An ALLOW limit never refuses:
+ * in_overage tells when the requested units go beyond it. Sliding windows send
+ * no threshold webhooks. Pass the group as group[<property>]=<value>
+ * : it is required when the entitlement is grouped. Pass subscription_id
+ * when the usage belongs to one subscription, so that a hard budget on another
+ * subscription does not refuse it.
+ *
+ * as_of: typically less than a minute old,
+ * and less than 10 seconds old once near_limit is true. A hard limit can
+ * therefore be exceeded by the usage of those few seconds. While near_limit is
+ * true, check before every request with its actual requested and do not cache
+ * the answer; retry_after_ms says when to check again. Use the check to gate
+ * access, not to bill.
+ *
+ * sub_…) the usage belongs to: only its own budgets and the
+ * customer-wide ones apply. Without it, a budget on one subscription refuses only once every
+ * subscription charging the feature's metric is refused by its own budget.
+ *
+ * @return the value, empty when unset
+ */
+ public Optionalgroup[<property>]=<value>: required when the
+ * entitlement is grouped
+ *
+ * @return the value, empty when unset
+ */
+ public Optional