diff --git a/.gitignore b/.gitignore index f678a1b..28f4f0c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,4 @@ hs_err_pid* target .gradle build -.DS_Store .idea diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 30acccc..3b06485 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -24,6 +24,7 @@ docs/Computation.md docs/ComputeRevenueSummaryRequest.md docs/ComputeRevenueSummaryResponse.md docs/CreateAccountRequest.md +docs/CreateAccountRequestWithoutCustomerId.md docs/CreateAddOnRequest.md docs/CreateCreditRequest.md docs/CreateCustomerRequest.md @@ -48,6 +49,7 @@ docs/CustomerPaginatedResponse.md docs/CustomersApi.md docs/Dependency.md docs/DimensionsSchema.md +docs/EditPricingScheduleRequest.md docs/EnrichedField.md docs/EnrichmentDependency.md docs/Enrichments.md @@ -69,19 +71,19 @@ docs/EventSchemaListDataAllOf.md docs/EventSchemaListPaginatedResponse.md docs/EventSchemaVersionsResponse.md docs/EventSchemasApi.md +docs/EventSource.md docs/EventWithStatus.md docs/EventWithStatusAndEventPipelineInfo.md docs/EventWithStatusAndEventPipelineInfoAllOf.md docs/Field.md docs/FixedFeeRate.md docs/FixedFeeRateCard.md +docs/FixedFeeType.md docs/GetEventResponse.md docs/GetEventsResponse.md docs/GetMetricsRequest.md docs/GetMetricsResponse.md docs/IngestBatchEventRequest.md -docs/IngestBatchEventResponse.md -docs/IngestError.md docs/IngestEventRequest.md docs/IngestEventResponse.md docs/IngestionStatus.md @@ -98,6 +100,7 @@ docs/InvoiceTiming.md docs/InvoicesApi.md docs/ListCreditsResponse.md docs/ListInvoicesResponse.md +docs/ManageMiscellaneousChargesRequest.md docs/MetricDataPoints.md docs/MetricDataPointsGroupedBy.md docs/MetricName.md @@ -106,10 +109,12 @@ docs/MetricQueryFilterEntry.md docs/MetricQueryResponse.md docs/MetricsApi.md docs/MinimumCommitment.md -docs/MiscellaneousApi.md +docs/MiscellaneousCharge.md +docs/MiscellaneousChargesResponse.md docs/OrganizationSetting.md docs/PaginationOptions.md docs/PlanOverride.md +docs/PriceExperimentationApi.md docs/PricePlan.md docs/PricePlanDetails.md docs/PricePlanDetailsConfig.md @@ -123,6 +128,9 @@ docs/PricingCycleConfig.md docs/PricingCycleConfigStartOffset.md docs/PricingModel.md docs/PricingSchedule.md +docs/PricingSchedulePaginatedResponse.md +docs/PricingScheduleWithPricePlanId.md +docs/PricingScheduleWithPricePlanIdAllOf.md docs/RatePlan.md docs/RateValue.md docs/RemoveAccountAliasesRequest.md @@ -198,7 +206,7 @@ src/main/java/com/togai/client/api/EventManagementApi.java src/main/java/com/togai/client/api/EventSchemasApi.java src/main/java/com/togai/client/api/InvoicesApi.java src/main/java/com/togai/client/api/MetricsApi.java -src/main/java/com/togai/client/api/MiscellaneousApi.java +src/main/java/com/togai/client/api/PriceExperimentationApi.java src/main/java/com/togai/client/api/PricePlansApi.java src/main/java/com/togai/client/api/SettingsApi.java src/main/java/com/togai/client/api/UsageMetersApi.java @@ -224,6 +232,7 @@ src/main/java/com/togai/client/models/Computation.java src/main/java/com/togai/client/models/ComputeRevenueSummaryRequest.java src/main/java/com/togai/client/models/ComputeRevenueSummaryResponse.java src/main/java/com/togai/client/models/CreateAccountRequest.java +src/main/java/com/togai/client/models/CreateAccountRequestWithoutCustomerId.java src/main/java/com/togai/client/models/CreateAddOnRequest.java src/main/java/com/togai/client/models/CreateCreditRequest.java src/main/java/com/togai/client/models/CreateCustomerRequest.java @@ -246,6 +255,7 @@ src/main/java/com/togai/client/models/Customer.java src/main/java/com/togai/client/models/CustomerPaginatedResponse.java src/main/java/com/togai/client/models/Dependency.java src/main/java/com/togai/client/models/DimensionsSchema.java +src/main/java/com/togai/client/models/EditPricingScheduleRequest.java src/main/java/com/togai/client/models/EnrichedField.java src/main/java/com/togai/client/models/EnrichmentDependency.java src/main/java/com/togai/client/models/Enrichments.java @@ -264,19 +274,19 @@ src/main/java/com/togai/client/models/EventSchemaListData.java src/main/java/com/togai/client/models/EventSchemaListDataAllOf.java src/main/java/com/togai/client/models/EventSchemaListPaginatedResponse.java src/main/java/com/togai/client/models/EventSchemaVersionsResponse.java +src/main/java/com/togai/client/models/EventSource.java src/main/java/com/togai/client/models/EventWithStatus.java src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfo.java src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfoAllOf.java src/main/java/com/togai/client/models/Field.java src/main/java/com/togai/client/models/FixedFeeRate.java src/main/java/com/togai/client/models/FixedFeeRateCard.java +src/main/java/com/togai/client/models/FixedFeeType.java src/main/java/com/togai/client/models/GetEventResponse.java src/main/java/com/togai/client/models/GetEventsResponse.java src/main/java/com/togai/client/models/GetMetricsRequest.java src/main/java/com/togai/client/models/GetMetricsResponse.java src/main/java/com/togai/client/models/IngestBatchEventRequest.java -src/main/java/com/togai/client/models/IngestBatchEventResponse.java -src/main/java/com/togai/client/models/IngestError.java src/main/java/com/togai/client/models/IngestEventRequest.java src/main/java/com/togai/client/models/IngestEventResponse.java src/main/java/com/togai/client/models/IngestionStatus.java @@ -292,6 +302,7 @@ src/main/java/com/togai/client/models/InvoiceLineItem.java src/main/java/com/togai/client/models/InvoiceTiming.java src/main/java/com/togai/client/models/ListCreditsResponse.java src/main/java/com/togai/client/models/ListInvoicesResponse.java +src/main/java/com/togai/client/models/ManageMiscellaneousChargesRequest.java src/main/java/com/togai/client/models/MetricDataPoints.java src/main/java/com/togai/client/models/MetricDataPointsGroupedBy.java src/main/java/com/togai/client/models/MetricName.java @@ -299,6 +310,8 @@ src/main/java/com/togai/client/models/MetricQuery.java src/main/java/com/togai/client/models/MetricQueryFilterEntry.java src/main/java/com/togai/client/models/MetricQueryResponse.java src/main/java/com/togai/client/models/MinimumCommitment.java +src/main/java/com/togai/client/models/MiscellaneousCharge.java +src/main/java/com/togai/client/models/MiscellaneousChargesResponse.java src/main/java/com/togai/client/models/OrganizationSetting.java src/main/java/com/togai/client/models/PaginationOptions.java src/main/java/com/togai/client/models/PlanOverride.java @@ -314,6 +327,9 @@ src/main/java/com/togai/client/models/PricingCycleConfig.java src/main/java/com/togai/client/models/PricingCycleConfigStartOffset.java src/main/java/com/togai/client/models/PricingModel.java src/main/java/com/togai/client/models/PricingSchedule.java +src/main/java/com/togai/client/models/PricingSchedulePaginatedResponse.java +src/main/java/com/togai/client/models/PricingScheduleWithPricePlanId.java +src/main/java/com/togai/client/models/PricingScheduleWithPricePlanIdAllOf.java src/main/java/com/togai/client/models/RatePlan.java src/main/java/com/togai/client/models/RateValue.java src/main/java/com/togai/client/models/RemoveAccountAliasesRequest.java diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index f23a6a5..fa49e46 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -1,10 +1,13 @@ ### These are the steps for running the examples + ``` -./gradlew build -./gradlew build shadowJar +mvn clean package ``` -Replace the '{{Version}}' with the actual version +Then manually install the following JARs: + +* `target/togai-java-client-1.0.2.jar` +* `target/lib/*.jar` + ``` -javac -cp ".:build/libs/togai-java-client-{{version}}.jar" examples/Example.java -java -cp ".:examples:build/libs/togai-java-client-{{version}}-all.jar" Example +mvn compile exec:java -Dexec.mainClass="Example" ``` \ No newline at end of file diff --git a/README.md b/README.md index bcb5142..e2c5eda 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account AddAccountAliasesRequest addAccountAliasesRequest = new AddAccountAliasesRequest(); // AddAccountAliasesRequest | Payload to add aliases to account try { - Account result = apiInstance.addAliases(customerId, accountId, addAccountAliasesRequest); + Account result = apiInstance.addAliases(accountId, addAccountAliasesRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#addAliases"); @@ -120,14 +119,16 @@ All URIs are relative to *https://api.togai.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AccountsApi* | [**addAliases**](docs/AccountsApi.md#addAliases) | **POST** /customers/{customer_id}/accounts/{account_id}/add_aliases | Add Aliases to account -*AccountsApi* | [**createAccount**](docs/AccountsApi.md#createAccount) | **POST** /customers/{customer_id}/accounts | Create an account -*AccountsApi* | [**deleteAccount**](docs/AccountsApi.md#deleteAccount) | **DELETE** /customers/{customer_id}/accounts/{account_id} | Delete an account -*AccountsApi* | [**getAccount**](docs/AccountsApi.md#getAccount) | **GET** /customers/{customer_id}/accounts/{account_id} | Get an account -*AccountsApi* | [**getAccounts**](docs/AccountsApi.md#getAccounts) | **GET** /customers/{customer_id}/accounts | List accounts of customer -*AccountsApi* | [**removeAliases**](docs/AccountsApi.md#removeAliases) | **POST** /customers/{customer_id}/accounts/{account_id}/remove_aliases | Remove Aliases to account -*AccountsApi* | [**updateAccount**](docs/AccountsApi.md#updateAccount) | **PATCH** /customers/{customer_id}/accounts/{account_id} | Update an account -*AccountsApi* | [**updatePricingSchedule**](docs/AccountsApi.md#updatePricingSchedule) | **POST** /customers/{customer_id}/accounts/{account_id}/price_plans | Dis/associate a plan from/to an account +*AccountsApi* | [**addAliases**](docs/AccountsApi.md#addAliases) | **POST** /accounts/{account_id}/add_aliases | Add Aliases to account +*AccountsApi* | [**createAccount**](docs/AccountsApi.md#createAccount) | **POST** /accounts | Create an account +*AccountsApi* | [**deleteAccount**](docs/AccountsApi.md#deleteAccount) | **DELETE** /accounts/{account_id} | Delete an account +*AccountsApi* | [**getAccount**](docs/AccountsApi.md#getAccount) | **GET** /accounts/{account_id} | Get an account +*AccountsApi* | [**getAccounts**](docs/AccountsApi.md#getAccounts) | **GET** /accounts | List accounts of customer +*AccountsApi* | [**getPricingSchedules**](docs/AccountsApi.md#getPricingSchedules) | **GET** /accounts/{account_id}/pricing_schedules | List pricing schedules of an account +*AccountsApi* | [**removeAliases**](docs/AccountsApi.md#removeAliases) | **POST** /accounts/{account_id}/remove_aliases | Remove Aliases to account +*AccountsApi* | [**updateAccount**](docs/AccountsApi.md#updateAccount) | **PATCH** /accounts/{account_id} | Update an account +*AccountsApi* | [**updatePricingSchedule**](docs/AccountsApi.md#updatePricingSchedule) | **POST** /accounts/{account_id}/price_plans | Dis/associate a plan from/to an account +*AccountsApi* | [**updatePricingScheduleBatch**](docs/AccountsApi.md#updatePricingScheduleBatch) | **POST** /accounts/{account_id}/edit_schedules | Edit schedules of an account. *AddOnsApi* | [**createAddOn**](docs/AddOnsApi.md#createAddOn) | **POST** /addons | Create an AddOn *AddOnsApi* | [**deleteAddOn**](docs/AddOnsApi.md#deleteAddOn) | **DELETE** /addons/{addon_id} | Delete an addon *AddOnsApi* | [**getAddOn**](docs/AddOnsApi.md#getAddOn) | **GET** /addons/{addon_id} | Get an addon @@ -157,8 +158,10 @@ Class | Method | HTTP request | Description *EventSchemasApi* | [**listEventSchemas**](docs/EventSchemasApi.md#listEventSchemas) | **GET** /event_schema | List event schemas *InvoicesApi* | [**getInvoice**](docs/InvoicesApi.md#getInvoice) | **GET** /invoices/{invoice_id} | Get an invoice *InvoicesApi* | [**listInvoices**](docs/InvoicesApi.md#listInvoices) | **GET** /invoices | List invoices +*InvoicesApi* | [**manageMiscellaneousChargesInAccount**](docs/InvoicesApi.md#manageMiscellaneousChargesInAccount) | **PUT** /accounts/{account_id}/miscellaneous_charges | Add or update miscellaneous charges in upcoming Invoice for a account +*InvoicesApi* | [**manageMiscellaneousChargesInInvoice**](docs/InvoicesApi.md#manageMiscellaneousChargesInInvoice) | **PUT** /invoices/{invoice_id}/miscellaneous_charges | Add or update miscellaneous charges in Invoice *MetricsApi* | [**getMetrics**](docs/MetricsApi.md#getMetrics) | **POST** /metrics | Get Togai Metrics -*MiscellaneousApi* | [**calculateRevenue**](docs/MiscellaneousApi.md#calculateRevenue) | **POST** /revenue_calculator | Calculate and return the revenue for a existing or new price plan +*PriceExperimentationApi* | [**calculateRevenue**](docs/PriceExperimentationApi.md#calculateRevenue) | **POST** /revenue_calculator | Calculate and return the revenue for a existing or new price plan *PricePlansApi* | [**activatePricePlan**](docs/PricePlansApi.md#activatePricePlan) | **POST** /price_plans/{price_plan_id}/activate | Activate a price plan *PricePlansApi* | [**addCurrencyToPricePlan**](docs/PricePlansApi.md#addCurrencyToPricePlan) | **POST** /price_plans/{price_plan_id}/currencies | Add currencies to a price plan *PricePlansApi* | [**createPricePlan**](docs/PricePlansApi.md#createPricePlan) | **POST** /price_plans | Create a price plan @@ -170,12 +173,13 @@ Class | Method | HTTP request | Description *SettingsApi* | [**insertSetting**](docs/SettingsApi.md#insertSetting) | **POST** /settings | Create a setting *SettingsApi* | [**listSetting**](docs/SettingsApi.md#listSetting) | **GET** /settings | Lists settings *SettingsApi* | [**updateSetting**](docs/SettingsApi.md#updateSetting) | **PATCH** /settings/{setting_id_str} | Update a setting -*UsageMetersApi* | [**activateUsageMeter**](docs/UsageMetersApi.md#activateUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/activate | Activate usage meter -*UsageMetersApi* | [**createUsageMeter**](docs/UsageMetersApi.md#createUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters | Create an usage meter -*UsageMetersApi* | [**deactivateUsageMeter**](docs/UsageMetersApi.md#deactivateUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/deactivate | Deactivate usage meter -*UsageMetersApi* | [**getUsageMeter**](docs/UsageMetersApi.md#getUsageMeter) | **GET** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id} | Get usage meter -*UsageMetersApi* | [**getUsageMetersForEventSchema**](docs/UsageMetersApi.md#getUsageMetersForEventSchema) | **GET** /event_schema/{event_schema_name}/usage_meters | List usage meters for event schema -*UsageMetersApi* | [**updateUsageMeter**](docs/UsageMetersApi.md#updateUsageMeter) | **PATCH** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id} | Update an usage meter +*UsageMetersApi* | [**activateUsageMeter**](docs/UsageMetersApi.md#activateUsageMeter) | **POST** /usage_meters/{usage_meter_id}/activate | Activate usage meter +*UsageMetersApi* | [**createUsageMeter**](docs/UsageMetersApi.md#createUsageMeter) | **POST** /usage_meters | Create an usage meter +*UsageMetersApi* | [**deactivateUsageMeter**](docs/UsageMetersApi.md#deactivateUsageMeter) | **POST** /usage_meters/{usage_meter_id}/deactivate | Deactivate usage meter +*UsageMetersApi* | [**deleteUsageMeter**](docs/UsageMetersApi.md#deleteUsageMeter) | **DELETE** /usage_meters/{usage_meter_id} | Delete an Usage Meter +*UsageMetersApi* | [**getUsageMeter**](docs/UsageMetersApi.md#getUsageMeter) | **GET** /usage_meters/{usage_meter_id} | Get usage meter +*UsageMetersApi* | [**getUsageMetersForEventSchema**](docs/UsageMetersApi.md#getUsageMetersForEventSchema) | **GET** /usage_meters | List usage meters for event schema +*UsageMetersApi* | [**updateUsageMeter**](docs/UsageMetersApi.md#updateUsageMeter) | **PATCH** /usage_meters/{usage_meter_id} | Update an usage meter ## Documentation for Models @@ -197,6 +201,7 @@ Class | Method | HTTP request | Description - [ComputeRevenueSummaryRequest](docs/ComputeRevenueSummaryRequest.md) - [ComputeRevenueSummaryResponse](docs/ComputeRevenueSummaryResponse.md) - [CreateAccountRequest](docs/CreateAccountRequest.md) + - [CreateAccountRequestWithoutCustomerId](docs/CreateAccountRequestWithoutCustomerId.md) - [CreateAddOnRequest](docs/CreateAddOnRequest.md) - [CreateCreditRequest](docs/CreateCreditRequest.md) - [CreateCustomerRequest](docs/CreateCustomerRequest.md) @@ -219,6 +224,7 @@ Class | Method | HTTP request | Description - [CustomerPaginatedResponse](docs/CustomerPaginatedResponse.md) - [Dependency](docs/Dependency.md) - [DimensionsSchema](docs/DimensionsSchema.md) + - [EditPricingScheduleRequest](docs/EditPricingScheduleRequest.md) - [EnrichedField](docs/EnrichedField.md) - [EnrichmentDependency](docs/EnrichmentDependency.md) - [Enrichments](docs/Enrichments.md) @@ -237,19 +243,19 @@ Class | Method | HTTP request | Description - [EventSchemaListDataAllOf](docs/EventSchemaListDataAllOf.md) - [EventSchemaListPaginatedResponse](docs/EventSchemaListPaginatedResponse.md) - [EventSchemaVersionsResponse](docs/EventSchemaVersionsResponse.md) + - [EventSource](docs/EventSource.md) - [EventWithStatus](docs/EventWithStatus.md) - [EventWithStatusAndEventPipelineInfo](docs/EventWithStatusAndEventPipelineInfo.md) - [EventWithStatusAndEventPipelineInfoAllOf](docs/EventWithStatusAndEventPipelineInfoAllOf.md) - [Field](docs/Field.md) - [FixedFeeRate](docs/FixedFeeRate.md) - [FixedFeeRateCard](docs/FixedFeeRateCard.md) + - [FixedFeeType](docs/FixedFeeType.md) - [GetEventResponse](docs/GetEventResponse.md) - [GetEventsResponse](docs/GetEventsResponse.md) - [GetMetricsRequest](docs/GetMetricsRequest.md) - [GetMetricsResponse](docs/GetMetricsResponse.md) - [IngestBatchEventRequest](docs/IngestBatchEventRequest.md) - - [IngestBatchEventResponse](docs/IngestBatchEventResponse.md) - - [IngestError](docs/IngestError.md) - [IngestEventRequest](docs/IngestEventRequest.md) - [IngestEventResponse](docs/IngestEventResponse.md) - [IngestionStatus](docs/IngestionStatus.md) @@ -265,6 +271,7 @@ Class | Method | HTTP request | Description - [InvoiceTiming](docs/InvoiceTiming.md) - [ListCreditsResponse](docs/ListCreditsResponse.md) - [ListInvoicesResponse](docs/ListInvoicesResponse.md) + - [ManageMiscellaneousChargesRequest](docs/ManageMiscellaneousChargesRequest.md) - [MetricDataPoints](docs/MetricDataPoints.md) - [MetricDataPointsGroupedBy](docs/MetricDataPointsGroupedBy.md) - [MetricName](docs/MetricName.md) @@ -272,6 +279,8 @@ Class | Method | HTTP request | Description - [MetricQueryFilterEntry](docs/MetricQueryFilterEntry.md) - [MetricQueryResponse](docs/MetricQueryResponse.md) - [MinimumCommitment](docs/MinimumCommitment.md) + - [MiscellaneousCharge](docs/MiscellaneousCharge.md) + - [MiscellaneousChargesResponse](docs/MiscellaneousChargesResponse.md) - [OrganizationSetting](docs/OrganizationSetting.md) - [PaginationOptions](docs/PaginationOptions.md) - [PlanOverride](docs/PlanOverride.md) @@ -287,6 +296,9 @@ Class | Method | HTTP request | Description - [PricingCycleConfigStartOffset](docs/PricingCycleConfigStartOffset.md) - [PricingModel](docs/PricingModel.md) - [PricingSchedule](docs/PricingSchedule.md) + - [PricingSchedulePaginatedResponse](docs/PricingSchedulePaginatedResponse.md) + - [PricingScheduleWithPricePlanId](docs/PricingScheduleWithPricePlanId.md) + - [PricingScheduleWithPricePlanIdAllOf](docs/PricingScheduleWithPricePlanIdAllOf.md) - [RatePlan](docs/RatePlan.md) - [RateValue](docs/RateValue.md) - [RemoveAccountAliasesRequest](docs/RemoveAccountAliasesRequest.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index c85c7cb..b0f180e 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -31,8 +31,8 @@ tags: name: Price Plans - description: Settings name: Settings -- description: Miscellaneous - name: Miscellaneous +- description: Price Experimentation apis + name: Price Experimentation - description: APIs for getting events ingested in Togai externalDocs: description: docs @@ -519,7 +519,7 @@ paths: - Customers x-content-type: application/json x-accepts: application/json - /customers/{customer_id}/accounts: + /accounts: get: description: Returns a list of accounts of a customer with pagination and sort. operationId: getAccounts @@ -540,15 +540,6 @@ paths: example: 10 type: number style: form - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true responses: "200": content: @@ -633,16 +624,6 @@ paths: post: description: This API let’s you to create an account for a customer using customer_id. operationId: createAccount - parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true requestBody: $ref: '#/components/requestBodies/CreateAccountRequest' responses: @@ -727,20 +708,11 @@ paths: - Accounts x-content-type: application/json x-accepts: application/json - /customers/{customer_id}/accounts/{account_id}: + /accounts/{account_id}: delete: description: This API let’s you to delete a customer using customer_id and account_id. operationId: deleteAccount parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -832,15 +804,6 @@ paths: description: Get account information using customer_id and account_id. operationId: getAccount parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -937,15 +900,6 @@ paths: and account_id. operationId: updateAccount parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -1040,20 +994,11 @@ paths: - Accounts x-content-type: application/json x-accepts: application/json - /customers/{customer_id}/accounts/{account_id}/add_aliases: + /accounts/{account_id}/add_aliases: post: description: Add aliases to an account using customer_id and account_id. operationId: addAliases parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -1148,20 +1093,11 @@ paths: - Accounts x-content-type: application/json x-accepts: application/json - /customers/{customer_id}/accounts/{account_id}/remove_aliases: + /accounts/{account_id}/remove_aliases: post: description: Remove existing aliases tagged to an account using this API operationId: removeAliases parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -1256,21 +1192,12 @@ paths: - Accounts x-content-type: application/json x-accepts: application/json - /customers/{customer_id}/accounts/{account_id}/price_plans: + /accounts/{account_id}/price_plans: post: description: This API let’s you to detach/attach a price plan from/to an existing account operationId: updatePricingSchedule parameters: - - content: - application/json: - schema: - example: 01BX5ZZKBKACTAV9WEVGEMMVRZ - maxLength: 50 - type: string - in: path - name: customer_id - required: true - content: application/json: schema: @@ -1365,49 +1292,35 @@ paths: - Accounts x-content-type: application/json x-accepts: application/json - /event_schema: - get: - description: Returns a list of event schema with pagination. - operationId: listEventSchemas + /accounts/{account_id}/edit_schedules: + post: + description: This API let’s you to detach/attach one or more price plans from/to + an existing account + operationId: updatePricingScheduleBatch parameters: - - description: Filter by provided status - explode: true - in: query - name: status - required: false - schema: - enum: - - ACTIVE - - INACTIVE - type: string - style: form - - explode: true - in: query - name: nextToken - required: false - schema: - example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== - type: string - style: form - - explode: true - in: query - name: pageSize - required: false - schema: - example: 10 - type: number - style: form + - content: + application/json: + schema: + example: ACC00001 + maxLength: 50 + type: string + description: account_id corresponding to an account + in: path + name: account_id + required: true + requestBody: + $ref: '#/components/requestBodies/EditPricingScheduleRequest' responses: "200": content: application/json: examples: - EventSchemaPaginatedResponse: - $ref: '#/components/examples/EventSchemaListPaginatedResponse' + UpdatePricingScheduleResponse: + $ref: '#/components/examples/UpdatePricingScheduleResponse' value: null schema: - $ref: '#/components/schemas/EventSchemaListPaginatedResponse' - description: Response for list events request + $ref: '#/components/schemas/UpdatePricingScheduleResponse' + description: Response for edit pricing schedule request "400": content: application/json: @@ -1474,27 +1387,70 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: List event schemas + summary: Edit schedules of an account. tags: - - Event Schemas + - Accounts + x-content-type: application/json x-accepts: application/json - post: - description: Create an event schema with attributes and dimensions to process - events. - operationId: createEventSchema - requestBody: - $ref: '#/components/requestBodies/CreateEventSchemaRequest' + /accounts/{account_id}/pricing_schedules: + get: + description: Returns a list of pricing schedules of an account with pagination + and sort. + operationId: getPricingSchedules + parameters: + - explode: true + in: query + name: nextToken + required: false + schema: + example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== + type: string + style: form + - explode: true + in: query + name: pageSize + required: false + schema: + example: 10 + type: number + style: form + - content: + application/json: + schema: + example: ACC00001 + maxLength: 50 + type: string + description: account_id corresponding to an account + in: path + name: account_id + required: true + - explode: true + in: query + name: start_date + required: false + schema: + example: 2023-03-30T10:41:10.088499 + type: string + style: form + - explode: true + in: query + name: end_date + required: false + schema: + example: 2099-03-30T10:41:10.088499 + type: string + style: form responses: - "201": + "200": content: application/json: examples: - EventSchema: - $ref: '#/components/examples/EventSchema' + PricingSchedulePaginatedResponse: + $ref: '#/components/examples/PricingSchedulePaginatedResponse' value: null schema: - $ref: '#/components/schemas/EventSchema' - description: Response for Create and Get event schema requests + $ref: '#/components/schemas/PricingSchedulePaginatedResponse' + description: Response for list pricing schedules request "400": content: application/json: @@ -1561,33 +1517,53 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: Create an event schema + summary: List pricing schedules of an account tags: - - Event Schemas - x-content-type: application/json + - Accounts x-accepts: application/json - /event_schema/{event_schema_name}: - delete: - description: "To delete(archive) an event schema, you’re required to archive\ - \ associated active usage meters if any." - operationId: deleteEventSchema + /event_schema: + get: + description: Returns a list of event schema with pagination. + operationId: listEventSchemas parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true + - description: Filter by provided status + explode: true + in: query + name: status + required: false + schema: + enum: + - ACTIVE + - INACTIVE + type: string + style: form + - explode: true + in: query + name: nextToken + required: false + schema: + example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== + type: string + style: form + - explode: true + in: query + name: pageSize + required: false + schema: + example: 10 + type: number + style: form responses: "200": content: application/json: + examples: + EventSchemaPaginatedResponse: + $ref: '#/components/examples/EventSchemaListPaginatedResponse' + value: null schema: - $ref: '#/components/schemas/BaseSuccessResponse' - description: OK + $ref: '#/components/schemas/EventSchemaListPaginatedResponse' + description: Response for list events request "400": content: application/json: @@ -1654,28 +1630,208 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: Delete an event schema + summary: List event schemas tags: - Event Schemas x-accepts: application/json - get: - description: Get an event schema - operationId: getEventSchema - parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true - - content: - application/json: - schema: - example: 2 - format: int32 + post: + description: Create an event schema with attributes and dimensions to process + events. + operationId: createEventSchema + requestBody: + $ref: '#/components/requestBodies/CreateEventSchemaRequest' + responses: + "201": + content: + application/json: + examples: + EventSchema: + $ref: '#/components/examples/EventSchema' + value: null + schema: + $ref: '#/components/schemas/EventSchema' + description: Response for Create and Get event schema requests + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "403": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "404": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "429": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + default: + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + summary: Create an event schema + tags: + - Event Schemas + x-content-type: application/json + x-accepts: application/json + /event_schema/{event_schema_name}: + delete: + description: "To delete(archive) an event schema, you’re required to archive\ + \ associated active usage meters if any." + operationId: deleteEventSchema + parameters: + - content: + application/json: + schema: + example: rides + maxLength: 50 + type: string + in: path + name: event_schema_name + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BaseSuccessResponse' + description: OK + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "403": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "404": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "429": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + default: + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + summary: Delete an event schema + tags: + - Event Schemas + x-accepts: application/json + get: + description: Get an event schema + operationId: getEventSchema + parameters: + - content: + application/json: + schema: + example: rides + maxLength: 50 + type: string + in: path + name: event_schema_name + required: true + - content: + application/json: + schema: + example: 2 + format: int32 type: integer description: Optional version to get a specific version. Gets latest version if it is not provided. @@ -2149,7 +2305,7 @@ paths: tags: - Event Schemas x-accepts: application/json - /event_schema/{event_schema_name}/usage_meters: + /usage_meters: get: description: Get a list of usage meters associated with an event schema operationId: getUsageMetersForEventSchema @@ -2178,15 +2334,6 @@ paths: - SUM type: string style: form - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true - explode: true in: query name: nextToken @@ -2287,16 +2434,6 @@ paths: post: description: Create an usage meter and associate with an event schema operationId: createUsageMeter - parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true requestBody: $ref: '#/components/requestBodies/CreateUsageMeterRequest' responses: @@ -2381,20 +2518,11 @@ paths: - Usage Meters x-content-type: application/json x-accepts: application/json - /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}: - get: - description: Get an usage meter using event schema name and usage meter id. - operationId: getUsageMeter + /usage_meters/{usage_meter_id}: + delete: + description: Delete an Usage Meter + operationId: deleteUsageMeter parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true - content: application/json: schema: @@ -2408,13 +2536,9 @@ paths: "200": content: application/json: - examples: - Customer: - $ref: '#/components/examples/UsageMeter' - value: null schema: - $ref: '#/components/schemas/UsageMeter' - description: Response for Create and Get usage event requests + $ref: '#/components/schemas/BaseSuccessResponse' + description: OK "400": content: application/json: @@ -2481,23 +2605,14 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: Get usage meter + summary: Delete an Usage Meter tags: - Usage Meters x-accepts: application/json - patch: - description: This API lets you update an existing usage meter. - operationId: updateUsageMeter + get: + description: Get an usage meter using event schema name and usage meter id. + operationId: getUsageMeter parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true - content: application/json: schema: @@ -2507,8 +2622,6 @@ paths: in: path name: usage_meter_id required: true - requestBody: - $ref: '#/components/requestBodies/UpdateUsageMeterRequest' responses: "200": content: @@ -2586,25 +2699,112 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: Update an usage meter + summary: Get usage meter tags: - Usage Meters - x-content-type: application/json x-accepts: application/json - /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/activate: - post: - description: Activate usage meter - operationId: activateUsageMeter + patch: + description: This API lets you update an existing usage meter. + operationId: updateUsageMeter parameters: - content: application/json: schema: - example: rides + example: um.1zYnCiM9Bpg.1zYn maxLength: 50 type: string in: path - name: event_schema_name + name: usage_meter_id required: true + requestBody: + $ref: '#/components/requestBodies/UpdateUsageMeterRequest' + responses: + "200": + content: + application/json: + examples: + Customer: + $ref: '#/components/examples/UsageMeter' + value: null + schema: + $ref: '#/components/schemas/UsageMeter' + description: Response for Create and Get usage event requests + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "403": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "404": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "429": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + default: + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + summary: Update an usage meter + tags: + - Usage Meters + x-content-type: application/json + x-accepts: application/json + /usage_meters/{usage_meter_id}/activate: + post: + description: Activate usage meter + operationId: activateUsageMeter + parameters: - content: application/json: schema: @@ -2695,22 +2895,13 @@ paths: tags: - Usage Meters x-accepts: application/json - /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/deactivate: + /usage_meters/{usage_meter_id}/deactivate: post: description: | Make an existing active usage meter to be inactive Active Usage Meters with active Pricing Plan attached can also be deactivated. operationId: deactivateUsageMeter parameters: - - content: - application/json: - schema: - example: rides - maxLength: 50 - type: string - in: path - name: event_schema_name - required: true - content: application/json: schema: @@ -3006,6 +3197,17 @@ paths: in: path name: price_plan_id required: true + - content: + application/json: + schema: + example: 2 + format: int32 + type: integer + description: Optional version to get a specific version. Gets latest version + if it is not provided. + in: query + name: version + required: false responses: "200": content: @@ -4454,7 +4656,7 @@ paths: description: Error response summary: Calculate and return the revenue for a existing or new price plan tags: - - Miscellaneous + - Price Experimentation x-content-type: application/json x-accepts: application/json /ingest: @@ -4478,12 +4680,16 @@ paths: required: true responses: "202": + content: + application/json: + schema: + $ref: '#/components/schemas/IngestEventResponse' description: Successfully accepted to process all the events from payload. "400": content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' + $ref: '#/components/schemas/IngestEventResponse' description: Bad request. Please check the response message for failure details. "401": @@ -4555,21 +4761,21 @@ paths: content: application/json: example: - errors: [] + success: true schema: - $ref: '#/components/schemas/IngestBatchEventResponse' + $ref: '#/components/schemas/IngestEventResponse' description: Successfully accepted to process all the events from payload. "207": content: application/json: schema: - $ref: '#/components/schemas/IngestBatchEventResponse' + $ref: '#/components/schemas/IngestEventResponse' description: Partial failure. Few events from request were not accepted "400": content: application/json: schema: - $ref: '#/components/schemas/ErrorResponse' + $ref: '#/components/schemas/IngestEventResponse' description: Bad request. Please check the response message for failure details. "401": @@ -4804,10 +5010,10 @@ paths: x-accepts: application/json /metrics: post: - description: "Togai Metrics API allows you to fetch different metrics from Events\ - \ , Usage Meters and PricePlans with multiple queryable options.\nA single\ - \ request can query up to five metrics. \nSingle response can contain a maximum\ - \ of 100 data points.\n" + description: "Togai Metrics API allows you to fetch different metrics from Events,\ + \ Usage Meters and PricePlans with multiple queryable options.\nA single request\ + \ can query up to five metrics. \nSingle response can contain a maximum of\ + \ 100 data points.\n" operationId: getMetrics requestBody: $ref: '#/components/requestBodies/GetMetricsRequest' @@ -5095,73 +5301,32 @@ paths: tags: - Invoices x-accepts: application/json - /credits: - get: - description: Get all credits - operationId: listCredits + /invoices/{invoice_id}/miscellaneous_charges: + put: + description: Add or update miscellaneous charges in Invoice + operationId: manageMiscellaneousChargesInInvoice parameters: - - description: Pagination token used as a marker to get records from next page. - explode: true - in: query - name: nextToken - required: false - schema: - example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ== - type: string - style: form - - description: Filter option to filter by status. - examples: - processed: - value: PROCESSED - in_progress: - value: IN_PROGRESS - explode: true - in: query - name: status - required: false - schema: - type: string - style: form - - description: Filter option to filter based on account id. - explode: true - in: query - name: account_id - required: false - schema: - example: "1234" - type: string - style: form - - description: Filter option to filter based on credit id. - explode: true - in: query - name: id - required: false - schema: - example: cred.1znpoFlsI3U.zmg85 - type: string - style: form - - description: "Maximum page size expected by client to return the record list.\ - \ \n\n NOTE: Max page size cannot be more than 50. Also 50 is the default\ - \ page size if no value is provided." - explode: true - in: query - name: pageSize - required: false - schema: - example: 10 - type: integer - style: form + - content: + application/json: + schema: + example: ACC001 + type: string + in: path + name: invoice_id + required: true + requestBody: + $ref: '#/components/requestBodies/ManageMiscellaneousChargesRequest' responses: "200": content: application/json: examples: - ListCreditsResponse: - $ref: '#/components/examples/ListCreditsResponse' + MiscellaneousChargesResponse: + $ref: '#/components/examples/MiscellaneousChargesResponse' value: null schema: - $ref: '#/components/schemas/ListCreditsResponse' - description: Response for Get invoice requests + $ref: '#/components/schemas/MiscellaneousChargesResponse' + description: Response for Miscellaneous Charges Request "400": content: application/json: @@ -5228,26 +5393,39 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: List credits + summary: Add or update miscellaneous charges in Invoice tags: - - Credits + - Invoices + x-content-type: application/json x-accepts: application/json - post: - description: Grant credit - operationId: createCredit + /accounts/{account_id}/miscellaneous_charges: + put: + description: Add or update miscellaneous charges in upcoming Invoice for a account + operationId: manageMiscellaneousChargesInAccount + parameters: + - content: + application/json: + schema: + example: ACC00001 + maxLength: 50 + type: string + description: account_id corresponding to an account + in: path + name: account_id + required: true requestBody: - $ref: '#/components/requestBodies/CreateCreditRequest' + $ref: '#/components/requestBodies/ManageMiscellaneousChargesRequest' responses: "200": content: application/json: examples: - Credit: - $ref: '#/components/examples/Credit' + MiscellaneousChargesResponse: + $ref: '#/components/examples/MiscellaneousChargesResponse' value: null schema: - $ref: '#/components/schemas/Credit' - description: Response for List credits request + $ref: '#/components/schemas/MiscellaneousChargesResponse' + description: Response for Miscellaneous Charges Request "400": content: application/json: @@ -5314,46 +5492,270 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' description: Error response - summary: Grant credit + summary: Add or update miscellaneous charges in upcoming Invoice for a account tags: - - Credits + - Invoices x-content-type: application/json x-accepts: application/json - /credits/{credit_id}: + /credits: get: - description: Get credit details - operationId: getCreditDetails + description: Get all credits + operationId: listCredits parameters: - - content: - application/json: - schema: - example: creds.1znQx9jiIXw.r44fc - type: string - in: path - name: credit_id - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreditDetailsResponse' - description: Response for Fetch Credit Details request. This contains Credit - Transactions - "400": - content: - application/json: - examples: - ErrorResponse: - summary: Error message - value: - message: - schema: - $ref: '#/components/schemas/ErrorResponse' - description: Error response - "401": - content: - application/json: + - description: Pagination token used as a marker to get records from next page. + explode: true + in: query + name: nextToken + required: false + schema: + example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ== + type: string + style: form + - description: Filter option to filter by status. + examples: + processed: + value: PROCESSED + in_progress: + value: IN_PROGRESS + explode: true + in: query + name: status + required: false + schema: + type: string + style: form + - description: Filter option to filter based on account id. + explode: true + in: query + name: account_id + required: false + schema: + example: "1234" + type: string + style: form + - description: Filter option to filter based on credit id. + explode: true + in: query + name: id + required: false + schema: + example: cred.1znpoFlsI3U.zmg85 + type: string + style: form + - description: "Maximum page size expected by client to return the record list.\ + \ \n\n NOTE: Max page size cannot be more than 50. Also 50 is the default\ + \ page size if no value is provided." + explode: true + in: query + name: pageSize + required: false + schema: + example: 10 + type: integer + style: form + responses: + "200": + content: + application/json: + examples: + ListCreditsResponse: + $ref: '#/components/examples/ListCreditsResponse' + value: null + schema: + $ref: '#/components/schemas/ListCreditsResponse' + description: Response for Get invoice requests + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "403": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "404": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "429": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + default: + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + summary: List credits + tags: + - Credits + x-accepts: application/json + post: + description: Grant credit + operationId: createCredit + requestBody: + $ref: '#/components/requestBodies/CreateCreditRequest' + responses: + "200": + content: + application/json: + examples: + Credit: + $ref: '#/components/examples/Credit' + value: null + schema: + $ref: '#/components/schemas/Credit' + description: Response for List credits request + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "403": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "404": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "429": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + default: + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + summary: Grant credit + tags: + - Credits + x-content-type: application/json + x-accepts: application/json + /credits/{credit_id}: + get: + description: Get credit details + operationId: getCreditDetails + parameters: + - content: + application/json: + schema: + example: creds.1znQx9jiIXw.r44fc + type: string + in: path + name: credit_id + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreditDetailsResponse' + description: Response for Fetch Credit Details request. This contains Credit + Transactions + "400": + content: + application/json: + examples: + ErrorResponse: + summary: Error message + value: + message: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Error response + "401": + content: + application/json: examples: ErrorResponse: summary: Error message @@ -5641,7 +6043,7 @@ components: name: ACME Enterprise primaryEmail: admin@example.com billingAddress: 201 Bleeker Street - CreateAccountRequest: + CreateAccountRequestWithoutCustomerId: value: id: ACC00001 name: Primary Account @@ -5654,7 +6056,21 @@ components: namespace: USER name: Settings Name dataType: STRING - UpdateAccountRequest: + CreateAccountRequest: + value: + id: ACC00001 + name: Primary Account + customerId: C1234qwd + aliases: + - acme_primary + - acme_1 + settings: + - id: accountSettingId + value: INR + namespace: USER + name: Settings Name + dataType: STRING + UpdateAccountRequest: value: name: New Account Name AddAccountAliasesRequest: @@ -5731,6 +6147,7 @@ components: description: Cab rides type: COUNTER aggregation: SUM + eventSchemaName: evfhr123d computations: - matcher: | { @@ -5783,6 +6200,7 @@ components: dayOffset: "6" monthOffset: NIL gracePeriod: 3 + mode: IMMEDIATE_IGNORE_OVERRIDE ActivatePricePlanRequest: value: currencies: @@ -5799,6 +6217,7 @@ components: mode: PRICE_PLAN pricePlanId: pp.fdhkf.djf effectiveOn: {} + pricingCycleOrdinal: 1 usageConfig: mode: CUSTOM usageMap: @@ -5812,6 +6231,7 @@ components: accountId: ACC00001 pricePlanDetailsConfig: mode: CUSTOM + pricingCycleOrdinal: 1 pricePlanDetails: supportedCurrencies: - USD @@ -5868,6 +6288,16 @@ components: mode: DISASSOCIATE effectiveFrom: 2022-07-04 effectiveUntil: 2022-10-04 + EditPricingScheduleRequest: + value: + edits: + - mode: ASSOCIATE + pricePlanId: pp.1zYnCiM9Bpg.lv25y + effectiveFrom: 2022-07-04 + effectiveUntil: 2022-10-04 + - mode: DISASSOCIATE + effectiveFrom: 2022-08-04 + effectiveUntil: 2022-09-04 AddCurrencyToPricePlanRequest: value: currency: USD @@ -5916,12 +6346,12 @@ components: aliases: - alias: G234DZZKBKACATFFGVGEMERFH status: ACTIVE - settings: - - id: accountSettingId - value: INR - namespace: USER - name: Settings Name - dataType: STRING + settings: + - id: accountSettingId + value: INR + namespace: USER + name: Settings Name + dataType: STRING CustomerPaginatedResponse: value: data: @@ -5998,6 +6428,14 @@ components: - pricePlanId: pp.1zYnCiM9Bpg.lv25y startDate: 2022-12-02T00:00:00Z endDate: 9999-01-01T00:00:00Z + EditPricingScheduleResponse: + value: + accountId: G234DZZKBKACATFFGVGEMERFI + accountName: ACME Enterprise - Account2 + pricingSchedules: + - pricePlanId: pp.1zYnCiM9Bpg.lv25y + startDate: 2022-12-02T00:00:00Z + endDate: 9999-01-01T00:00:00Z CalculateRevenueResponse: value: currency: USD @@ -6171,6 +6609,49 @@ components: updatedAt: 2020-01-01T00:00:00Z createdAt: 2020-01-01T00:00:00Z nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== + PricingSchedulePaginatedResponse: + value: + data: + - pricePlanId: pp.bs8932bf328 + - startDate: 2080-10-04T00:00:00Z + endDate: 2099-10-04T00:00:00Z + pricePlanDetails: + supportedCurrencies: + - USD + activeCurrencies: + - USD + pricingCycleConfig: + interval: MONTHLY + startOffset: + dayOffset: "4" + monthOffset: NIL + gracePeriod: 3 + usageRateCards: + - displayName: Local Rides + usageMeterId: um.1zYnCiM9Bpg.1zYn + ratePlan: + pricingModel: TIERED + slabs: + - order: 1 + startAfter: 0 + priceType: FLAT + rateValues: + - currency: USD + slabRates: + - rate: 40 + order: 1 + fixedFeeRateCards: + - id: addon.2077efUBMXo.DyzlZ + displayName: Maintenance + rateValues: + - currency: USD + rate: 10 + minimumCommitment: + displayName: Minimum Commitment + rateValues: + - currency: USD + rate: 10 + nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== RateCardUsage: value: type: USAGE @@ -6227,10 +6708,10 @@ components: accountId: "1" attributes: - name: distanceTravelled - value: 50 + value: "50" unit: Miles - name: timeSpent - value: 60 + value: "60" unit: Minutes dimensions: location: Seattle @@ -6246,29 +6727,29 @@ components: accountId: "1" attributes: - name: distanceTravelled - value: 50 + value: "50" unit: Miles - name: timeSpent - value: 60 + value: "60" unit: Minutes dimensions: location: Seattle - costCenterCode: 1234 + costCenterCode: "1234" travelType: Business - timestamp: 2022-06-15T07:30:35.123 schemaName: sendMessageEvent id: c0b1306d-f506-43a6-856b-69221efaee6c - accountId: 1 + accountId: "1" attributes: - name: messageSentCount - value: 50 + value: "50" unit: None - name: sizeOfMessage - value: 60 + value: "60" unit: KiloBytes dimensions: location: Seattle - costCenterCode: 1234 + costCenterCode: "1234" messageProviderName: Twilio GetEventResponse: summary: example get event response @@ -6506,6 +6987,14 @@ components: priority: 1 createdAt: 2020-07-04T12:00:00.000Z nextToken: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEyMywgInNvcnRPcmRlciI6ICJhc2MifQ== + MiscellaneousChargesResponse: + summary: A sample MiscellaneousChargesResponse + value: + data: + - name: charge 1 + value: "100" + - name: charge 2 + value: "200" CreateCreditRequest: summary: A sample for CreateCreditRequest value: @@ -6515,6 +7004,14 @@ components: effectiveUntil: 2024-02-04 creditAmount: 1000 priority: 1 + ManageMiscellaneousChargesRequest: + summary: A sample for ManageMiscellaneousChargesRequest + value: + items: + - name: charge 1 + value: "100" + - name: charge 2 + value: "200" CreditBalanceResponse: summary: A sample for CreditBalanceResponse value: @@ -6574,6 +7071,24 @@ components: example: eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ== type: string style: form + start_date: + explode: true + in: query + name: start_date + required: false + schema: + example: 2023-03-30T10:41:10.088499 + type: string + style: form + end_date: + explode: true + in: query + name: end_date + required: false + schema: + example: 2099-03-30T10:41:10.088499 + type: string + style: form page_size: explode: true in: query @@ -6851,6 +7366,17 @@ components: $ref: '#/components/schemas/UpdateCustomerRequest' description: Payload to update customer required: true + CreateAccountRequestWithoutCustomerId: + content: + application/json: + examples: + CreateAccountRequestWithoutCustomerId: + $ref: '#/components/examples/CreateAccountRequestWithoutCustomerId' + value: null + schema: + $ref: '#/components/schemas/CreateAccountRequestWithoutCustomerId' + description: Payload to create account + required: true CreateAccountRequest: content: application/json: @@ -6949,6 +7475,17 @@ components: $ref: '#/components/schemas/UpdatePricingScheduleRequest' description: Payload to dis/associate a price plan to an account required: true + EditPricingScheduleRequest: + content: + application/json: + examples: + EditPricingScheduleRequest: + $ref: '#/components/examples/EditPricingScheduleRequest' + value: null + schema: + $ref: '#/components/schemas/EditPricingScheduleRequest' + description: Payload to dis/associate one or more price plans to an account + required: true CreatePricePlanRequest: content: application/json: @@ -7103,6 +7640,16 @@ components: schema: $ref: '#/components/schemas/CreateCreditRequest' description: Payload to grant credits + ManageMiscellaneousChargesRequest: + content: + application/json: + examples: + ManageMiscellaneousChargesRequest: + $ref: '#/components/examples/ManageMiscellaneousChargesRequest' + value: null + schema: + $ref: '#/components/schemas/ManageMiscellaneousChargesRequest' + description: Payload to update custom line items responses: BaseSuccessResponse: content: @@ -7253,6 +7800,16 @@ components: schema: $ref: '#/components/schemas/PricePlanPaginatedResponse' description: Response for list price plans request + PricingSchedulePaginatedResponse: + content: + application/json: + examples: + PricingSchedulePaginatedResponse: + $ref: '#/components/examples/PricingSchedulePaginatedResponse' + value: null + schema: + $ref: '#/components/schemas/PricingSchedulePaginatedResponse' + description: Response for list pricing schedules request UpdatePricingScheduleResponse: content: application/json: @@ -7263,6 +7820,16 @@ components: schema: $ref: '#/components/schemas/UpdatePricingScheduleResponse' description: Response for dis/associate price plan request + EditPricingScheduleResponse: + content: + application/json: + examples: + UpdatePricingScheduleResponse: + $ref: '#/components/examples/UpdatePricingScheduleResponse' + value: null + schema: + $ref: '#/components/schemas/UpdatePricingScheduleResponse' + description: Response for edit pricing schedule request CalculateRevenueResponse: content: application/json: @@ -7384,6 +7951,16 @@ components: schema: $ref: '#/components/schemas/CreditBalanceResponse' description: Response for Credit Balance Request + MiscellaneousChargesResponse: + content: + application/json: + examples: + MiscellaneousChargesResponse: + $ref: '#/components/examples/MiscellaneousChargesResponse' + value: null + schema: + $ref: '#/components/schemas/MiscellaneousChargesResponse' + description: Response for Miscellaneous Charges Request schemas: SignupRequest: additionalProperties: false @@ -7520,7 +8097,7 @@ components: minItems: 0 type: array account: - $ref: '#/components/schemas/CreateAccountRequest' + $ref: '#/components/schemas/CreateAccountRequestWithoutCustomerId' required: - billingAddress - id @@ -7552,6 +8129,80 @@ components: maxLength: 1000 type: string type: object + CreateAccountRequestWithoutCustomerId: + additionalProperties: false + description: Payload to create account + example: + settings: + - dataType: null + namespace: namespace + name: name + id: id + value: value + - dataType: null + namespace: namespace + name: name + id: id + value: value + - dataType: null + namespace: namespace + name: name + id: id + value: value + - dataType: null + namespace: namespace + name: name + id: id + value: value + - dataType: null + namespace: namespace + name: name + id: id + value: value + aliases: acme_primary + name: Primary Account + id: ACC00001 + invoiceCurrency: invoiceCurrency + properties: + id: + description: Identifier of the account + example: ACC00001 + maxLength: 50 + type: string + name: + description: Name of the Account + example: Primary Account + maxLength: 255 + minLength: 3 + type: string + invoiceCurrency: + description: "Use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency\ + \ code in which the account must be invoiced. \nFor example: AED is the\ + \ currency code for United Arab Emirates dirham.\n" + maxLength: 3 + minLength: 3 + type: string + aliases: + description: Aliases are tags that are associated with an account. Multiple + aliases are allowed for a single account. + example: acme_primary + items: + maxLength: 50 + minLength: 3 + type: string + maxItems: 10 + minItems: 0 + type: array + settings: + items: + $ref: '#/components/schemas/CreateEntitySetting' + maxItems: 10 + minItems: 0 + type: array + required: + - id + - name + type: object CreateAccountRequest: additionalProperties: false description: Payload to create account @@ -7584,6 +8235,7 @@ components: value: value aliases: acme_primary name: Primary Account + customerId: C1234ewf id: ACC00001 invoiceCurrency: invoiceCurrency properties: @@ -7622,7 +8274,14 @@ components: maxItems: 10 minItems: 0 type: array + customerId: + description: Customer Identifier for whom the account is being created + example: C1234ewf + maxLength: 255 + minLength: 1 + type: string required: + - customerId - id - name type: object @@ -7812,6 +8471,7 @@ components: additionalProperties: false description: Request to create usage meter example: + eventSchemaName: eventSchemaName computations: - id: id matcher: | @@ -7868,8 +8528,12 @@ components: items: $ref: '#/components/schemas/Computation' type: array + eventSchemaName: + description: Event Schema Identifier + type: string required: - aggregation + - eventSchemaName - name - type type: object @@ -7957,6 +8621,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -7965,6 +8630,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -8083,6 +8749,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -8091,6 +8758,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -8200,6 +8868,7 @@ components: additionalProperties: false description: Request to update a price plan example: + migrationMode: IMMEDIATE pricePlanDetails: supportedCurrencies: - supportedCurrencies @@ -8219,6 +8888,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -8227,6 +8897,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -8308,6 +8979,7 @@ components: - rate: 5.637376656633329 currency: currency description: description + versionsToMigrate: LATEST_VERSION properties: description: description: Description of price plan @@ -8315,6 +8987,19 @@ components: type: string pricePlanDetails: $ref: '#/components/schemas/CreatePricePlanDetailsOverride' + migrationMode: + enum: + - IMMEDIATE + - IMMEDIATE_IGNORE_OVERRIDE + - NEXT_CYCLE + - NEXT_CYCLE_IGNORE_OVERRIDE + - NONE + type: string + versionsToMigrate: + enum: + - LATEST_VERSION + - ALL_VERSION + type: string type: object ActivatePricePlanRequest: additionalProperties: false @@ -8352,10 +9037,11 @@ components: start: 2000-01-23T04:56:07.000+00:00 end: 2000-01-23T04:56:07.000+00:00 usageMap: - key: 0.8008281904610115 + key: 6.027456183070403 pricePlanDetailsConfig: mode: CUSTOM accountId: accountId + pricingCycleOrdinal: 0 pricePlanDetails: supportedCurrencies: - supportedCurrencies @@ -8375,6 +9061,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -8383,6 +9070,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -8504,6 +9192,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -8512,6 +9201,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -8593,32 +9283,612 @@ components: - rate: 5.637376656633329 currency: currency properties: - mode: - description: Mode of request to create dis/association - enum: - - ASSOCIATE - - DISASSOCIATE - type: string - pricePlanId: - description: Id of the price plan if association request - type: string - effectiveFrom: - description: | - Date of effectiveness of the association. - - Expected only if the account already has a price plan associated with it. - format: date - type: string - effectiveUntil: - description: | - Date until which the association must be effective. - - Expected only if effectiveFrom is present. - format: date - type: string - pricePlanDetailsOverride: - $ref: '#/components/schemas/CreatePricePlanDetailsOverride' + mode: + description: Mode of request to create dis/association + enum: + - ASSOCIATE + - DISASSOCIATE + type: string + pricePlanId: + description: Id of the price plan if association request + type: string + effectiveFrom: + description: | + Date of effectiveness of the association. + - Expected only if the account already has a price plan associated with it. + format: date + type: string + effectiveUntil: + description: | + Date until which the association must be effective. + - Expected only if effectiveFrom is present. + format: date + type: string + pricePlanDetailsOverride: + $ref: '#/components/schemas/CreatePricePlanDetailsOverride' + required: + - effectiveFrom + - effectiveUntil + type: object + EditPricingScheduleRequest: + additionalProperties: false + description: Request to dis/associate one or more schedules to an account + example: + edits: + - mode: ASSOCIATE + effectiveUntil: 2000-01-23 + pricePlanId: pricePlanId + effectiveFrom: 2000-01-23 + pricePlanDetailsOverride: + supportedCurrencies: + - supportedCurrencies + - supportedCurrencies + pricingCycleConfig: + gracePeriod: 3 + startOffset: + dayOffset: dayOffset + monthOffset: monthOffset + interval: MONTHLY + fixedFeeRateCards: + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + usageRateCards: + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + minimumCommitment: + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + - mode: ASSOCIATE + effectiveUntil: 2000-01-23 + pricePlanId: pricePlanId + effectiveFrom: 2000-01-23 + pricePlanDetailsOverride: + supportedCurrencies: + - supportedCurrencies + - supportedCurrencies + pricingCycleConfig: + gracePeriod: 3 + startOffset: + dayOffset: dayOffset + monthOffset: monthOffset + interval: MONTHLY + fixedFeeRateCards: + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + usageRateCards: + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + minimumCommitment: + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + - mode: ASSOCIATE + effectiveUntil: 2000-01-23 + pricePlanId: pricePlanId + effectiveFrom: 2000-01-23 + pricePlanDetailsOverride: + supportedCurrencies: + - supportedCurrencies + - supportedCurrencies + pricingCycleConfig: + gracePeriod: 3 + startOffset: + dayOffset: dayOffset + monthOffset: monthOffset + interval: MONTHLY + fixedFeeRateCards: + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + usageRateCards: + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + minimumCommitment: + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + - mode: ASSOCIATE + effectiveUntil: 2000-01-23 + pricePlanId: pricePlanId + effectiveFrom: 2000-01-23 + pricePlanDetailsOverride: + supportedCurrencies: + - supportedCurrencies + - supportedCurrencies + pricingCycleConfig: + gracePeriod: 3 + startOffset: + dayOffset: dayOffset + monthOffset: monthOffset + interval: MONTHLY + fixedFeeRateCards: + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + usageRateCards: + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + minimumCommitment: + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + - mode: ASSOCIATE + effectiveUntil: 2000-01-23 + pricePlanId: pricePlanId + effectiveFrom: 2000-01-23 + pricePlanDetailsOverride: + supportedCurrencies: + - supportedCurrencies + - supportedCurrencies + pricingCycleConfig: + gracePeriod: 3 + startOffset: + dayOffset: dayOffset + monthOffset: monthOffset + interval: MONTHLY + fixedFeeRateCards: + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + - invoiceTiming: null + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + id: id + type: null + usageRateCards: + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - ratePlan: + pricingModel: null + slabs: + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + - startAfter: 6.027456183070403 + priceType: null + slabConfig: + key: slabConfig + order: 1 + displayName: displayName + usageMeterId: um.1zYnCiM9Bpg.1zYn + rateValues: + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - currency: currency + slabRates: + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + - rate: 5.962133916683182 + slabRateConfig: + key: slabRateConfig + order: 1 + minimumCommitment: + displayName: displayName + rateValues: + - rate: 5.637376656633329 + currency: currency + - rate: 5.637376656633329 + currency: currency + properties: + edits: + items: + $ref: '#/components/schemas/UpdatePricingScheduleRequest' + maxItems: 10 + minItems: 1 + type: array required: - - effectiveFrom - - effectiveUntil + - edits type: object AddCurrencyToPricePlanRequest: additionalProperties: false @@ -9085,6 +10355,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -9093,6 +10364,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -9179,6 +10451,7 @@ components: name: name description: description id: id + version: 0 status: DRAFT updatedAt: 2000-01-23T04:56:07.000+00:00 properties: @@ -9190,6 +10463,10 @@ components: description: Name of the price plan maxLength: 50 type: string + version: + description: Version of the price plan + format: int32 + type: integer description: description: Description of price plan maxLength: 255 @@ -9222,6 +10499,7 @@ components: - status - updatedAt - usageMeters + - version type: object PricePlanPaginatedResponse: additionalProperties: false @@ -9250,6 +10528,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -9258,6 +10537,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -9344,6 +10624,7 @@ components: name: name description: description id: id + version: 0 status: DRAFT updatedAt: 2000-01-23T04:56:07.000+00:00 - usageMeters: @@ -9369,6 +10650,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -9377,6 +10659,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -9463,6 +10746,7 @@ components: name: name description: description id: id + version: 0 status: DRAFT updatedAt: 2000-01-23T04:56:07.000+00:00 nextToken: nextToken @@ -9481,6 +10765,28 @@ components: required: - data type: object + PricingScheduleWithPricePlanId: + allOf: + - $ref: '#/components/schemas/PricingSchedule' + - $ref: '#/components/schemas/PricingScheduleWithPricePlanId_allOf' + PricingSchedulePaginatedResponse: + additionalProperties: false + example: + previousToken: previousToken + data: + - null + - null + nextToken: nextToken + properties: + data: + items: + $ref: '#/components/schemas/PricingScheduleWithPricePlanId' + type: array + nextToken: + type: string + previousToken: + type: string + type: object UpdatePricingScheduleResponse: additionalProperties: false example: @@ -9488,11 +10794,13 @@ components: pricingSchedules: - endDate: 2000-01-23T04:56:07.000+00:00 pricePlanName: pricePlanName + id: id pricePlanId: pricePlanId pricePlanDetailsOverride: null startDate: 2000-01-23T04:56:07.000+00:00 - endDate: 2000-01-23T04:56:07.000+00:00 pricePlanName: pricePlanName + id: id pricePlanId: pricePlanId pricePlanDetailsOverride: null startDate: 2000-01-23T04:56:07.000+00:00 @@ -9569,6 +10877,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null slabRevenueSummaries: - revenue: 5.637376656633329 metadata: @@ -9634,6 +10943,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null slabRevenueSummaries: - revenue: 5.637376656633329 metadata: @@ -9670,6 +10980,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -9678,6 +10989,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -10319,6 +11631,7 @@ components: enum: - VALUE - JSON_LOGIC + - JSON_LOGIC_FROM_DEPENDENCY type: string value: type: string @@ -10486,10 +11799,13 @@ components: example: endDate: 2000-01-23T04:56:07.000+00:00 pricePlanName: pricePlanName + id: id pricePlanId: pricePlanId pricePlanDetailsOverride: null startDate: 2000-01-23T04:56:07.000+00:00 properties: + id: + type: string pricePlanId: type: string pricePlanName: @@ -10504,6 +11820,7 @@ components: type: string required: - endDate + - id - pricePlanId - pricePlanName - startDate @@ -10586,21 +11903,13 @@ components: description: Request to create an addon example: name: name - type: ONE_TIME properties: name: description: Name of addon maxLength: 255 type: string - type: - description: Type of addon - enum: - - ONE_TIME - - RECURRING - type: string required: - name - - type type: object CreatePricePlanDetailsOverride: example: @@ -10622,6 +11931,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -10630,6 +11940,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -10755,16 +12066,19 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null properties: id: - description: Auto generated unique identifier for fixed fees. + description: Unique Identifier of the attached AddOn maxLength: 50 type: string displayName: - description: Name of the fixed fee. + description: Name of the attached AddOn type: string invoiceTiming: $ref: '#/components/schemas/InvoiceTiming' + type: + $ref: '#/components/schemas/FixedFeeType' rateValues: items: $ref: '#/components/schemas/CurrencyRateValue' @@ -10774,6 +12088,14 @@ components: - rateValues title: FixedFeeRateCard type: object + FixedFeeType: + default: RECURRING + description: Fixed fee applies either for a one-time occurrence or for each + cycle. + enum: + - ONE_TIME + - RECURRING + type: string InvoiceTiming: description: | If IN_ADVANCE, the fixed fee will be invoiced in the previous billing cycle. @@ -10830,6 +12152,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -10838,6 +12161,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -10922,6 +12246,8 @@ components: - activeCurrencies - activeCurrencies endDate: 2000-01-23T04:56:07.000+00:00 + id: id + version: 1 startDate: 2000-01-23T04:56:07.000+00:00 - pricePlanDetails: supportedCurrencies: @@ -10942,6 +12268,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -10950,6 +12277,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -11034,6 +12362,8 @@ components: - activeCurrencies - activeCurrencies endDate: 2000-01-23T04:56:07.000+00:00 + id: id + version: 1 startDate: 2000-01-23T04:56:07.000+00:00 name: name description: description @@ -11088,6 +12418,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -11096,6 +12427,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -11287,6 +12619,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -11295,6 +12628,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -11379,8 +12713,12 @@ components: - activeCurrencies - activeCurrencies endDate: 2000-01-23T04:56:07.000+00:00 + id: id + version: 1 startDate: 2000-01-23T04:56:07.000+00:00 properties: + id: + type: string pricePlanDetails: $ref: '#/components/schemas/PricePlanDetails' startDate: @@ -11389,9 +12727,15 @@ components: endDate: format: date-time type: string + version: + format: int32 + minimum: 1 + type: integer required: - endDate + - id - startDate + - version type: object RatePlan: description: Contains all rate related configurations @@ -11558,6 +12902,7 @@ components: example: event: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11589,6 +12934,7 @@ components: example: events: - accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11611,6 +12957,7 @@ components: dimensions: key: "{\"Country\":\"India\"}" - accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11633,6 +12980,7 @@ components: dimensions: key: "{\"Country\":\"India\"}" - accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11655,6 +13003,7 @@ components: dimensions: key: "{\"Country\":\"India\"}" - accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11677,6 +13026,7 @@ components: dimensions: key: "{\"Country\":\"India\"}" - accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11694,199 +13044,45 @@ components: name: message value: "100" id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - properties: - events: - items: - $ref: '#/components/schemas/Event' - maxItems: 100 - minItems: 1 - type: array - required: - - events - type: object - IngestError: - additionalProperties: false - description: "" - example: - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message - properties: - message: - maxLength: 500 - type: string - eventPayload: - $ref: '#/components/schemas/Event' - type: object - IngestEventResponse: - additionalProperties: false + schemaName: schemaName + timestamp: 2000-01-23T04:56:07.000+00:00 + dimensions: + key: "{\"Country\":\"India\"}" properties: - ingestionRequestId: - description: "On successful ingestion acceptance request, ingestion request\ - \ id will be returned. This ingestion id can be used by clients to query\ - \ the status of ingestion (IN_PROGRESS, COMPLETED)." - maxLength: 500 - type: string + events: + items: + $ref: '#/components/schemas/Event' + maxItems: 500 + minItems: 1 + type: array required: - - ingestionRequestId + - events type: object - IngestBatchEventResponse: + IngestEventResponse: additionalProperties: false example: - errors: - - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message - - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message - - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message - - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message - - eventPayload: - accountId: "1" - attributes: - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - - unit: characters - name: message - value: "100" - id: c0b1306d-f506-43a6-856b-69221efaee6b - schemaName: schemaName - timestamp: 2000-01-23T04:56:07.000+00:00 - dimensions: - key: "{\"Country\":\"India\"}" - message: message + code: code + success: true + name: name + details: "{}" + message: message + statusCode: 0 properties: - errors: - items: - $ref: '#/components/schemas/IngestError' - maxItems: 100 - type: array - required: - - errors + success: + example: true + type: boolean + statusCode: + format: int32 + type: integer + name: + type: string + message: + maxLength: 500 + type: string + code: + type: string + details: + type: object type: object StatusResponse: properties: @@ -11915,6 +13111,7 @@ components: description: Name of the event attribute example: message maxLength: 50 + minLength: 1 type: string value: description: Value of the event attribute @@ -11928,6 +13125,7 @@ components: . Clients are free to add any other custom units." example: characters maxLength: 50 + minLength: 1 type: string required: - name @@ -11937,6 +13135,7 @@ components: additionalProperties: example: "{\"Country\":\"India\"}" maxLength: 50 + minLength: 1 type: string description: Dimensions are tags/labels associated with the events. type: object @@ -11945,6 +13144,7 @@ components: description: Contents of the event example: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -11970,6 +13170,7 @@ components: schemaName: description: "Name of the Event Schema. \nKnow more about [event schema](https://docs.togai.com/docs/event-schemas)\n" maxLength: 50 + minLength: 1 type: string id: description: "A unique value to identify the event instance. This unique\ @@ -12007,12 +13208,19 @@ components: additionalProperties: example: "{\"Country\":\"India\"}" maxLength: 50 + minLength: 1 type: string description: Dimensions are tags/labels associated with the events. type: object + createdAt: + description: Created time stamp of the event. This timestamp must be in + ISO 8601 format. + format: date-time + type: string required: - accountId - attributes + - createdAt - dimensions - id - schemaName @@ -12045,6 +13253,7 @@ components: customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12066,12 +13275,16 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type - ingestionStatus: statusDescription: Ingestion Completed successfully status: INGESTION_COMPLETED customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12093,12 +13306,16 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type - ingestionStatus: statusDescription: Ingestion Completed successfully status: INGESTION_COMPLETED customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12120,12 +13337,16 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type - ingestionStatus: statusDescription: Ingestion Completed successfully status: INGESTION_COMPLETED customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12147,12 +13368,16 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type - ingestionStatus: statusDescription: Ingestion Completed successfully status: INGESTION_COMPLETED customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12174,6 +13399,9 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type properties: events: items: @@ -12199,6 +13427,7 @@ components: customerId: "1" eventPayload: accountId: "1" + createdAt: 2000-01-23T04:56:07.000+00:00 attributes: - unit: characters name: message @@ -12220,6 +13449,9 @@ components: timestamp: 2000-01-23T04:56:07.000+00:00 dimensions: key: "{\"Country\":\"India\"}" + source: + id: id + type: type properties: eventPayload: $ref: '#/components/schemas/Event' @@ -12230,6 +13462,8 @@ components: example: "1" maxLength: 50 type: string + source: + $ref: '#/components/schemas/EventSource' required: - eventPayload - ingestionStatus @@ -12253,7 +13487,6 @@ components: - INGESTION_FAILED_SCHEMA_NOT_DEFINED - INGESTION_FAILED_ENRICHMENT_FAILED - INGESTION_FAILED_UNITS_INVALID - - INGESTION_FAILED_EVENT_INVALID - INGESTION_COMPLETED_NO_MATCHING_METERS - INGESTION_COMPLETED_EVENT_METERED - INGESTION_COMPLETED_EVENT_NOT_METERED @@ -12267,6 +13500,25 @@ components: required: - status type: object + EventSource: + additionalProperties: false + description: Source of ingestion of event + example: + id: id + type: type + properties: + id: + description: Unique identifier representing the source + maxLength: 100 + type: string + type: + description: Type of source + maxLength: 100 + type: string + required: + - id + - type + type: object EventPipelineInfo: additionalProperties: false description: Information related to ingestion of an event @@ -12317,7 +13569,7 @@ components: enum: - SETTING type: string - alias: + name: type: string value: type: string @@ -12413,11 +13665,15 @@ components: Define the metric you would like to get - allowed options are EVENTS - Aggregation of raw events, USAGE - Aggregated usage value from Usage meters, - REVENUE - Aggregated of revenue value from Pricing Plans + REVENUE - Aggregated revenue value from Pricing Plans + USAGE_FOR_CYCLE - Usage in pricing cycle + REVENUE_FOR_CYCLE - Revenue in pricing cycle enum: - EVENTS - USAGE - REVENUE + - USAGE_FOR_CYCLE + - REVENUE_FOR_CYCLE type: string MetricQuery: additionalProperties: false @@ -12476,9 +13732,10 @@ components: type: string description: | Configurations. - | Metric Name | Config Key | Allowed Values | Default value | Description | - |-------------|------------|-----------------|---------------|-----------------------------------| - | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | + | Metric Name | Config Key | Allowed Values | Default value | Description | + |-------------------|------------|-----------------|---------------|-----------------------------------| + | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | + | REVENUE_FOR_CYCLE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | type: object filters: description: "Filter on specific fields. \nRefer possible fieldNames and\ @@ -12712,6 +13969,8 @@ components: type: number invoiceTiming: $ref: '#/components/schemas/InvoiceTiming' + type: + $ref: '#/components/schemas/FixedFeeType' required: - currency - displayName @@ -12759,6 +14018,11 @@ components: creditAmount: 1000 priority: 1 effectiveFrom: 2020-07-04T00:00:00.000+00:00 + applicableEntityIds: + - "[\"umg.1znQx9jiIXw.r44fc\",\"ALL_USAGE_METER_RATE_CARDS\",\"ALL_FIXED_FEE_RATE_CARDS\"\ + ]" + - "[\"umg.1znQx9jiIXw.r44fc\",\"ALL_USAGE_METER_RATE_CARDS\",\"ALL_FIXED_FEE_RATE_CARDS\"\ + ]" properties: accountId: example: ACC001 @@ -12766,6 +14030,15 @@ components: purpose: example: PREPAID_CREDIT type: string + applicableEntityIds: + description: | + List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards + items: + example: "[\"umg.1znQx9jiIXw.r44fc\",\"ALL_USAGE_METER_RATE_CARDS\",\"\ + ALL_FIXED_FEE_RATE_CARDS\"]" + type: string + type: array + uniqueItems: true effectiveFrom: example: 2020-07-04 format: date @@ -12787,6 +14060,40 @@ components: - priority - purpose type: object + ManageMiscellaneousChargesRequest: + additionalProperties: false + description: Payload to update custom line items + example: + items: + - name: Charge 1 + value: "100" + - name: Charge 1 + value: "100" + properties: + items: + items: + $ref: '#/components/schemas/MiscellaneousCharge' + type: array + required: + - items + type: object + MiscellaneousChargesResponse: + additionalProperties: false + description: Miscellaneous charges response + example: + data: + - name: Charge 1 + value: "100" + - name: Charge 1 + value: "100" + properties: + data: + items: + $ref: '#/components/schemas/MiscellaneousCharge' + type: array + required: + - data + type: object ListInvoicesResponse: additionalProperties: false description: List invoices response @@ -12807,6 +14114,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12821,6 +14129,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12837,6 +14146,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12870,6 +14180,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12884,6 +14195,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12900,6 +14212,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12933,6 +14246,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12947,6 +14261,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12963,6 +14278,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -12996,6 +14312,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13010,6 +14327,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13026,6 +14344,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13059,6 +14378,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13073,6 +14393,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13089,6 +14410,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13202,6 +14524,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13216,6 +14539,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13232,6 +14556,7 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 @@ -13324,10 +14649,13 @@ components: key: "" quantity: 6.027456183070403 description: description + id: id units: units type: type value: 1.4658129805029452 properties: + id: + type: string description: type: string type: @@ -13419,6 +14747,10 @@ components: - id - transactionType type: object + MiscellaneousCharges: + items: + $ref: '#/components/schemas/MiscellaneousCharge' + type: array CurrencyConfig: description: Configuration for getting the currency example: @@ -13452,6 +14784,7 @@ components: example: mode: CUSTOM accountId: accountId + pricingCycleOrdinal: 0 pricePlanDetails: supportedCurrencies: - supportedCurrencies @@ -13471,6 +14804,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null - invoiceTiming: null displayName: displayName rateValues: @@ -13479,6 +14813,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null usageRateCards: - ratePlan: pricingModel: null @@ -13588,6 +14923,10 @@ components: \ mode is ACCOUNT or PRICE_PLAN" format: date-time type: string + pricingCycleOrdinal: + description: "nth cycle, will be used to calculate revenue for the particular\ + \ cycle, only used if mode is CUSTOM or PRICE_PLAN" + type: integer required: - mode title: PricePlanDetailsConfig @@ -13642,7 +14981,7 @@ components: start: 2000-01-23T04:56:07.000+00:00 end: 2000-01-23T04:56:07.000+00:00 usageMap: - key: 0.8008281904610115 + key: 6.027456183070403 properties: mode: description: | @@ -13711,6 +15050,14 @@ components: - rate title: FixedFeeRate type: object + PricingScheduleWithPricePlanId_allOf: + properties: + pricePlanId: + type: string + required: + - pricePlanId + type: object + example: null UsageLookupRange: additionalProperties: false description: Start and end dates of usage lookup if usage mode is LOOKUP @@ -13790,6 +15137,7 @@ components: - rate: 5.637376656633329 currency: currency id: id + type: null slabRevenueSummaries: - revenue: 5.637376656633329 metadata: @@ -14059,25 +15407,27 @@ components: additionalProperties: false description: |2 - | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | - |-------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| - | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | - CUSTOMER_ID | - | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | - CUSTOMER_ID | - | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | - CUSTOMER_ID | - | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | - CUSTOMER_ID | - | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | - | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | - | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | - | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | + | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | + |-------------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| + | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | + | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | + | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\ | + | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | + | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | + | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | + | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | + | USAGE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | USAGE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | USAGE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | + | REVENUE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\ | example: fieldName: ACCOUNT_ID fieldValues: @@ -14283,6 +15633,27 @@ components: - status type: object example: null + MiscellaneousCharge: + additionalProperties: false + description: Miscellaneous charges are the charges that can be added to the + invoice + example: + name: Charge 1 + value: "100" + properties: + name: + description: Name of the miscellaneous charge + example: Charge 1 + type: string + value: + description: Value of the charge + example: "100" + type: string + required: + - name + - value + title: MiscellaneousCharge + type: object securitySchemes: bearerAuth: bearerFormat: Bearer diff --git a/build.gradle b/build.gradle index ad97e98..7f27bcb 100644 --- a/build.gradle +++ b/build.gradle @@ -2,22 +2,18 @@ apply plugin: 'idea' apply plugin: 'eclipse' apply plugin: 'java' apply plugin: 'com.diffplug.spotless' -apply plugin: 'com.github.johnrengelman.shadow' - group = 'com.togai' version = '1.0.2' buildscript { repositories { - gradlePluginPortal() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' - classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2' + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' } } @@ -69,7 +65,7 @@ if(hasProperty('target') && target == 'android') { task.from variant.javaCompile.destinationDir task.destinationDir = project.file("${project.buildDir}/outputs/jar") task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" - artifacts.add('archives', task); + artifacts.add('archives', task) } } @@ -110,20 +106,20 @@ ext { } dependencies { - implementation 'io.swagger:swagger-annotations:1.6.5' + implementation 'io.swagger:swagger-annotations:1.6.8' implementation "com.google.code.findbugs:jsr305:3.0.2" - implementation 'com.squareup.okhttp3:okhttp:4.9.3' - implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.10.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'io.gsonfire:gson-fire:1.8.5' implementation 'javax.ws.rs:jsr311-api:1.1.1' implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1' - implementation 'org.openapitools:jackson-databind-nullable:0.2.3' + implementation 'org.openapitools:jackson-databind-nullable:0.2.4' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1' testImplementation 'org.mockito:mockito-core:3.12.4' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1' } javadoc { diff --git a/docs/AccountsApi.md b/docs/AccountsApi.md index 95902b0..542a204 100644 --- a/docs/AccountsApi.md +++ b/docs/AccountsApi.md @@ -4,19 +4,21 @@ All URIs are relative to *https://api.togai.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**addAliases**](AccountsApi.md#addAliases) | **POST** /customers/{customer_id}/accounts/{account_id}/add_aliases | Add Aliases to account | -| [**createAccount**](AccountsApi.md#createAccount) | **POST** /customers/{customer_id}/accounts | Create an account | -| [**deleteAccount**](AccountsApi.md#deleteAccount) | **DELETE** /customers/{customer_id}/accounts/{account_id} | Delete an account | -| [**getAccount**](AccountsApi.md#getAccount) | **GET** /customers/{customer_id}/accounts/{account_id} | Get an account | -| [**getAccounts**](AccountsApi.md#getAccounts) | **GET** /customers/{customer_id}/accounts | List accounts of customer | -| [**removeAliases**](AccountsApi.md#removeAliases) | **POST** /customers/{customer_id}/accounts/{account_id}/remove_aliases | Remove Aliases to account | -| [**updateAccount**](AccountsApi.md#updateAccount) | **PATCH** /customers/{customer_id}/accounts/{account_id} | Update an account | -| [**updatePricingSchedule**](AccountsApi.md#updatePricingSchedule) | **POST** /customers/{customer_id}/accounts/{account_id}/price_plans | Dis/associate a plan from/to an account | +| [**addAliases**](AccountsApi.md#addAliases) | **POST** /accounts/{account_id}/add_aliases | Add Aliases to account | +| [**createAccount**](AccountsApi.md#createAccount) | **POST** /accounts | Create an account | +| [**deleteAccount**](AccountsApi.md#deleteAccount) | **DELETE** /accounts/{account_id} | Delete an account | +| [**getAccount**](AccountsApi.md#getAccount) | **GET** /accounts/{account_id} | Get an account | +| [**getAccounts**](AccountsApi.md#getAccounts) | **GET** /accounts | List accounts of customer | +| [**getPricingSchedules**](AccountsApi.md#getPricingSchedules) | **GET** /accounts/{account_id}/pricing_schedules | List pricing schedules of an account | +| [**removeAliases**](AccountsApi.md#removeAliases) | **POST** /accounts/{account_id}/remove_aliases | Remove Aliases to account | +| [**updateAccount**](AccountsApi.md#updateAccount) | **PATCH** /accounts/{account_id} | Update an account | +| [**updatePricingSchedule**](AccountsApi.md#updatePricingSchedule) | **POST** /accounts/{account_id}/price_plans | Dis/associate a plan from/to an account | +| [**updatePricingScheduleBatch**](AccountsApi.md#updatePricingScheduleBatch) | **POST** /accounts/{account_id}/edit_schedules | Edit schedules of an account. | # **addAliases** -> Account addAliases(customerId, accountId, addAccountAliasesRequest) +> Account addAliases(accountId, addAccountAliasesRequest) Add Aliases to account @@ -42,11 +44,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account AddAccountAliasesRequest addAccountAliasesRequest = new AddAccountAliasesRequest(); // AddAccountAliasesRequest | Payload to add aliases to account try { - Account result = apiInstance.addAliases(customerId, accountId, addAccountAliasesRequest); + Account result = apiInstance.addAliases(accountId, addAccountAliasesRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#addAliases"); @@ -63,7 +64,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | | **addAccountAliasesRequest** | [**AddAccountAliasesRequest**](AddAccountAliasesRequest.md)| Payload to add aliases to account | | @@ -93,7 +93,7 @@ public class Example { # **createAccount** -> Account createAccount(customerId, createAccountRequest) +> Account createAccount(createAccountRequest) Create an account @@ -119,10 +119,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | CreateAccountRequest createAccountRequest = new CreateAccountRequest(); // CreateAccountRequest | Payload to create account try { - Account result = apiInstance.createAccount(customerId, createAccountRequest); + Account result = apiInstance.createAccount(createAccountRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#createAccount"); @@ -139,7 +138,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **createAccountRequest** | [**CreateAccountRequest**](CreateAccountRequest.md)| Payload to create account | | ### Return type @@ -168,7 +166,7 @@ public class Example { # **deleteAccount** -> BaseSuccessResponse deleteAccount(customerId, accountId) +> BaseSuccessResponse deleteAccount(accountId) Delete an account @@ -194,10 +192,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account try { - BaseSuccessResponse result = apiInstance.deleteAccount(customerId, accountId); + BaseSuccessResponse result = apiInstance.deleteAccount(accountId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#deleteAccount"); @@ -214,7 +211,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | ### Return type @@ -243,7 +239,7 @@ public class Example { # **getAccount** -> Account getAccount(customerId, accountId) +> Account getAccount(accountId) Get an account @@ -269,10 +265,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account try { - Account result = apiInstance.getAccount(customerId, accountId); + Account result = apiInstance.getAccount(accountId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#getAccount"); @@ -289,7 +284,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | ### Return type @@ -318,7 +312,7 @@ public class Example { # **getAccounts** -> AccountPaginatedResponse getAccounts(customerId, nextToken, pageSize) +> AccountPaginatedResponse getAccounts(nextToken, pageSize) List accounts of customer @@ -344,11 +338,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String nextToken = "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="; // String | BigDecimal pageSize = new BigDecimal("10"); // BigDecimal | try { - AccountPaginatedResponse result = apiInstance.getAccounts(customerId, nextToken, pageSize); + AccountPaginatedResponse result = apiInstance.getAccounts(nextToken, pageSize); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#getAccounts"); @@ -365,7 +358,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **nextToken** | **String**| | [optional] | | **pageSize** | **BigDecimal**| | [optional] | @@ -393,9 +385,90 @@ public class Example { | **429** | Error response | - | | **0** | Error response | - | + +# **getPricingSchedules** +> PricingSchedulePaginatedResponse getPricingSchedules(accountId, nextToken, pageSize, startDate, endDate) + +List pricing schedules of an account + +Returns a list of pricing schedules of an account with pagination and sort. + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.AccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AccountsApi apiInstance = new AccountsApi(defaultClient); + String accountId = "accountId_example"; // String | account_id corresponding to an account + String nextToken = "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="; // String | + BigDecimal pageSize = new BigDecimal("10"); // BigDecimal | + String startDate = "2023-03-30T10:41:10.088499"; // String | + String endDate = "2099-03-30T10:41:10.088499"; // String | + try { + PricingSchedulePaginatedResponse result = apiInstance.getPricingSchedules(accountId, nextToken, pageSize, startDate, endDate); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountsApi#getPricingSchedules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| account_id corresponding to an account | | +| **nextToken** | **String**| | [optional] | +| **pageSize** | **BigDecimal**| | [optional] | +| **startDate** | **String**| | [optional] | +| **endDate** | **String**| | [optional] | + +### Return type + +[**PricingSchedulePaginatedResponse**](PricingSchedulePaginatedResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response for list pricing schedules request | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + # **removeAliases** -> Account removeAliases(customerId, accountId, removeAccountAliasesRequest) +> Account removeAliases(accountId, removeAccountAliasesRequest) Remove Aliases to account @@ -421,11 +494,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account RemoveAccountAliasesRequest removeAccountAliasesRequest = new RemoveAccountAliasesRequest(); // RemoveAccountAliasesRequest | Payload to remove aliases from account try { - Account result = apiInstance.removeAliases(customerId, accountId, removeAccountAliasesRequest); + Account result = apiInstance.removeAliases(accountId, removeAccountAliasesRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#removeAliases"); @@ -442,7 +514,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | | **removeAccountAliasesRequest** | [**RemoveAccountAliasesRequest**](RemoveAccountAliasesRequest.md)| Payload to remove aliases from account | | @@ -472,7 +543,7 @@ public class Example { # **updateAccount** -> Account updateAccount(customerId, accountId, updateAccountRequest) +> Account updateAccount(accountId, updateAccountRequest) Update an account @@ -498,11 +569,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account UpdateAccountRequest updateAccountRequest = new UpdateAccountRequest(); // UpdateAccountRequest | Payload to update account try { - Account result = apiInstance.updateAccount(customerId, accountId, updateAccountRequest); + Account result = apiInstance.updateAccount(accountId, updateAccountRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#updateAccount"); @@ -519,7 +589,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | | **updateAccountRequest** | [**UpdateAccountRequest**](UpdateAccountRequest.md)| Payload to update account | | @@ -549,7 +618,7 @@ public class Example { # **updatePricingSchedule** -> UpdatePricingScheduleResponse updatePricingSchedule(customerId, accountId, updatePricingScheduleRequest) +> UpdatePricingScheduleResponse updatePricingSchedule(accountId, updatePricingScheduleRequest) Dis/associate a plan from/to an account @@ -575,11 +644,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); AccountsApi apiInstance = new AccountsApi(defaultClient); - String customerId = "customerId_example"; // String | String accountId = "accountId_example"; // String | account_id corresponding to an account UpdatePricingScheduleRequest updatePricingScheduleRequest = new UpdatePricingScheduleRequest(); // UpdatePricingScheduleRequest | Payload to dis/associate a price plan to an account try { - UpdatePricingScheduleResponse result = apiInstance.updatePricingSchedule(customerId, accountId, updatePricingScheduleRequest); + UpdatePricingScheduleResponse result = apiInstance.updatePricingSchedule(accountId, updatePricingScheduleRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AccountsApi#updatePricingSchedule"); @@ -596,7 +664,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **customerId** | **String**| | | | **accountId** | **String**| account_id corresponding to an account | | | **updatePricingScheduleRequest** | [**UpdatePricingScheduleRequest**](UpdatePricingScheduleRequest.md)| Payload to dis/associate a price plan to an account | | @@ -624,3 +691,78 @@ public class Example { | **429** | Error response | - | | **0** | Error response | - | + +# **updatePricingScheduleBatch** +> UpdatePricingScheduleResponse updatePricingScheduleBatch(accountId, editPricingScheduleRequest) + +Edit schedules of an account. + +This API let’s you to detach/attach one or more price plans from/to an existing account + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.AccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + AccountsApi apiInstance = new AccountsApi(defaultClient); + String accountId = "accountId_example"; // String | account_id corresponding to an account + EditPricingScheduleRequest editPricingScheduleRequest = new EditPricingScheduleRequest(); // EditPricingScheduleRequest | Payload to dis/associate one or more price plans to an account + try { + UpdatePricingScheduleResponse result = apiInstance.updatePricingScheduleBatch(accountId, editPricingScheduleRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountsApi#updatePricingScheduleBatch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| account_id corresponding to an account | | +| **editPricingScheduleRequest** | [**EditPricingScheduleRequest**](EditPricingScheduleRequest.md)| Payload to dis/associate one or more price plans to an account | | + +### Return type + +[**UpdatePricingScheduleResponse**](UpdatePricingScheduleResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response for edit pricing schedule request | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + diff --git a/docs/AddOn.md b/docs/AddOn.md index 55ec2ad..df1d358 100644 --- a/docs/AddOn.md +++ b/docs/AddOn.md @@ -8,22 +8,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**name** | **String** | Name of addon | | -|**type** | [**TypeEnum**](#TypeEnum) | Type of addon | | |**id** | **String** | Id of addon | | |**createdAt** | **OffsetDateTime** | Created Time of addon | | |**status** | [**StatusEnum**](#StatusEnum) | status of addon | | -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| ONE_TIME | "ONE_TIME" | -| RECURRING | "RECURRING" | - - - ## Enum: StatusEnum | Name | Value | diff --git a/docs/CreateAccountRequest.md b/docs/CreateAccountRequest.md index 04d85ee..0e16152 100644 --- a/docs/CreateAccountRequest.md +++ b/docs/CreateAccountRequest.md @@ -13,6 +13,7 @@ Payload to create account |**invoiceCurrency** | **String** | Use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in which the account must be invoiced. For example: AED is the currency code for United Arab Emirates dirham. | [optional] | |**aliases** | **List<String>** | Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account. | [optional] | |**settings** | [**List<CreateEntitySetting>**](CreateEntitySetting.md) | | [optional] | +|**customerId** | **String** | Customer Identifier for whom the account is being created | | ## Implemented Interfaces diff --git a/docs/CreateAccountRequestWithoutCustomerId.md b/docs/CreateAccountRequestWithoutCustomerId.md new file mode 100644 index 0000000..3dc2b2d --- /dev/null +++ b/docs/CreateAccountRequestWithoutCustomerId.md @@ -0,0 +1,22 @@ + + +# CreateAccountRequestWithoutCustomerId + +Payload to create account + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Identifier of the account | | +|**name** | **String** | Name of the Account | | +|**invoiceCurrency** | **String** | Use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in which the account must be invoiced. For example: AED is the currency code for United Arab Emirates dirham. | [optional] | +|**aliases** | **List<String>** | Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account. | [optional] | +|**settings** | [**List<CreateEntitySetting>**](CreateEntitySetting.md) | | [optional] | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/CreateAddOnRequest.md b/docs/CreateAddOnRequest.md index aebdab7..893133c 100644 --- a/docs/CreateAddOnRequest.md +++ b/docs/CreateAddOnRequest.md @@ -9,16 +9,6 @@ Request to create an addon | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**name** | **String** | Name of addon | | -|**type** | [**TypeEnum**](#TypeEnum) | Type of addon | | - - - -## Enum: TypeEnum - -| Name | Value | -|---- | -----| -| ONE_TIME | "ONE_TIME" | -| RECURRING | "RECURRING" | ## Implemented Interfaces diff --git a/docs/CreateCreditRequest.md b/docs/CreateCreditRequest.md index 44db9ff..aed3887 100644 --- a/docs/CreateCreditRequest.md +++ b/docs/CreateCreditRequest.md @@ -10,6 +10,7 @@ Payload to grant Credits |------------ | ------------- | ------------- | -------------| |**accountId** | **String** | | | |**purpose** | **String** | | | +|**applicableEntityIds** | **Set<String>** | List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards | [optional] | |**effectiveFrom** | **LocalDate** | | | |**effectiveUntil** | **LocalDate** | | [optional] | |**creditAmount** | **BigDecimal** | | | diff --git a/docs/CreateCustomerRequest.md b/docs/CreateCustomerRequest.md index 96155b9..87f821f 100644 --- a/docs/CreateCustomerRequest.md +++ b/docs/CreateCustomerRequest.md @@ -13,7 +13,7 @@ Payload to create customer |**primaryEmail** | **String** | Primary email of the customer | | |**billingAddress** | **String** | billing address of the customer | | |**settings** | [**List<CreateEntitySetting>**](CreateEntitySetting.md) | | [optional] | -|**account** | [**CreateAccountRequest**](CreateAccountRequest.md) | | [optional] | +|**account** | [**CreateAccountRequestWithoutCustomerId**](CreateAccountRequestWithoutCustomerId.md) | | [optional] | ## Implemented Interfaces diff --git a/docs/CreateUsageMeterRequest.md b/docs/CreateUsageMeterRequest.md index 025cf6b..5da697d 100644 --- a/docs/CreateUsageMeterRequest.md +++ b/docs/CreateUsageMeterRequest.md @@ -13,6 +13,7 @@ Request to create usage meter |**type** | [**TypeEnum**](#TypeEnum) | Type of usage meter | | |**aggregation** | [**AggregationEnum**](#AggregationEnum) | Aggregation to be applied on usage meter result | | |**computations** | [**List<Computation>**](Computation.md) | | [optional] | +|**eventSchemaName** | **String** | Event Schema Identifier | | diff --git a/docs/Credit.md b/docs/Credit.md index ace5029..ae975a7 100644 --- a/docs/Credit.md +++ b/docs/Credit.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**accountId** | **String** | | | |**purpose** | **String** | | | +|**applicableEntityIds** | **Set<String>** | List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards | [optional] | |**effectiveFrom** | **LocalDate** | | | |**effectiveUntil** | **LocalDate** | | [optional] | |**creditAmount** | **BigDecimal** | | | diff --git a/docs/CreditDetailsResponse.md b/docs/CreditDetailsResponse.md index 8665362..34287bb 100644 --- a/docs/CreditDetailsResponse.md +++ b/docs/CreditDetailsResponse.md @@ -9,6 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**accountId** | **String** | | | |**purpose** | **String** | | | +|**applicableEntityIds** | **Set<String>** | List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards | [optional] | |**effectiveFrom** | **LocalDate** | | | |**effectiveUntil** | **LocalDate** | | [optional] | |**creditAmount** | **BigDecimal** | | | diff --git a/docs/EditPricingScheduleRequest.md b/docs/EditPricingScheduleRequest.md new file mode 100644 index 0000000..408f4dc --- /dev/null +++ b/docs/EditPricingScheduleRequest.md @@ -0,0 +1,18 @@ + + +# EditPricingScheduleRequest + +Request to dis/associate one or more schedules to an account + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**edits** | [**List<UpdatePricingScheduleRequest>**](UpdatePricingScheduleRequest.md) | | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/EnrichmentDependency.md b/docs/EnrichmentDependency.md index c49af61..1412169 100644 --- a/docs/EnrichmentDependency.md +++ b/docs/EnrichmentDependency.md @@ -10,7 +10,7 @@ enrichment dependency |------------ | ------------- | ------------- | -------------| |**key** | **String** | | | |**type** | [**TypeEnum**](#TypeEnum) | | | -|**alias** | **String** | | [optional] | +|**name** | **String** | | [optional] | |**value** | **String** | | | diff --git a/docs/Event.md b/docs/Event.md index 3617dcd..dc431b6 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -14,6 +14,7 @@ Contents of the event |**accountId** | **String** | The event will be associated with the provided account | | |**attributes** | [**List<Attribute>**](Attribute.md) | Attributes are numeric values. It can be usage metric which you push to Togai | | |**dimensions** | **Map<String, String>** | Dimensions are tags/labels associated with the events. | | +|**createdAt** | **OffsetDateTime** | Created time stamp of the event. This timestamp must be in ISO 8601 format. | | ## Implemented Interfaces diff --git a/docs/EventIngestionApi.md b/docs/EventIngestionApi.md index 340ebd8..f0fe237 100644 --- a/docs/EventIngestionApi.md +++ b/docs/EventIngestionApi.md @@ -10,7 +10,7 @@ All URIs are relative to *https://api.togai.com* # **ingest** -> ingest(ingestEventRequest) +> IngestEventResponse ingest(ingestEventRequest) Ingest events to Togai @@ -38,7 +38,8 @@ public class Example { EventIngestionApi apiInstance = new EventIngestionApi(defaultClient); IngestEventRequest ingestEventRequest = new IngestEventRequest(); // IngestEventRequest | Request body to ingest events to Togai usage and billing management service. try { - apiInstance.ingest(ingestEventRequest); + IngestEventResponse result = apiInstance.ingest(ingestEventRequest); + System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling EventIngestionApi#ingest"); System.err.println("Status code: " + e.getCode()); @@ -58,7 +59,7 @@ public class Example { ### Return type -null (empty response body) +[**IngestEventResponse**](IngestEventResponse.md) ### Authorization @@ -82,7 +83,7 @@ null (empty response body) # **ingestBatch** -> IngestBatchEventResponse ingestBatch(ingestBatchEventRequest) +> IngestEventResponse ingestBatch(ingestBatchEventRequest) Ingest events to Togai in batch @@ -110,7 +111,7 @@ public class Example { EventIngestionApi apiInstance = new EventIngestionApi(defaultClient); IngestBatchEventRequest ingestBatchEventRequest = new IngestBatchEventRequest(); // IngestBatchEventRequest | Request body to ingest events in batch to Togai usage and billing management service. try { - IngestBatchEventResponse result = apiInstance.ingestBatch(ingestBatchEventRequest); + IngestEventResponse result = apiInstance.ingestBatch(ingestBatchEventRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling EventIngestionApi#ingestBatch"); @@ -131,7 +132,7 @@ public class Example { ### Return type -[**IngestBatchEventResponse**](IngestBatchEventResponse.md) +[**IngestEventResponse**](IngestEventResponse.md) ### Authorization diff --git a/docs/EventSource.md b/docs/EventSource.md new file mode 100644 index 0000000..c78c5c5 --- /dev/null +++ b/docs/EventSource.md @@ -0,0 +1,19 @@ + + +# EventSource + +Source of ingestion of event + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique identifier representing the source | | +|**type** | **String** | Type of source | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/EventWithStatus.md b/docs/EventWithStatus.md index 86747b5..aef7b0d 100644 --- a/docs/EventWithStatus.md +++ b/docs/EventWithStatus.md @@ -11,6 +11,7 @@ Raw usage event ingested by the business team and the status of the event ingest |**eventPayload** | [**Event**](Event.md) | | | |**ingestionStatus** | [**IngestionStatus**](IngestionStatus.md) | | | |**customerId** | **String** | The associated account belongs to this customer | [optional] | +|**source** | [**EventSource**](EventSource.md) | | [optional] | ## Implemented Interfaces diff --git a/docs/EventWithStatusAndEventPipelineInfo.md b/docs/EventWithStatusAndEventPipelineInfo.md index 4eb0dab..174287c 100644 --- a/docs/EventWithStatusAndEventPipelineInfo.md +++ b/docs/EventWithStatusAndEventPipelineInfo.md @@ -10,6 +10,7 @@ |**eventPayload** | [**Event**](Event.md) | | | |**ingestionStatus** | [**IngestionStatus**](IngestionStatus.md) | | | |**customerId** | **String** | The associated account belongs to this customer | [optional] | +|**source** | [**EventSource**](EventSource.md) | | [optional] | |**eventPipelineInfo** | [**EventPipelineInfo**](EventPipelineInfo.md) | | [optional] | diff --git a/docs/Field.md b/docs/Field.md index b95419a..2918d77 100644 --- a/docs/Field.md +++ b/docs/Field.md @@ -30,6 +30,7 @@ |---- | -----| | VALUE | "VALUE" | | JSON_LOGIC | "JSON_LOGIC" | +| JSON_LOGIC_FROM_DEPENDENCY | "JSON_LOGIC_FROM_DEPENDENCY" | ## Implemented Interfaces diff --git a/docs/FixedFeeRateCard.md b/docs/FixedFeeRateCard.md index 39ae887..7ed2517 100644 --- a/docs/FixedFeeRateCard.md +++ b/docs/FixedFeeRateCard.md @@ -7,9 +7,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | Auto generated unique identifier for fixed fees. | | -|**displayName** | **String** | Name of the fixed fee. | [optional] | +|**id** | **String** | Unique Identifier of the attached AddOn | | +|**displayName** | **String** | Name of the attached AddOn | [optional] | |**invoiceTiming** | **InvoiceTiming** | | [optional] | +|**type** | **FixedFeeType** | | [optional] | |**rateValues** | [**List<CurrencyRateValue>**](CurrencyRateValue.md) | | | diff --git a/docs/FixedFeeType.md b/docs/FixedFeeType.md new file mode 100644 index 0000000..aeae986 --- /dev/null +++ b/docs/FixedFeeType.md @@ -0,0 +1,13 @@ + + +# FixedFeeType + +## Enum + + +* `ONE_TIME` (value: `"ONE_TIME"`) + +* `RECURRING` (value: `"RECURRING"`) + + + diff --git a/docs/IngestBatchEventResponse.md b/docs/IngestBatchEventResponse.md index 8f9f241..cdd1b1e 100644 --- a/docs/IngestBatchEventResponse.md +++ b/docs/IngestBatchEventResponse.md @@ -7,7 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**errors** | [**List<IngestError>**](IngestError.md) | | | +|**success** | **Boolean** | | [optional] | +|**statusCode** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**code** | **String** | | [optional] | +|**details** | **Object** | | [optional] | ## Implemented Interfaces diff --git a/docs/IngestError.md b/docs/IngestError.md index d69175d..6d16475 100644 --- a/docs/IngestError.md +++ b/docs/IngestError.md @@ -8,8 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**statusCode** | **BigDecimal** | | [optional] | +|**name** | **String** | | [optional] | |**message** | **String** | | [optional] | -|**eventPayload** | [**Event**](Event.md) | | [optional] | +|**code** | **String** | | [optional] | ## Implemented Interfaces diff --git a/docs/IngestEventResponse.md b/docs/IngestEventResponse.md index 4381f7f..91a016c 100644 --- a/docs/IngestEventResponse.md +++ b/docs/IngestEventResponse.md @@ -7,7 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**ingestionRequestId** | **String** | On successful ingestion acceptance request, ingestion request id will be returned. This ingestion id can be used by clients to query the status of ingestion (IN_PROGRESS, COMPLETED). | | +|**success** | **Boolean** | | [optional] | +|**statusCode** | **Integer** | | [optional] | +|**name** | **String** | | [optional] | +|**message** | **String** | | [optional] | +|**code** | **String** | | [optional] | +|**details** | **Object** | | [optional] | ## Implemented Interfaces diff --git a/docs/IngestionStatus.md b/docs/IngestionStatus.md index c2071ec..8662595 100644 --- a/docs/IngestionStatus.md +++ b/docs/IngestionStatus.md @@ -22,7 +22,6 @@ Status about the event ingestion. | INGESTION_FAILED_SCHEMA_NOT_DEFINED | "INGESTION_FAILED_SCHEMA_NOT_DEFINED" | | INGESTION_FAILED_ENRICHMENT_FAILED | "INGESTION_FAILED_ENRICHMENT_FAILED" | | INGESTION_FAILED_UNITS_INVALID | "INGESTION_FAILED_UNITS_INVALID" | -| INGESTION_FAILED_EVENT_INVALID | "INGESTION_FAILED_EVENT_INVALID" | | INGESTION_COMPLETED_NO_MATCHING_METERS | "INGESTION_COMPLETED_NO_MATCHING_METERS" | | INGESTION_COMPLETED_EVENT_METERED | "INGESTION_COMPLETED_EVENT_METERED" | | INGESTION_COMPLETED_EVENT_NOT_METERED | "INGESTION_COMPLETED_EVENT_NOT_METERED" | diff --git a/docs/InternalFixedFeeRateCard.md b/docs/InternalFixedFeeRateCard.md index 7c9959c..20ac1a4 100644 --- a/docs/InternalFixedFeeRateCard.md +++ b/docs/InternalFixedFeeRateCard.md @@ -12,6 +12,7 @@ |**currency** | **String** | | | |**rate** | **BigDecimal** | | | |**invoiceTiming** | **InvoiceTiming** | | | +|**type** | **FixedFeeType** | | [optional] | ## Implemented Interfaces diff --git a/docs/InvoiceLineItem.md b/docs/InvoiceLineItem.md index 6c5295a..7b47f4f 100644 --- a/docs/InvoiceLineItem.md +++ b/docs/InvoiceLineItem.md @@ -7,6 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | |**description** | **String** | | | |**type** | **String** | Type of the line item - TOTAL_USAGE: List of all the usage meter usages - USAGE_METER_USAGE: A single usage meter usage - NET_REVENUE: Net revenue of the invoice ( Gross revenue - Discounts ) - GROSS_REVENUE: Gross revenue of the invoice - USAGE_RATE_CARD_REVENUE: Revenue generated from usage rate card - USAGE_RATE_CARD_SLAB_REVENUE: Revenue generated from usage rate card slab | | |**valuePerQuantity** | **BigDecimal** | | [optional] | diff --git a/docs/InvoicesApi.md b/docs/InvoicesApi.md index 4dbcd80..d8b6b6a 100644 --- a/docs/InvoicesApi.md +++ b/docs/InvoicesApi.md @@ -6,6 +6,8 @@ All URIs are relative to *https://api.togai.com* |------------- | ------------- | -------------| | [**getInvoice**](InvoicesApi.md#getInvoice) | **GET** /invoices/{invoice_id} | Get an invoice | | [**listInvoices**](InvoicesApi.md#listInvoices) | **GET** /invoices | List invoices | +| [**manageMiscellaneousChargesInAccount**](InvoicesApi.md#manageMiscellaneousChargesInAccount) | **PUT** /accounts/{account_id}/miscellaneous_charges | Add or update miscellaneous charges in upcoming Invoice for a account | +| [**manageMiscellaneousChargesInInvoice**](InvoicesApi.md#manageMiscellaneousChargesInInvoice) | **PUT** /invoices/{invoice_id}/miscellaneous_charges | Add or update miscellaneous charges in Invoice | @@ -166,3 +168,153 @@ public class Example { | **429** | Request throttled. Please check the response message on the failure details. | - | | **0** | Error response | - | + +# **manageMiscellaneousChargesInAccount** +> MiscellaneousChargesResponse manageMiscellaneousChargesInAccount(accountId, manageMiscellaneousChargesRequest) + +Add or update miscellaneous charges in upcoming Invoice for a account + +Add or update miscellaneous charges in upcoming Invoice for a account + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.InvoicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + InvoicesApi apiInstance = new InvoicesApi(defaultClient); + String accountId = "accountId_example"; // String | account_id corresponding to an account + ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest = new ManageMiscellaneousChargesRequest(); // ManageMiscellaneousChargesRequest | Payload to update custom line items + try { + MiscellaneousChargesResponse result = apiInstance.manageMiscellaneousChargesInAccount(accountId, manageMiscellaneousChargesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvoicesApi#manageMiscellaneousChargesInAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **accountId** | **String**| account_id corresponding to an account | | +| **manageMiscellaneousChargesRequest** | [**ManageMiscellaneousChargesRequest**](ManageMiscellaneousChargesRequest.md)| Payload to update custom line items | [optional] | + +### Return type + +[**MiscellaneousChargesResponse**](MiscellaneousChargesResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response for Miscellaneous Charges Request | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + + +# **manageMiscellaneousChargesInInvoice** +> MiscellaneousChargesResponse manageMiscellaneousChargesInInvoice(invoiceId, manageMiscellaneousChargesRequest) + +Add or update miscellaneous charges in Invoice + +Add or update miscellaneous charges in Invoice + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.InvoicesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + InvoicesApi apiInstance = new InvoicesApi(defaultClient); + String invoiceId = "invoiceId_example"; // String | + ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest = new ManageMiscellaneousChargesRequest(); // ManageMiscellaneousChargesRequest | Payload to update custom line items + try { + MiscellaneousChargesResponse result = apiInstance.manageMiscellaneousChargesInInvoice(invoiceId, manageMiscellaneousChargesRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InvoicesApi#manageMiscellaneousChargesInInvoice"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **invoiceId** | **String**| | | +| **manageMiscellaneousChargesRequest** | [**ManageMiscellaneousChargesRequest**](ManageMiscellaneousChargesRequest.md)| Payload to update custom line items | [optional] | + +### Return type + +[**MiscellaneousChargesResponse**](MiscellaneousChargesResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response for Miscellaneous Charges Request | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + diff --git a/docs/ManageMiscellaneousChargesRequest.md b/docs/ManageMiscellaneousChargesRequest.md new file mode 100644 index 0000000..7307bc2 --- /dev/null +++ b/docs/ManageMiscellaneousChargesRequest.md @@ -0,0 +1,18 @@ + + +# ManageMiscellaneousChargesRequest + +Payload to update custom line items + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**items** | [**List<MiscellaneousCharge>**](MiscellaneousCharge.md) | | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/MetricName.md b/docs/MetricName.md index 1d5565d..2bd424e 100644 --- a/docs/MetricName.md +++ b/docs/MetricName.md @@ -11,5 +11,9 @@ * `REVENUE` (value: `"REVENUE"`) +* `USAGE_FOR_CYCLE` (value: `"USAGE_FOR_CYCLE"`) + +* `REVENUE_FOR_CYCLE` (value: `"REVENUE_FOR_CYCLE"`) + diff --git a/docs/MetricQuery.md b/docs/MetricQuery.md index bc5f7f6..e165d6d 100644 --- a/docs/MetricQuery.md +++ b/docs/MetricQuery.md @@ -12,7 +12,7 @@ Object representing a single metrics query |**name** | **MetricName** | | | |**aggregationPeriod** | [**AggregationPeriodEnum**](#AggregationPeriodEnum) | Set the aggregation period. Allowed periods are DAY, WEEK, MONTH | | |**groupBy** | **String** | Group your metric with a groupBy field. Allowed fields are ACCOUNT_ID EVENT_STATUS SCHEMA_NAME USAGE_METER_ID Please refer the table above for the list of combinations allowed in the groupBy | [optional] | -|**configs** | **Map<String, String>** | Configurations. | Metric Name | Config Key | Allowed Values | Default value | Description | |-------------|------------|-----------------|---------------|-----------------------------------| | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | | [optional] | +|**configs** | **Map<String, String>** | Configurations. | Metric Name | Config Key | Allowed Values | Default value | Description | |-------------------|------------|-----------------|---------------|-----------------------------------| | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | | REVENUE_FOR_CYCLE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | | [optional] | |**filters** | [**List<MetricQueryFilterEntry>**](MetricQueryFilterEntry.md) | Filter on specific fields. Refer possible fieldNames and fieldValues from the table above. | [optional] | diff --git a/docs/MetricQueryFilterEntry.md b/docs/MetricQueryFilterEntry.md index e97516d..01f6713 100644 --- a/docs/MetricQueryFilterEntry.md +++ b/docs/MetricQueryFilterEntry.md @@ -2,7 +2,7 @@ # MetricQueryFilterEntry - | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | |-------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | CUSTOMER_ID | | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | CUSTOMER_ID | | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | CUSTOMER_ID | | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | CUSTOMER_ID | | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | + | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | |-------------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\ | | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | | | | USAGE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | USAGE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | | REVENUE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\ | ## Properties diff --git a/docs/MetricsApi.md b/docs/MetricsApi.md index 81be542..ce60d4c 100644 --- a/docs/MetricsApi.md +++ b/docs/MetricsApi.md @@ -13,7 +13,7 @@ All URIs are relative to *https://api.togai.com* Get Togai Metrics -Togai Metrics API allows you to fetch different metrics from Events , Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. +Togai Metrics API allows you to fetch different metrics from Events, Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. ### Example ```java diff --git a/docs/MiscellaneousCharge.md b/docs/MiscellaneousCharge.md new file mode 100644 index 0000000..4f1c920 --- /dev/null +++ b/docs/MiscellaneousCharge.md @@ -0,0 +1,19 @@ + + +# MiscellaneousCharge + +Miscellaneous charges are the charges that can be added to the invoice + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Name of the miscellaneous charge | | +|**value** | **String** | Value of the charge | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/MiscellaneousChargesResponse.md b/docs/MiscellaneousChargesResponse.md new file mode 100644 index 0000000..c45f5cf --- /dev/null +++ b/docs/MiscellaneousChargesResponse.md @@ -0,0 +1,18 @@ + + +# MiscellaneousChargesResponse + +Miscellaneous charges response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<MiscellaneousCharge>**](MiscellaneousCharge.md) | | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/PlanOverride.md b/docs/PlanOverride.md index b13a4ee..2694b6d 100644 --- a/docs/PlanOverride.md +++ b/docs/PlanOverride.md @@ -8,6 +8,7 @@ Represents effectiveness period and config of a price plan. i.e, price plan boun | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | |**pricePlanId** | **String** | | | |**pricePlanName** | **String** | | | |**pricePlanDetailsOverride** | [**PricePlanDetailsOverride**](PricePlanDetailsOverride.md) | | [optional] | diff --git a/docs/PriceExperimentationApi.md b/docs/PriceExperimentationApi.md new file mode 100644 index 0000000..0a8ff1f --- /dev/null +++ b/docs/PriceExperimentationApi.md @@ -0,0 +1,82 @@ +# PriceExperimentationApi + +All URIs are relative to *https://api.togai.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**calculateRevenue**](PriceExperimentationApi.md#calculateRevenue) | **POST** /revenue_calculator | Calculate and return the revenue for a existing or new price plan | + + + +# **calculateRevenue** +> CalculateRevenueResponse calculateRevenue(calculateRevenueRequest) + +Calculate and return the revenue for a existing or new price plan + +Calculate and return the revenue for a existing or new price plan + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.PriceExperimentationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + PriceExperimentationApi apiInstance = new PriceExperimentationApi(defaultClient); + CalculateRevenueRequest calculateRevenueRequest = new CalculateRevenueRequest(); // CalculateRevenueRequest | Request payload for calculateRevenueAPI + try { + CalculateRevenueResponse result = apiInstance.calculateRevenue(calculateRevenueRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PriceExperimentationApi#calculateRevenue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **calculateRevenueRequest** | [**CalculateRevenueRequest**](CalculateRevenueRequest.md)| Request payload for calculateRevenueAPI | | + +### Return type + +[**CalculateRevenueResponse**](CalculateRevenueResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Response payload for calculateRevenueAPI | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + diff --git a/docs/PricePlanDetailsConfig.md b/docs/PricePlanDetailsConfig.md index bf597c0..a747fcb 100644 --- a/docs/PricePlanDetailsConfig.md +++ b/docs/PricePlanDetailsConfig.md @@ -13,6 +13,7 @@ Configuration for getting the usage rate card |**pricePlanId** | **String** | Id of the price plan, this will be considered if mode is PRICE_PLAN | [optional] | |**accountId** | **String** | Id of the account, this will be considered if mode is ACCOUNT | [optional] | |**effectiveOn** | **OffsetDateTime** | Will be used for getting the usage rate card, only used if mode is ACCOUNT or PRICE_PLAN | [optional] | +|**pricingCycleOrdinal** | **Integer** | nth cycle, will be used to calculate revenue for the particular cycle, only used if mode is CUSTOM or PRICE_PLAN | [optional] | diff --git a/docs/PricePlanListData.md b/docs/PricePlanListData.md index ab99df5..e85197a 100644 --- a/docs/PricePlanListData.md +++ b/docs/PricePlanListData.md @@ -10,6 +10,7 @@ Data of price plan list |------------ | ------------- | ------------- | -------------| |**id** | **String** | Identifier of price plan | | |**name** | **String** | Name of the price plan | | +|**version** | **Integer** | Version of the price plan | | |**description** | **String** | Description of price plan | [optional] | |**status** | [**StatusEnum**](#StatusEnum) | Status of Price plan | | |**usageMeters** | **List<String>** | Usage meters id linked to the price plan | | diff --git a/docs/PricePlansApi.md b/docs/PricePlansApi.md index 46be259..ffdfec5 100644 --- a/docs/PricePlansApi.md +++ b/docs/PricePlansApi.md @@ -238,7 +238,7 @@ public class Example { # **getPricePlan** -> PricePlan getPricePlan(pricePlanId) +> PricePlan getPricePlan(pricePlanId, version) Get a price plan @@ -265,8 +265,9 @@ public class Example { PricePlansApi apiInstance = new PricePlansApi(defaultClient); String pricePlanId = "pricePlanId_example"; // String | + Integer version = 56; // Integer | Optional version to get a specific version. Gets latest version if it is not provided. try { - PricePlan result = apiInstance.getPricePlan(pricePlanId); + PricePlan result = apiInstance.getPricePlan(pricePlanId, version); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PricePlansApi#getPricePlan"); @@ -284,6 +285,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **pricePlanId** | **String**| | | +| **version** | **Integer**| Optional version to get a specific version. Gets latest version if it is not provided. | [optional] | ### Return type diff --git a/docs/PricingSchedule.md b/docs/PricingSchedule.md index 1c23311..864f045 100644 --- a/docs/PricingSchedule.md +++ b/docs/PricingSchedule.md @@ -8,9 +8,11 @@ Represents effectiveness period and config of a price plan. i.e, price plan boun | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | |**pricePlanDetails** | [**PricePlanDetails**](PricePlanDetails.md) | | [optional] | |**startDate** | **OffsetDateTime** | | | |**endDate** | **OffsetDateTime** | | | +|**version** | **Integer** | | | ## Implemented Interfaces diff --git a/docs/PricingSchedulePaginatedResponse.md b/docs/PricingSchedulePaginatedResponse.md new file mode 100644 index 0000000..b0654f2 --- /dev/null +++ b/docs/PricingSchedulePaginatedResponse.md @@ -0,0 +1,19 @@ + + +# PricingSchedulePaginatedResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<PricingScheduleWithPricePlanId>**](PricingScheduleWithPricePlanId.md) | | [optional] | +|**nextToken** | **String** | | [optional] | +|**previousToken** | **String** | | [optional] | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/PricingScheduleWithPricePlanId.md b/docs/PricingScheduleWithPricePlanId.md new file mode 100644 index 0000000..af15372 --- /dev/null +++ b/docs/PricingScheduleWithPricePlanId.md @@ -0,0 +1,22 @@ + + +# PricingScheduleWithPricePlanId + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | | +|**pricePlanDetails** | [**PricePlanDetails**](PricePlanDetails.md) | | [optional] | +|**startDate** | **OffsetDateTime** | | | +|**endDate** | **OffsetDateTime** | | | +|**version** | **Integer** | | | +|**pricePlanId** | **String** | | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/PricingScheduleWithPricePlanIdAllOf.md b/docs/PricingScheduleWithPricePlanIdAllOf.md new file mode 100644 index 0000000..c2a1ef2 --- /dev/null +++ b/docs/PricingScheduleWithPricePlanIdAllOf.md @@ -0,0 +1,17 @@ + + +# PricingScheduleWithPricePlanIdAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**pricePlanId** | **String** | | | + + +## Implemented Interfaces + +* Serializable + + diff --git a/docs/UpdatePricePlanRequest.md b/docs/UpdatePricePlanRequest.md index 072d2b5..e7b87ab 100644 --- a/docs/UpdatePricePlanRequest.md +++ b/docs/UpdatePricePlanRequest.md @@ -10,6 +10,29 @@ Request to update a price plan |------------ | ------------- | ------------- | -------------| |**description** | **String** | Description of price plan | [optional] | |**pricePlanDetails** | [**CreatePricePlanDetailsOverride**](CreatePricePlanDetailsOverride.md) | | [optional] | +|**migrationMode** | [**MigrationModeEnum**](#MigrationModeEnum) | | [optional] | +|**versionsToMigrate** | [**VersionsToMigrateEnum**](#VersionsToMigrateEnum) | | [optional] | + + + +## Enum: MigrationModeEnum + +| Name | Value | +|---- | -----| +| IMMEDIATE | "IMMEDIATE" | +| IMMEDIATE_IGNORE_OVERRIDE | "IMMEDIATE_IGNORE_OVERRIDE" | +| NEXT_CYCLE | "NEXT_CYCLE" | +| NEXT_CYCLE_IGNORE_OVERRIDE | "NEXT_CYCLE_IGNORE_OVERRIDE" | +| NONE | "NONE" | + + + +## Enum: VersionsToMigrateEnum + +| Name | Value | +|---- | -----| +| LATEST_VERSION | "LATEST_VERSION" | +| ALL_VERSION | "ALL_VERSION" | ## Implemented Interfaces diff --git a/docs/UsageMetersApi.md b/docs/UsageMetersApi.md index 04f46c4..1020761 100644 --- a/docs/UsageMetersApi.md +++ b/docs/UsageMetersApi.md @@ -4,17 +4,18 @@ All URIs are relative to *https://api.togai.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**activateUsageMeter**](UsageMetersApi.md#activateUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/activate | Activate usage meter | -| [**createUsageMeter**](UsageMetersApi.md#createUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters | Create an usage meter | -| [**deactivateUsageMeter**](UsageMetersApi.md#deactivateUsageMeter) | **POST** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/deactivate | Deactivate usage meter | -| [**getUsageMeter**](UsageMetersApi.md#getUsageMeter) | **GET** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id} | Get usage meter | -| [**getUsageMetersForEventSchema**](UsageMetersApi.md#getUsageMetersForEventSchema) | **GET** /event_schema/{event_schema_name}/usage_meters | List usage meters for event schema | -| [**updateUsageMeter**](UsageMetersApi.md#updateUsageMeter) | **PATCH** /event_schema/{event_schema_name}/usage_meters/{usage_meter_id} | Update an usage meter | +| [**activateUsageMeter**](UsageMetersApi.md#activateUsageMeter) | **POST** /usage_meters/{usage_meter_id}/activate | Activate usage meter | +| [**createUsageMeter**](UsageMetersApi.md#createUsageMeter) | **POST** /usage_meters | Create an usage meter | +| [**deactivateUsageMeter**](UsageMetersApi.md#deactivateUsageMeter) | **POST** /usage_meters/{usage_meter_id}/deactivate | Deactivate usage meter | +| [**deleteUsageMeter**](UsageMetersApi.md#deleteUsageMeter) | **DELETE** /usage_meters/{usage_meter_id} | Delete an Usage Meter | +| [**getUsageMeter**](UsageMetersApi.md#getUsageMeter) | **GET** /usage_meters/{usage_meter_id} | Get usage meter | +| [**getUsageMetersForEventSchema**](UsageMetersApi.md#getUsageMetersForEventSchema) | **GET** /usage_meters | List usage meters for event schema | +| [**updateUsageMeter**](UsageMetersApi.md#updateUsageMeter) | **PATCH** /usage_meters/{usage_meter_id} | Update an usage meter | # **activateUsageMeter** -> UsageMeter activateUsageMeter(eventSchemaName, usageMeterId) +> UsageMeter activateUsageMeter(usageMeterId) Activate usage meter @@ -40,10 +41,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | String usageMeterId = "usageMeterId_example"; // String | try { - UsageMeter result = apiInstance.activateUsageMeter(eventSchemaName, usageMeterId); + UsageMeter result = apiInstance.activateUsageMeter(usageMeterId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#activateUsageMeter"); @@ -60,7 +60,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **usageMeterId** | **String**| | | ### Return type @@ -89,7 +88,7 @@ public class Example { # **createUsageMeter** -> UsageMeter createUsageMeter(eventSchemaName, createUsageMeterRequest) +> UsageMeter createUsageMeter(createUsageMeterRequest) Create an usage meter @@ -115,10 +114,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | CreateUsageMeterRequest createUsageMeterRequest = new CreateUsageMeterRequest(); // CreateUsageMeterRequest | Payload to create usage meter try { - UsageMeter result = apiInstance.createUsageMeter(eventSchemaName, createUsageMeterRequest); + UsageMeter result = apiInstance.createUsageMeter(createUsageMeterRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#createUsageMeter"); @@ -135,7 +133,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **createUsageMeterRequest** | [**CreateUsageMeterRequest**](CreateUsageMeterRequest.md)| Payload to create usage meter | | ### Return type @@ -164,7 +161,7 @@ public class Example { # **deactivateUsageMeter** -> UsageMeter deactivateUsageMeter(eventSchemaName, usageMeterId) +> UsageMeter deactivateUsageMeter(usageMeterId) Deactivate usage meter @@ -190,10 +187,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | String usageMeterId = "usageMeterId_example"; // String | try { - UsageMeter result = apiInstance.deactivateUsageMeter(eventSchemaName, usageMeterId); + UsageMeter result = apiInstance.deactivateUsageMeter(usageMeterId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#deactivateUsageMeter"); @@ -210,7 +206,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **usageMeterId** | **String**| | | ### Return type @@ -237,9 +232,82 @@ public class Example { | **429** | Error response | - | | **0** | Error response | - | + +# **deleteUsageMeter** +> BaseSuccessResponse deleteUsageMeter(usageMeterId) + +Delete an Usage Meter + +Delete an Usage Meter + +### Example +```java +// Import classes: +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.Configuration; +import com.togai.client.auth.*; +import com.togai.client.models.*; +import com.togai.client.api.UsageMetersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.togai.com"); + + // Configure HTTP bearer authorization: bearerAuth + HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); + bearerAuth.setBearerToken("BEARER TOKEN"); + + UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); + String usageMeterId = "usageMeterId_example"; // String | + try { + BaseSuccessResponse result = apiInstance.deleteUsageMeter(usageMeterId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsageMetersApi#deleteUsageMeter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **usageMeterId** | **String**| | | + +### Return type + +[**BaseSuccessResponse**](BaseSuccessResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Error response | - | +| **401** | Error response | - | +| **403** | Error response | - | +| **404** | Error response | - | +| **429** | Error response | - | +| **0** | Error response | - | + # **getUsageMeter** -> UsageMeter getUsageMeter(eventSchemaName, usageMeterId) +> UsageMeter getUsageMeter(usageMeterId) Get usage meter @@ -265,10 +333,9 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | String usageMeterId = "usageMeterId_example"; // String | try { - UsageMeter result = apiInstance.getUsageMeter(eventSchemaName, usageMeterId); + UsageMeter result = apiInstance.getUsageMeter(usageMeterId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#getUsageMeter"); @@ -285,7 +352,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **usageMeterId** | **String**| | | ### Return type @@ -314,7 +380,7 @@ public class Example { # **getUsageMetersForEventSchema** -> UsageMeterPaginatedResponse getUsageMetersForEventSchema(eventSchemaName, status, aggregations, nextToken, pageSize) +> UsageMeterPaginatedResponse getUsageMetersForEventSchema(status, aggregations, nextToken, pageSize) List usage meters for event schema @@ -340,13 +406,12 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | String status = "ACTIVE"; // String | Filter by status String aggregations = "COUNT"; // String | Filter by aggregations String nextToken = "eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="; // String | BigDecimal pageSize = new BigDecimal("10"); // BigDecimal | try { - UsageMeterPaginatedResponse result = apiInstance.getUsageMetersForEventSchema(eventSchemaName, status, aggregations, nextToken, pageSize); + UsageMeterPaginatedResponse result = apiInstance.getUsageMetersForEventSchema(status, aggregations, nextToken, pageSize); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#getUsageMetersForEventSchema"); @@ -363,7 +428,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **status** | **String**| Filter by status | [optional] [enum: ACTIVE, INACTIVE] | | **aggregations** | **String**| Filter by aggregations | [optional] [enum: COUNT, SUM] | | **nextToken** | **String**| | [optional] | @@ -395,7 +459,7 @@ public class Example { # **updateUsageMeter** -> UsageMeter updateUsageMeter(eventSchemaName, usageMeterId, updateUsageMeterRequest) +> UsageMeter updateUsageMeter(usageMeterId, updateUsageMeterRequest) Update an usage meter @@ -421,11 +485,10 @@ public class Example { bearerAuth.setBearerToken("BEARER TOKEN"); UsageMetersApi apiInstance = new UsageMetersApi(defaultClient); - String eventSchemaName = "eventSchemaName_example"; // String | String usageMeterId = "usageMeterId_example"; // String | UpdateUsageMeterRequest updateUsageMeterRequest = new UpdateUsageMeterRequest(); // UpdateUsageMeterRequest | Payload to create usage meter try { - UsageMeter result = apiInstance.updateUsageMeter(eventSchemaName, usageMeterId, updateUsageMeterRequest); + UsageMeter result = apiInstance.updateUsageMeter(usageMeterId, updateUsageMeterRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsageMetersApi#updateUsageMeter"); @@ -442,7 +505,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventSchemaName** | **String**| | | | **usageMeterId** | **String**| | | | **updateUsageMeterRequest** | [**UpdateUsageMeterRequest**](UpdateUsageMeterRequest.md)| Payload to create usage meter | | diff --git a/examples/Example.java b/examples/Example.java index 596292d..19d031f 100644 --- a/examples/Example.java +++ b/examples/Example.java @@ -47,6 +47,7 @@ public static void main(String[] args){ final UsageMetersApi usageMetersApi = new UsageMetersApi(apiClient); final CreateUsageMeterRequest createUsageMeterRequest = new CreateUsageMeterRequest() .name("message_count"+seed) + .eventSchemaName(eventSchema.getName()) .type(CreateUsageMeterRequest.TypeEnum.COUNTER) .aggregation(CreateUsageMeterRequest.AggregationEnum.COUNT) .computations(Arrays.asList( @@ -55,11 +56,11 @@ public static void main(String[] args){ .computation("1") )); System.out.println(eventSchema.getName()); - final UsageMeter usageMeter = usageMetersApi.createUsageMeter(eventSchema.getName(), createUsageMeterRequest); + final UsageMeter usageMeter = usageMetersApi.createUsageMeter(createUsageMeterRequest); System.out.println(usageMeter); // Step 4: Activate a usage meter - usageMetersApi.activateUsageMeter(eventSchema.getName(), usageMeter.getId()); + usageMetersApi.activateUsageMeter(usageMeter.getId()); // Step 5: Create a Price plan to convert the usage into a billable price final PricePlansApi pricePlansApi = new PricePlansApi(apiClient); @@ -120,9 +121,11 @@ public static void main(String[] args){ // Step 8: Associate the customer/account to the price plan final AccountsApi accountsApi = new AccountsApi(apiClient); final UpdatePricingScheduleRequest updatePricingScheduleRequest = new UpdatePricingScheduleRequest() - .pricePlanId(pricePlan.getId()) - .effectiveFrom(LocalDate.now()).effectiveUntil(LocalDate.parse("9999-01-01")); - final UpdatePricingScheduleResponse account = accountsApi.updatePricingSchedule(customer.getId(), customer.getAccount().getId(), updatePricingScheduleRequest); + .pricePlanId(pricePlan.getId()) + .mode(UpdatePricingScheduleRequest.ModeEnum.ASSOCIATE) + .effectiveFrom(LocalDate.now()) + .effectiveUntil(LocalDate.parse("9999-01-01")); + final UpdatePricingScheduleResponse account = accountsApi.updatePricingSchedule(customer.getAccount().getId(), updatePricingScheduleRequest); System.out.println(account); // Step 9: Ingest events diff --git a/src/main/java/com/togai/client/JSON.java b/src/main/java/com/togai/client/JSON.java index 565b7a7..d512f45 100644 --- a/src/main/java/com/togai/client/JSON.java +++ b/src/main/java/com/togai/client/JSON.java @@ -110,6 +110,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.ComputeRevenueSummaryRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.ComputeRevenueSummaryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CreateAccountRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CreateAccountRequestWithoutCustomerId.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CreateAddOnRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CreateCreditRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CreateCustomerRequest.CustomTypeAdapterFactory()); @@ -132,6 +133,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.CustomerPaginatedResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.Dependency.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.DimensionsSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EditPricingScheduleRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EnrichedField.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EnrichmentDependency.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.Enrichments.CustomTypeAdapterFactory()); @@ -150,6 +152,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventSchemaListDataAllOf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventSchemaListPaginatedResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventSchemaVersionsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventSource.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventWithStatus.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventWithStatusAndEventPipelineInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.EventWithStatusAndEventPipelineInfoAllOf.CustomTypeAdapterFactory()); @@ -161,8 +164,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.GetMetricsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.GetMetricsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestBatchEventRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestBatchEventResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestEventRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestEventResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.IngestionStatus.CustomTypeAdapterFactory()); @@ -177,12 +178,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.InvoiceLineItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.ListCreditsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.ListInvoicesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.ManageMiscellaneousChargesRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MetricDataPoints.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MetricDataPointsGroupedBy.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MetricQuery.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MetricQueryFilterEntry.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MetricQueryResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MinimumCommitment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MiscellaneousCharge.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.MiscellaneousChargesResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.OrganizationSetting.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PaginationOptions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PlanOverride.CustomTypeAdapterFactory()); @@ -196,6 +200,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingCycleConfig.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingCycleConfigStartOffset.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingSchedulePaginatedResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingScheduleWithPricePlanId.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.PricingScheduleWithPricePlanIdAllOf.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.RatePlan.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.RateValue.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.togai.client.models.RemoveAccountAliasesRequest.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/togai/client/api/AccountsApi.java b/src/main/java/com/togai/client/api/AccountsApi.java index 4175a9f..4a3aa47 100644 --- a/src/main/java/com/togai/client/api/AccountsApi.java +++ b/src/main/java/com/togai/client/api/AccountsApi.java @@ -33,7 +33,9 @@ import com.togai.client.models.BaseSuccessResponse; import java.math.BigDecimal; import com.togai.client.models.CreateAccountRequest; +import com.togai.client.models.EditPricingScheduleRequest; import com.togai.client.models.ErrorResponse; +import com.togai.client.models.PricingSchedulePaginatedResponse; import com.togai.client.models.RemoveAccountAliasesRequest; import com.togai.client.models.UpdateAccountRequest; import com.togai.client.models.UpdatePricingScheduleRequest; @@ -85,7 +87,6 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for addAliases - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param addAccountAliasesRequest Payload to add aliases to account (required) * @param _callback Callback for upload/download progress @@ -103,7 +104,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 0 Error response - */ - public okhttp3.Call addAliasesCall(String customerId, String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAliasesCall(String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -120,8 +121,7 @@ public okhttp3.Call addAliasesCall(String customerId, String accountId, AddAccou Object localVarPostBody = addAccountAliasesRequest; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}/add_aliases" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}/add_aliases" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -151,12 +151,7 @@ public okhttp3.Call addAliasesCall(String customerId, String accountId, AddAccou } @SuppressWarnings("rawtypes") - private okhttp3.Call addAliasesValidateBeforeCall(String customerId, String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling addAliases(Async)"); - } - + private okhttp3.Call addAliasesValidateBeforeCall(String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling addAliases(Async)"); @@ -167,14 +162,13 @@ private okhttp3.Call addAliasesValidateBeforeCall(String customerId, String acco throw new ApiException("Missing the required parameter 'addAccountAliasesRequest' when calling addAliases(Async)"); } - return addAliasesCall(customerId, accountId, addAccountAliasesRequest, _callback); + return addAliasesCall(accountId, addAccountAliasesRequest, _callback); } /** * Add Aliases to account * Add aliases to an account using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param addAccountAliasesRequest Payload to add aliases to account (required) * @return Account @@ -191,15 +185,14 @@ private okhttp3.Call addAliasesValidateBeforeCall(String customerId, String acco 0 Error response - */ - public Account addAliases(String customerId, String accountId, AddAccountAliasesRequest addAccountAliasesRequest) throws ApiException { - ApiResponse localVarResp = addAliasesWithHttpInfo(customerId, accountId, addAccountAliasesRequest); + public Account addAliases(String accountId, AddAccountAliasesRequest addAccountAliasesRequest) throws ApiException { + ApiResponse localVarResp = addAliasesWithHttpInfo(accountId, addAccountAliasesRequest); return localVarResp.getData(); } /** * Add Aliases to account * Add aliases to an account using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param addAccountAliasesRequest Payload to add aliases to account (required) * @return ApiResponse<Account> @@ -216,8 +209,8 @@ public Account addAliases(String customerId, String accountId, AddAccountAliases 0 Error response - */ - public ApiResponse addAliasesWithHttpInfo(String customerId, String accountId, AddAccountAliasesRequest addAccountAliasesRequest) throws ApiException { - okhttp3.Call localVarCall = addAliasesValidateBeforeCall(customerId, accountId, addAccountAliasesRequest, null); + public ApiResponse addAliasesWithHttpInfo(String accountId, AddAccountAliasesRequest addAccountAliasesRequest) throws ApiException { + okhttp3.Call localVarCall = addAliasesValidateBeforeCall(accountId, addAccountAliasesRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -225,7 +218,6 @@ public ApiResponse addAliasesWithHttpInfo(String customerId, String acc /** * Add Aliases to account (asynchronously) * Add aliases to an account using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param addAccountAliasesRequest Payload to add aliases to account (required) * @param _callback The callback to be executed when the API call finishes @@ -243,16 +235,15 @@ public ApiResponse addAliasesWithHttpInfo(String customerId, String acc 0 Error response - */ - public okhttp3.Call addAliasesAsync(String customerId, String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAliasesAsync(String accountId, AddAccountAliasesRequest addAccountAliasesRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = addAliasesValidateBeforeCall(customerId, accountId, addAccountAliasesRequest, _callback); + okhttp3.Call localVarCall = addAliasesValidateBeforeCall(accountId, addAccountAliasesRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createAccount - * @param customerId (required) * @param createAccountRequest Payload to create account (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -269,7 +260,7 @@ public okhttp3.Call addAliasesAsync(String customerId, String accountId, AddAcco 0 Error response - */ - public okhttp3.Call createAccountCall(String customerId, CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAccountCall(CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -286,8 +277,7 @@ public okhttp3.Call createAccountCall(String customerId, CreateAccountRequest cr Object localVarPostBody = createAccountRequest; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())); + String localVarPath = "/accounts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -316,25 +306,19 @@ public okhttp3.Call createAccountCall(String customerId, CreateAccountRequest cr } @SuppressWarnings("rawtypes") - private okhttp3.Call createAccountValidateBeforeCall(String customerId, CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling createAccount(Async)"); - } - + private okhttp3.Call createAccountValidateBeforeCall(CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'createAccountRequest' is set if (createAccountRequest == null) { throw new ApiException("Missing the required parameter 'createAccountRequest' when calling createAccount(Async)"); } - return createAccountCall(customerId, createAccountRequest, _callback); + return createAccountCall(createAccountRequest, _callback); } /** * Create an account * This API let’s you to create an account for a customer using customer_id. - * @param customerId (required) * @param createAccountRequest Payload to create account (required) * @return Account * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -350,15 +334,14 @@ private okhttp3.Call createAccountValidateBeforeCall(String customerId, CreateAc 0 Error response - */ - public Account createAccount(String customerId, CreateAccountRequest createAccountRequest) throws ApiException { - ApiResponse localVarResp = createAccountWithHttpInfo(customerId, createAccountRequest); + public Account createAccount(CreateAccountRequest createAccountRequest) throws ApiException { + ApiResponse localVarResp = createAccountWithHttpInfo(createAccountRequest); return localVarResp.getData(); } /** * Create an account * This API let’s you to create an account for a customer using customer_id. - * @param customerId (required) * @param createAccountRequest Payload to create account (required) * @return ApiResponse<Account> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -374,8 +357,8 @@ public Account createAccount(String customerId, CreateAccountRequest createAccou 0 Error response - */ - public ApiResponse createAccountWithHttpInfo(String customerId, CreateAccountRequest createAccountRequest) throws ApiException { - okhttp3.Call localVarCall = createAccountValidateBeforeCall(customerId, createAccountRequest, null); + public ApiResponse createAccountWithHttpInfo(CreateAccountRequest createAccountRequest) throws ApiException { + okhttp3.Call localVarCall = createAccountValidateBeforeCall(createAccountRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -383,7 +366,6 @@ public ApiResponse createAccountWithHttpInfo(String customerId, CreateA /** * Create an account (asynchronously) * This API let’s you to create an account for a customer using customer_id. - * @param customerId (required) * @param createAccountRequest Payload to create account (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -400,16 +382,15 @@ public ApiResponse createAccountWithHttpInfo(String customerId, CreateA 0 Error response - */ - public okhttp3.Call createAccountAsync(String customerId, CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAccountAsync(CreateAccountRequest createAccountRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createAccountValidateBeforeCall(customerId, createAccountRequest, _callback); + okhttp3.Call localVarCall = createAccountValidateBeforeCall(createAccountRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteAccount - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -426,7 +407,7 @@ public okhttp3.Call createAccountAsync(String customerId, CreateAccountRequest c 0 Error response - */ - public okhttp3.Call deleteAccountCall(String customerId, String accountId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAccountCall(String accountId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -443,8 +424,7 @@ public okhttp3.Call deleteAccountCall(String customerId, String accountId, final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -473,25 +453,19 @@ public okhttp3.Call deleteAccountCall(String customerId, String accountId, final } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAccountValidateBeforeCall(String customerId, String accountId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling deleteAccount(Async)"); - } - + private okhttp3.Call deleteAccountValidateBeforeCall(String accountId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling deleteAccount(Async)"); } - return deleteAccountCall(customerId, accountId, _callback); + return deleteAccountCall(accountId, _callback); } /** * Delete an account * This API let’s you to delete a customer using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @return BaseSuccessResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -507,15 +481,14 @@ private okhttp3.Call deleteAccountValidateBeforeCall(String customerId, String a 0 Error response - */ - public BaseSuccessResponse deleteAccount(String customerId, String accountId) throws ApiException { - ApiResponse localVarResp = deleteAccountWithHttpInfo(customerId, accountId); + public BaseSuccessResponse deleteAccount(String accountId) throws ApiException { + ApiResponse localVarResp = deleteAccountWithHttpInfo(accountId); return localVarResp.getData(); } /** * Delete an account * This API let’s you to delete a customer using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @return ApiResponse<BaseSuccessResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -531,8 +504,8 @@ public BaseSuccessResponse deleteAccount(String customerId, String accountId) th 0 Error response - */ - public ApiResponse deleteAccountWithHttpInfo(String customerId, String accountId) throws ApiException { - okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(customerId, accountId, null); + public ApiResponse deleteAccountWithHttpInfo(String accountId) throws ApiException { + okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -540,7 +513,6 @@ public ApiResponse deleteAccountWithHttpInfo(String custome /** * Delete an account (asynchronously) * This API let’s you to delete a customer using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -557,16 +529,15 @@ public ApiResponse deleteAccountWithHttpInfo(String custome 0 Error response - */ - public okhttp3.Call deleteAccountAsync(String customerId, String accountId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAccountAsync(String accountId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(customerId, accountId, _callback); + okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(accountId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAccount - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -583,7 +554,7 @@ public okhttp3.Call deleteAccountAsync(String customerId, String accountId, fina 0 Error response - */ - public okhttp3.Call getAccountCall(String customerId, String accountId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAccountCall(String accountId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -600,8 +571,7 @@ public okhttp3.Call getAccountCall(String customerId, String accountId, final Ap Object localVarPostBody = null; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -630,25 +600,19 @@ public okhttp3.Call getAccountCall(String customerId, String accountId, final Ap } @SuppressWarnings("rawtypes") - private okhttp3.Call getAccountValidateBeforeCall(String customerId, String accountId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling getAccount(Async)"); - } - + private okhttp3.Call getAccountValidateBeforeCall(String accountId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling getAccount(Async)"); } - return getAccountCall(customerId, accountId, _callback); + return getAccountCall(accountId, _callback); } /** * Get an account * Get account information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @return Account * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -664,15 +628,14 @@ private okhttp3.Call getAccountValidateBeforeCall(String customerId, String acco 0 Error response - */ - public Account getAccount(String customerId, String accountId) throws ApiException { - ApiResponse localVarResp = getAccountWithHttpInfo(customerId, accountId); + public Account getAccount(String accountId) throws ApiException { + ApiResponse localVarResp = getAccountWithHttpInfo(accountId); return localVarResp.getData(); } /** * Get an account * Get account information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @return ApiResponse<Account> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -688,8 +651,8 @@ public Account getAccount(String customerId, String accountId) throws ApiExcepti 0 Error response - */ - public ApiResponse getAccountWithHttpInfo(String customerId, String accountId) throws ApiException { - okhttp3.Call localVarCall = getAccountValidateBeforeCall(customerId, accountId, null); + public ApiResponse getAccountWithHttpInfo(String accountId) throws ApiException { + okhttp3.Call localVarCall = getAccountValidateBeforeCall(accountId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -697,7 +660,6 @@ public ApiResponse getAccountWithHttpInfo(String customerId, String acc /** * Get an account (asynchronously) * Get account information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -714,16 +676,15 @@ public ApiResponse getAccountWithHttpInfo(String customerId, String acc 0 Error response - */ - public okhttp3.Call getAccountAsync(String customerId, String accountId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAccountAsync(String accountId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAccountValidateBeforeCall(customerId, accountId, _callback); + okhttp3.Call localVarCall = getAccountValidateBeforeCall(accountId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAccounts - * @param customerId (required) * @param nextToken (optional) * @param pageSize (optional) * @param _callback Callback for upload/download progress @@ -741,7 +702,7 @@ public okhttp3.Call getAccountAsync(String customerId, String accountId, final A 0 Error response - */ - public okhttp3.Call getAccountsCall(String customerId, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAccountsCall(String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -758,8 +719,7 @@ public okhttp3.Call getAccountsCall(String customerId, String nextToken, BigDeci Object localVarPostBody = null; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())); + String localVarPath = "/accounts"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -795,20 +755,14 @@ public okhttp3.Call getAccountsCall(String customerId, String nextToken, BigDeci } @SuppressWarnings("rawtypes") - private okhttp3.Call getAccountsValidateBeforeCall(String customerId, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling getAccounts(Async)"); - } - - return getAccountsCall(customerId, nextToken, pageSize, _callback); + private okhttp3.Call getAccountsValidateBeforeCall(String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + return getAccountsCall(nextToken, pageSize, _callback); } /** * List accounts of customer * Returns a list of accounts of a customer with pagination and sort. - * @param customerId (required) * @param nextToken (optional) * @param pageSize (optional) * @return AccountPaginatedResponse @@ -825,15 +779,14 @@ private okhttp3.Call getAccountsValidateBeforeCall(String customerId, String nex 0 Error response - */ - public AccountPaginatedResponse getAccounts(String customerId, String nextToken, BigDecimal pageSize) throws ApiException { - ApiResponse localVarResp = getAccountsWithHttpInfo(customerId, nextToken, pageSize); + public AccountPaginatedResponse getAccounts(String nextToken, BigDecimal pageSize) throws ApiException { + ApiResponse localVarResp = getAccountsWithHttpInfo(nextToken, pageSize); return localVarResp.getData(); } /** * List accounts of customer * Returns a list of accounts of a customer with pagination and sort. - * @param customerId (required) * @param nextToken (optional) * @param pageSize (optional) * @return ApiResponse<AccountPaginatedResponse> @@ -850,8 +803,8 @@ public AccountPaginatedResponse getAccounts(String customerId, String nextToken, 0 Error response - */ - public ApiResponse getAccountsWithHttpInfo(String customerId, String nextToken, BigDecimal pageSize) throws ApiException { - okhttp3.Call localVarCall = getAccountsValidateBeforeCall(customerId, nextToken, pageSize, null); + public ApiResponse getAccountsWithHttpInfo(String nextToken, BigDecimal pageSize) throws ApiException { + okhttp3.Call localVarCall = getAccountsValidateBeforeCall(nextToken, pageSize, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -859,7 +812,6 @@ public ApiResponse getAccountsWithHttpInfo(String cust /** * List accounts of customer (asynchronously) * Returns a list of accounts of a customer with pagination and sort. - * @param customerId (required) * @param nextToken (optional) * @param pageSize (optional) * @param _callback The callback to be executed when the API call finishes @@ -877,16 +829,194 @@ public ApiResponse getAccountsWithHttpInfo(String cust 0 Error response - */ - public okhttp3.Call getAccountsAsync(String customerId, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAccountsAsync(String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAccountsValidateBeforeCall(customerId, nextToken, pageSize, _callback); + okhttp3.Call localVarCall = getAccountsValidateBeforeCall(nextToken, pageSize, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getPricingSchedules + * @param accountId account_id corresponding to an account (required) + * @param nextToken (optional) + * @param pageSize (optional) + * @param startDate (optional) + * @param endDate (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for list pricing schedules request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call getPricingSchedulesCall(String accountId, String nextToken, BigDecimal pageSize, String startDate, String endDate, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/accounts/{account_id}/pricing_schedules" + .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (nextToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("nextToken", nextToken)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); + } + + if (startDate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("start_date", startDate)); + } + + if (endDate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("end_date", endDate)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPricingSchedulesValidateBeforeCall(String accountId, String nextToken, BigDecimal pageSize, String startDate, String endDate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling getPricingSchedules(Async)"); + } + + return getPricingSchedulesCall(accountId, nextToken, pageSize, startDate, endDate, _callback); + + } + + /** + * List pricing schedules of an account + * Returns a list of pricing schedules of an account with pagination and sort. + * @param accountId account_id corresponding to an account (required) + * @param nextToken (optional) + * @param pageSize (optional) + * @param startDate (optional) + * @param endDate (optional) + * @return PricingSchedulePaginatedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for list pricing schedules request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public PricingSchedulePaginatedResponse getPricingSchedules(String accountId, String nextToken, BigDecimal pageSize, String startDate, String endDate) throws ApiException { + ApiResponse localVarResp = getPricingSchedulesWithHttpInfo(accountId, nextToken, pageSize, startDate, endDate); + return localVarResp.getData(); + } + + /** + * List pricing schedules of an account + * Returns a list of pricing schedules of an account with pagination and sort. + * @param accountId account_id corresponding to an account (required) + * @param nextToken (optional) + * @param pageSize (optional) + * @param startDate (optional) + * @param endDate (optional) + * @return ApiResponse<PricingSchedulePaginatedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for list pricing schedules request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse getPricingSchedulesWithHttpInfo(String accountId, String nextToken, BigDecimal pageSize, String startDate, String endDate) throws ApiException { + okhttp3.Call localVarCall = getPricingSchedulesValidateBeforeCall(accountId, nextToken, pageSize, startDate, endDate, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List pricing schedules of an account (asynchronously) + * Returns a list of pricing schedules of an account with pagination and sort. + * @param accountId account_id corresponding to an account (required) + * @param nextToken (optional) + * @param pageSize (optional) + * @param startDate (optional) + * @param endDate (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for list pricing schedules request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call getPricingSchedulesAsync(String accountId, String nextToken, BigDecimal pageSize, String startDate, String endDate, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPricingSchedulesValidateBeforeCall(accountId, nextToken, pageSize, startDate, endDate, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for removeAliases - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param removeAccountAliasesRequest Payload to remove aliases from account (required) * @param _callback Callback for upload/download progress @@ -904,7 +1034,7 @@ public okhttp3.Call getAccountsAsync(String customerId, String nextToken, BigDec 0 Error response - */ - public okhttp3.Call removeAliasesCall(String customerId, String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeAliasesCall(String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -921,8 +1051,7 @@ public okhttp3.Call removeAliasesCall(String customerId, String accountId, Remov Object localVarPostBody = removeAccountAliasesRequest; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}/remove_aliases" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}/remove_aliases" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -952,12 +1081,7 @@ public okhttp3.Call removeAliasesCall(String customerId, String accountId, Remov } @SuppressWarnings("rawtypes") - private okhttp3.Call removeAliasesValidateBeforeCall(String customerId, String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling removeAliases(Async)"); - } - + private okhttp3.Call removeAliasesValidateBeforeCall(String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling removeAliases(Async)"); @@ -968,14 +1092,13 @@ private okhttp3.Call removeAliasesValidateBeforeCall(String customerId, String a throw new ApiException("Missing the required parameter 'removeAccountAliasesRequest' when calling removeAliases(Async)"); } - return removeAliasesCall(customerId, accountId, removeAccountAliasesRequest, _callback); + return removeAliasesCall(accountId, removeAccountAliasesRequest, _callback); } /** * Remove Aliases to account * Remove existing aliases tagged to an account using this API - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param removeAccountAliasesRequest Payload to remove aliases from account (required) * @return Account @@ -992,15 +1115,14 @@ private okhttp3.Call removeAliasesValidateBeforeCall(String customerId, String a 0 Error response - */ - public Account removeAliases(String customerId, String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest) throws ApiException { - ApiResponse localVarResp = removeAliasesWithHttpInfo(customerId, accountId, removeAccountAliasesRequest); + public Account removeAliases(String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest) throws ApiException { + ApiResponse localVarResp = removeAliasesWithHttpInfo(accountId, removeAccountAliasesRequest); return localVarResp.getData(); } /** * Remove Aliases to account * Remove existing aliases tagged to an account using this API - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param removeAccountAliasesRequest Payload to remove aliases from account (required) * @return ApiResponse<Account> @@ -1017,8 +1139,8 @@ public Account removeAliases(String customerId, String accountId, RemoveAccountA 0 Error response - */ - public ApiResponse removeAliasesWithHttpInfo(String customerId, String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest) throws ApiException { - okhttp3.Call localVarCall = removeAliasesValidateBeforeCall(customerId, accountId, removeAccountAliasesRequest, null); + public ApiResponse removeAliasesWithHttpInfo(String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest) throws ApiException { + okhttp3.Call localVarCall = removeAliasesValidateBeforeCall(accountId, removeAccountAliasesRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1026,7 +1148,6 @@ public ApiResponse removeAliasesWithHttpInfo(String customerId, String /** * Remove Aliases to account (asynchronously) * Remove existing aliases tagged to an account using this API - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param removeAccountAliasesRequest Payload to remove aliases from account (required) * @param _callback The callback to be executed when the API call finishes @@ -1044,16 +1165,15 @@ public ApiResponse removeAliasesWithHttpInfo(String customerId, String 0 Error response - */ - public okhttp3.Call removeAliasesAsync(String customerId, String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call removeAliasesAsync(String accountId, RemoveAccountAliasesRequest removeAccountAliasesRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = removeAliasesValidateBeforeCall(customerId, accountId, removeAccountAliasesRequest, _callback); + okhttp3.Call localVarCall = removeAliasesValidateBeforeCall(accountId, removeAccountAliasesRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateAccount - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updateAccountRequest Payload to update account (required) * @param _callback Callback for upload/download progress @@ -1071,7 +1191,7 @@ public okhttp3.Call removeAliasesAsync(String customerId, String accountId, Remo 0 Error response - */ - public okhttp3.Call updateAccountCall(String customerId, String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAccountCall(String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1088,8 +1208,7 @@ public okhttp3.Call updateAccountCall(String customerId, String accountId, Updat Object localVarPostBody = updateAccountRequest; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -1119,12 +1238,7 @@ public okhttp3.Call updateAccountCall(String customerId, String accountId, Updat } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAccountValidateBeforeCall(String customerId, String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling updateAccount(Async)"); - } - + private okhttp3.Call updateAccountValidateBeforeCall(String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling updateAccount(Async)"); @@ -1135,14 +1249,13 @@ private okhttp3.Call updateAccountValidateBeforeCall(String customerId, String a throw new ApiException("Missing the required parameter 'updateAccountRequest' when calling updateAccount(Async)"); } - return updateAccountCall(customerId, accountId, updateAccountRequest, _callback); + return updateAccountCall(accountId, updateAccountRequest, _callback); } /** * Update an account * This API let’s you to update an account’s information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updateAccountRequest Payload to update account (required) * @return Account @@ -1159,15 +1272,14 @@ private okhttp3.Call updateAccountValidateBeforeCall(String customerId, String a 0 Error response - */ - public Account updateAccount(String customerId, String accountId, UpdateAccountRequest updateAccountRequest) throws ApiException { - ApiResponse localVarResp = updateAccountWithHttpInfo(customerId, accountId, updateAccountRequest); + public Account updateAccount(String accountId, UpdateAccountRequest updateAccountRequest) throws ApiException { + ApiResponse localVarResp = updateAccountWithHttpInfo(accountId, updateAccountRequest); return localVarResp.getData(); } /** * Update an account * This API let’s you to update an account’s information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updateAccountRequest Payload to update account (required) * @return ApiResponse<Account> @@ -1184,8 +1296,8 @@ public Account updateAccount(String customerId, String accountId, UpdateAccountR 0 Error response - */ - public ApiResponse updateAccountWithHttpInfo(String customerId, String accountId, UpdateAccountRequest updateAccountRequest) throws ApiException { - okhttp3.Call localVarCall = updateAccountValidateBeforeCall(customerId, accountId, updateAccountRequest, null); + public ApiResponse updateAccountWithHttpInfo(String accountId, UpdateAccountRequest updateAccountRequest) throws ApiException { + okhttp3.Call localVarCall = updateAccountValidateBeforeCall(accountId, updateAccountRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1193,7 +1305,6 @@ public ApiResponse updateAccountWithHttpInfo(String customerId, String /** * Update an account (asynchronously) * This API let’s you to update an account’s information using customer_id and account_id. - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updateAccountRequest Payload to update account (required) * @param _callback The callback to be executed when the API call finishes @@ -1211,16 +1322,15 @@ public ApiResponse updateAccountWithHttpInfo(String customerId, String 0 Error response - */ - public okhttp3.Call updateAccountAsync(String customerId, String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAccountAsync(String accountId, UpdateAccountRequest updateAccountRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAccountValidateBeforeCall(customerId, accountId, updateAccountRequest, _callback); + okhttp3.Call localVarCall = updateAccountValidateBeforeCall(accountId, updateAccountRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updatePricingSchedule - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updatePricingScheduleRequest Payload to dis/associate a price plan to an account (required) * @param _callback Callback for upload/download progress @@ -1238,7 +1348,7 @@ public okhttp3.Call updateAccountAsync(String customerId, String accountId, Upda 0 Error response - */ - public okhttp3.Call updatePricingScheduleCall(String customerId, String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePricingScheduleCall(String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -1255,8 +1365,7 @@ public okhttp3.Call updatePricingScheduleCall(String customerId, String accountI Object localVarPostBody = updatePricingScheduleRequest; // create path and map variables - String localVarPath = "/customers/{customer_id}/accounts/{account_id}/price_plans" - .replace("{" + "customer_id" + "}", localVarApiClient.escapeString(customerId.toString())) + String localVarPath = "/accounts/{account_id}/price_plans" .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); List localVarQueryParams = new ArrayList(); @@ -1286,12 +1395,7 @@ public okhttp3.Call updatePricingScheduleCall(String customerId, String accountI } @SuppressWarnings("rawtypes") - private okhttp3.Call updatePricingScheduleValidateBeforeCall(String customerId, String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'customerId' is set - if (customerId == null) { - throw new ApiException("Missing the required parameter 'customerId' when calling updatePricingSchedule(Async)"); - } - + private okhttp3.Call updatePricingScheduleValidateBeforeCall(String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'accountId' is set if (accountId == null) { throw new ApiException("Missing the required parameter 'accountId' when calling updatePricingSchedule(Async)"); @@ -1302,14 +1406,13 @@ private okhttp3.Call updatePricingScheduleValidateBeforeCall(String customerId, throw new ApiException("Missing the required parameter 'updatePricingScheduleRequest' when calling updatePricingSchedule(Async)"); } - return updatePricingScheduleCall(customerId, accountId, updatePricingScheduleRequest, _callback); + return updatePricingScheduleCall(accountId, updatePricingScheduleRequest, _callback); } /** * Dis/associate a plan from/to an account * This API let’s you to detach/attach a price plan from/to an existing account - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updatePricingScheduleRequest Payload to dis/associate a price plan to an account (required) * @return UpdatePricingScheduleResponse @@ -1326,15 +1429,14 @@ private okhttp3.Call updatePricingScheduleValidateBeforeCall(String customerId, 0 Error response - */ - public UpdatePricingScheduleResponse updatePricingSchedule(String customerId, String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest) throws ApiException { - ApiResponse localVarResp = updatePricingScheduleWithHttpInfo(customerId, accountId, updatePricingScheduleRequest); + public UpdatePricingScheduleResponse updatePricingSchedule(String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest) throws ApiException { + ApiResponse localVarResp = updatePricingScheduleWithHttpInfo(accountId, updatePricingScheduleRequest); return localVarResp.getData(); } /** * Dis/associate a plan from/to an account * This API let’s you to detach/attach a price plan from/to an existing account - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updatePricingScheduleRequest Payload to dis/associate a price plan to an account (required) * @return ApiResponse<UpdatePricingScheduleResponse> @@ -1351,8 +1453,8 @@ public UpdatePricingScheduleResponse updatePricingSchedule(String customerId, St 0 Error response - */ - public ApiResponse updatePricingScheduleWithHttpInfo(String customerId, String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest) throws ApiException { - okhttp3.Call localVarCall = updatePricingScheduleValidateBeforeCall(customerId, accountId, updatePricingScheduleRequest, null); + public ApiResponse updatePricingScheduleWithHttpInfo(String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest) throws ApiException { + okhttp3.Call localVarCall = updatePricingScheduleValidateBeforeCall(accountId, updatePricingScheduleRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1360,7 +1462,6 @@ public ApiResponse updatePricingScheduleWithHttpI /** * Dis/associate a plan from/to an account (asynchronously) * This API let’s you to detach/attach a price plan from/to an existing account - * @param customerId (required) * @param accountId account_id corresponding to an account (required) * @param updatePricingScheduleRequest Payload to dis/associate a price plan to an account (required) * @param _callback The callback to be executed when the API call finishes @@ -1378,9 +1479,166 @@ public ApiResponse updatePricingScheduleWithHttpI 0 Error response - */ - public okhttp3.Call updatePricingScheduleAsync(String customerId, String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updatePricingScheduleAsync(String accountId, UpdatePricingScheduleRequest updatePricingScheduleRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePricingScheduleValidateBeforeCall(accountId, updatePricingScheduleRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePricingScheduleBatch + * @param accountId account_id corresponding to an account (required) + * @param editPricingScheduleRequest Payload to dis/associate one or more price plans to an account (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for edit pricing schedule request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call updatePricingScheduleBatchCall(String accountId, EditPricingScheduleRequest editPricingScheduleRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = editPricingScheduleRequest; + + // create path and map variables + String localVarPath = "/accounts/{account_id}/edit_schedules" + .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePricingScheduleBatchValidateBeforeCall(String accountId, EditPricingScheduleRequest editPricingScheduleRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling updatePricingScheduleBatch(Async)"); + } + + // verify the required parameter 'editPricingScheduleRequest' is set + if (editPricingScheduleRequest == null) { + throw new ApiException("Missing the required parameter 'editPricingScheduleRequest' when calling updatePricingScheduleBatch(Async)"); + } + + return updatePricingScheduleBatchCall(accountId, editPricingScheduleRequest, _callback); + + } + + /** + * Edit schedules of an account. + * This API let’s you to detach/attach one or more price plans from/to an existing account + * @param accountId account_id corresponding to an account (required) + * @param editPricingScheduleRequest Payload to dis/associate one or more price plans to an account (required) + * @return UpdatePricingScheduleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for edit pricing schedule request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public UpdatePricingScheduleResponse updatePricingScheduleBatch(String accountId, EditPricingScheduleRequest editPricingScheduleRequest) throws ApiException { + ApiResponse localVarResp = updatePricingScheduleBatchWithHttpInfo(accountId, editPricingScheduleRequest); + return localVarResp.getData(); + } + + /** + * Edit schedules of an account. + * This API let’s you to detach/attach one or more price plans from/to an existing account + * @param accountId account_id corresponding to an account (required) + * @param editPricingScheduleRequest Payload to dis/associate one or more price plans to an account (required) + * @return ApiResponse<UpdatePricingScheduleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for edit pricing schedule request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse updatePricingScheduleBatchWithHttpInfo(String accountId, EditPricingScheduleRequest editPricingScheduleRequest) throws ApiException { + okhttp3.Call localVarCall = updatePricingScheduleBatchValidateBeforeCall(accountId, editPricingScheduleRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Edit schedules of an account. (asynchronously) + * This API let’s you to detach/attach one or more price plans from/to an existing account + * @param accountId account_id corresponding to an account (required) + * @param editPricingScheduleRequest Payload to dis/associate one or more price plans to an account (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for edit pricing schedule request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call updatePricingScheduleBatchAsync(String accountId, EditPricingScheduleRequest editPricingScheduleRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updatePricingScheduleValidateBeforeCall(customerId, accountId, updatePricingScheduleRequest, _callback); + okhttp3.Call localVarCall = updatePricingScheduleBatchValidateBeforeCall(accountId, editPricingScheduleRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/togai/client/api/EventIngestionApi.java b/src/main/java/com/togai/client/api/EventIngestionApi.java index 06e7602..3662985 100644 --- a/src/main/java/com/togai/client/api/EventIngestionApi.java +++ b/src/main/java/com/togai/client/api/EventIngestionApi.java @@ -29,8 +29,8 @@ import com.togai.client.models.ErrorResponse; import com.togai.client.models.IngestBatchEventRequest; -import com.togai.client.models.IngestBatchEventResponse; import com.togai.client.models.IngestEventRequest; +import com.togai.client.models.IngestEventResponse; import java.lang.reflect.Type; import java.util.ArrayList; @@ -154,6 +154,7 @@ private okhttp3.Call ingestValidateBeforeCall(IngestEventRequest ingestEventRequ * Ingest events to Togai * This API let’s you to ingest events to your Togai account. Events ingested using this API will be processed via associated usage meters and further via associated price plans to generate final billable value to invoice the customer Read more about [Event Ingestion](https://docs.togai.com/docs/event-ingestion) * @param ingestEventRequest Request body to ingest events to Togai usage and billing management service. (required) + * @return IngestEventResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -167,15 +168,16 @@ private okhttp3.Call ingestValidateBeforeCall(IngestEventRequest ingestEventRequ
0 Error response -
*/ - public void ingest(IngestEventRequest ingestEventRequest) throws ApiException { - ingestWithHttpInfo(ingestEventRequest); + public IngestEventResponse ingest(IngestEventRequest ingestEventRequest) throws ApiException { + ApiResponse localVarResp = ingestWithHttpInfo(ingestEventRequest); + return localVarResp.getData(); } /** * Ingest events to Togai * This API let’s you to ingest events to your Togai account. Events ingested using this API will be processed via associated usage meters and further via associated price plans to generate final billable value to invoice the customer Read more about [Event Ingestion](https://docs.togai.com/docs/event-ingestion) * @param ingestEventRequest Request body to ingest events to Togai usage and billing management service. (required) - * @return ApiResponse<Void> + * @return ApiResponse<IngestEventResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -189,9 +191,10 @@ public void ingest(IngestEventRequest ingestEventRequest) throws ApiException {
0 Error response -
*/ - public ApiResponse ingestWithHttpInfo(IngestEventRequest ingestEventRequest) throws ApiException { + public ApiResponse ingestWithHttpInfo(IngestEventRequest ingestEventRequest) throws ApiException { okhttp3.Call localVarCall = ingestValidateBeforeCall(ingestEventRequest, null); - return localVarApiClient.execute(localVarCall); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** @@ -213,10 +216,11 @@ public ApiResponse ingestWithHttpInfo(IngestEventRequest ingestEventReques 0 Error response - */ - public okhttp3.Call ingestAsync(IngestEventRequest ingestEventRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call ingestAsync(IngestEventRequest ingestEventRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = ingestValidateBeforeCall(ingestEventRequest, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** @@ -298,7 +302,7 @@ private okhttp3.Call ingestBatchValidateBeforeCall(IngestBatchEventRequest inges * Ingest events to Togai in batch * This API let’s you to ingest events in batch upto 1000 events. Ingest large amounts of events up to 1000 in batches in an array using this API. * @param ingestBatchEventRequest Request body to ingest events in batch to Togai usage and billing management service. (required) - * @return IngestBatchEventResponse + * @return IngestEventResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -313,8 +317,8 @@ private okhttp3.Call ingestBatchValidateBeforeCall(IngestBatchEventRequest inges
0 Error response -
*/ - public IngestBatchEventResponse ingestBatch(IngestBatchEventRequest ingestBatchEventRequest) throws ApiException { - ApiResponse localVarResp = ingestBatchWithHttpInfo(ingestBatchEventRequest); + public IngestEventResponse ingestBatch(IngestBatchEventRequest ingestBatchEventRequest) throws ApiException { + ApiResponse localVarResp = ingestBatchWithHttpInfo(ingestBatchEventRequest); return localVarResp.getData(); } @@ -322,7 +326,7 @@ public IngestBatchEventResponse ingestBatch(IngestBatchEventRequest ingestBatchE * Ingest events to Togai in batch * This API let’s you to ingest events in batch upto 1000 events. Ingest large amounts of events up to 1000 in batches in an array using this API. * @param ingestBatchEventRequest Request body to ingest events in batch to Togai usage and billing management service. (required) - * @return ApiResponse<IngestBatchEventResponse> + * @return ApiResponse<IngestEventResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -337,9 +341,9 @@ public IngestBatchEventResponse ingestBatch(IngestBatchEventRequest ingestBatchE
0 Error response -
*/ - public ApiResponse ingestBatchWithHttpInfo(IngestBatchEventRequest ingestBatchEventRequest) throws ApiException { + public ApiResponse ingestBatchWithHttpInfo(IngestBatchEventRequest ingestBatchEventRequest) throws ApiException { okhttp3.Call localVarCall = ingestBatchValidateBeforeCall(ingestBatchEventRequest, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -363,10 +367,10 @@ public ApiResponse ingestBatchWithHttpInfo(IngestBatch 0 Error response - */ - public okhttp3.Call ingestBatchAsync(IngestBatchEventRequest ingestBatchEventRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call ingestBatchAsync(IngestBatchEventRequest ingestBatchEventRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = ingestBatchValidateBeforeCall(ingestBatchEventRequest, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/src/main/java/com/togai/client/api/InvoicesApi.java b/src/main/java/com/togai/client/api/InvoicesApi.java index 8852d4a..4b1d90d 100644 --- a/src/main/java/com/togai/client/api/InvoicesApi.java +++ b/src/main/java/com/togai/client/api/InvoicesApi.java @@ -30,6 +30,8 @@ import com.togai.client.models.ErrorResponse; import com.togai.client.models.Invoice; import com.togai.client.models.ListInvoicesResponse; +import com.togai.client.models.ManageMiscellaneousChargesRequest; +import com.togai.client.models.MiscellaneousChargesResponse; import java.lang.reflect.Type; import java.util.ArrayList; @@ -415,4 +417,308 @@ public okhttp3.Call listInvoicesAsync(String nextToken, String status, String ac localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for manageMiscellaneousChargesInAccount + * @param accountId account_id corresponding to an account (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call manageMiscellaneousChargesInAccountCall(String accountId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = manageMiscellaneousChargesRequest; + + // create path and map variables + String localVarPath = "/accounts/{account_id}/miscellaneous_charges" + .replace("{" + "account_id" + "}", localVarApiClient.escapeString(accountId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call manageMiscellaneousChargesInAccountValidateBeforeCall(String accountId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountId' is set + if (accountId == null) { + throw new ApiException("Missing the required parameter 'accountId' when calling manageMiscellaneousChargesInAccount(Async)"); + } + + return manageMiscellaneousChargesInAccountCall(accountId, manageMiscellaneousChargesRequest, _callback); + + } + + /** + * Add or update miscellaneous charges in upcoming Invoice for a account + * Add or update miscellaneous charges in upcoming Invoice for a account + * @param accountId account_id corresponding to an account (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @return MiscellaneousChargesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public MiscellaneousChargesResponse manageMiscellaneousChargesInAccount(String accountId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest) throws ApiException { + ApiResponse localVarResp = manageMiscellaneousChargesInAccountWithHttpInfo(accountId, manageMiscellaneousChargesRequest); + return localVarResp.getData(); + } + + /** + * Add or update miscellaneous charges in upcoming Invoice for a account + * Add or update miscellaneous charges in upcoming Invoice for a account + * @param accountId account_id corresponding to an account (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @return ApiResponse<MiscellaneousChargesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse manageMiscellaneousChargesInAccountWithHttpInfo(String accountId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest) throws ApiException { + okhttp3.Call localVarCall = manageMiscellaneousChargesInAccountValidateBeforeCall(accountId, manageMiscellaneousChargesRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add or update miscellaneous charges in upcoming Invoice for a account (asynchronously) + * Add or update miscellaneous charges in upcoming Invoice for a account + * @param accountId account_id corresponding to an account (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call manageMiscellaneousChargesInAccountAsync(String accountId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = manageMiscellaneousChargesInAccountValidateBeforeCall(accountId, manageMiscellaneousChargesRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for manageMiscellaneousChargesInInvoice + * @param invoiceId (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call manageMiscellaneousChargesInInvoiceCall(String invoiceId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = manageMiscellaneousChargesRequest; + + // create path and map variables + String localVarPath = "/invoices/{invoice_id}/miscellaneous_charges" + .replace("{" + "invoice_id" + "}", localVarApiClient.escapeString(invoiceId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call manageMiscellaneousChargesInInvoiceValidateBeforeCall(String invoiceId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invoiceId' is set + if (invoiceId == null) { + throw new ApiException("Missing the required parameter 'invoiceId' when calling manageMiscellaneousChargesInInvoice(Async)"); + } + + return manageMiscellaneousChargesInInvoiceCall(invoiceId, manageMiscellaneousChargesRequest, _callback); + + } + + /** + * Add or update miscellaneous charges in Invoice + * Add or update miscellaneous charges in Invoice + * @param invoiceId (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @return MiscellaneousChargesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public MiscellaneousChargesResponse manageMiscellaneousChargesInInvoice(String invoiceId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest) throws ApiException { + ApiResponse localVarResp = manageMiscellaneousChargesInInvoiceWithHttpInfo(invoiceId, manageMiscellaneousChargesRequest); + return localVarResp.getData(); + } + + /** + * Add or update miscellaneous charges in Invoice + * Add or update miscellaneous charges in Invoice + * @param invoiceId (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @return ApiResponse<MiscellaneousChargesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse manageMiscellaneousChargesInInvoiceWithHttpInfo(String invoiceId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest) throws ApiException { + okhttp3.Call localVarCall = manageMiscellaneousChargesInInvoiceValidateBeforeCall(invoiceId, manageMiscellaneousChargesRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add or update miscellaneous charges in Invoice (asynchronously) + * Add or update miscellaneous charges in Invoice + * @param invoiceId (required) + * @param manageMiscellaneousChargesRequest Payload to update custom line items (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response for Miscellaneous Charges Request -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call manageMiscellaneousChargesInInvoiceAsync(String invoiceId, ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = manageMiscellaneousChargesInInvoiceValidateBeforeCall(invoiceId, manageMiscellaneousChargesRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/src/main/java/com/togai/client/api/MetricsApi.java b/src/main/java/com/togai/client/api/MetricsApi.java index 73c8f45..d739111 100644 --- a/src/main/java/com/togai/client/api/MetricsApi.java +++ b/src/main/java/com/togai/client/api/MetricsApi.java @@ -145,7 +145,7 @@ private okhttp3.Call getMetricsValidateBeforeCall(GetMetricsRequest getMetricsRe /** * Get Togai Metrics - * Togai Metrics API allows you to fetch different metrics from Events , Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. + * Togai Metrics API allows you to fetch different metrics from Events, Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. * @param getMetricsRequest (optional) * @return GetMetricsResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -167,7 +167,7 @@ public GetMetricsResponse getMetrics(GetMetricsRequest getMetricsRequest) throws /** * Get Togai Metrics - * Togai Metrics API allows you to fetch different metrics from Events , Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. + * Togai Metrics API allows you to fetch different metrics from Events, Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. * @param getMetricsRequest (optional) * @return ApiResponse<GetMetricsResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -190,7 +190,7 @@ public ApiResponse getMetricsWithHttpInfo(GetMetricsRequest /** * Get Togai Metrics (asynchronously) - * Togai Metrics API allows you to fetch different metrics from Events , Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. + * Togai Metrics API allows you to fetch different metrics from Events, Usage Meters and PricePlans with multiple queryable options. A single request can query up to five metrics. Single response can contain a maximum of 100 data points. * @param getMetricsRequest (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call diff --git a/src/main/java/com/togai/client/api/PriceExperimentationApi.java b/src/main/java/com/togai/client/api/PriceExperimentationApi.java new file mode 100644 index 0000000..be91a54 --- /dev/null +++ b/src/main/java/com/togai/client/api/PriceExperimentationApi.java @@ -0,0 +1,225 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.api; + +import com.togai.client.ApiCallback; +import com.togai.client.ApiClient; +import com.togai.client.ApiException; +import com.togai.client.ApiResponse; +import com.togai.client.Configuration; +import com.togai.client.Pair; +import com.togai.client.ProgressRequestBody; +import com.togai.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.togai.client.models.CalculateRevenueRequest; +import com.togai.client.models.CalculateRevenueResponse; +import com.togai.client.models.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class PriceExperimentationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PriceExperimentationApi() { + this(Configuration.getDefaultApiClient()); + } + + public PriceExperimentationApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for calculateRevenue + * @param calculateRevenueRequest Request payload for calculateRevenueAPI (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response payload for calculateRevenueAPI -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call calculateRevenueCall(CalculateRevenueRequest calculateRevenueRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = calculateRevenueRequest; + + // create path and map variables + String localVarPath = "/revenue_calculator"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call calculateRevenueValidateBeforeCall(CalculateRevenueRequest calculateRevenueRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'calculateRevenueRequest' is set + if (calculateRevenueRequest == null) { + throw new ApiException("Missing the required parameter 'calculateRevenueRequest' when calling calculateRevenue(Async)"); + } + + return calculateRevenueCall(calculateRevenueRequest, _callback); + + } + + /** + * Calculate and return the revenue for a existing or new price plan + * Calculate and return the revenue for a existing or new price plan + * @param calculateRevenueRequest Request payload for calculateRevenueAPI (required) + * @return CalculateRevenueResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response payload for calculateRevenueAPI -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public CalculateRevenueResponse calculateRevenue(CalculateRevenueRequest calculateRevenueRequest) throws ApiException { + ApiResponse localVarResp = calculateRevenueWithHttpInfo(calculateRevenueRequest); + return localVarResp.getData(); + } + + /** + * Calculate and return the revenue for a existing or new price plan + * Calculate and return the revenue for a existing or new price plan + * @param calculateRevenueRequest Request payload for calculateRevenueAPI (required) + * @return ApiResponse<CalculateRevenueResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response payload for calculateRevenueAPI -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse calculateRevenueWithHttpInfo(CalculateRevenueRequest calculateRevenueRequest) throws ApiException { + okhttp3.Call localVarCall = calculateRevenueValidateBeforeCall(calculateRevenueRequest, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Calculate and return the revenue for a existing or new price plan (asynchronously) + * Calculate and return the revenue for a existing or new price plan + * @param calculateRevenueRequest Request payload for calculateRevenueAPI (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Response payload for calculateRevenueAPI -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call calculateRevenueAsync(CalculateRevenueRequest calculateRevenueRequest, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = calculateRevenueValidateBeforeCall(calculateRevenueRequest, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/togai/client/api/PricePlansApi.java b/src/main/java/com/togai/client/api/PricePlansApi.java index 881e02b..97d44f7 100644 --- a/src/main/java/com/togai/client/api/PricePlansApi.java +++ b/src/main/java/com/togai/client/api/PricePlansApi.java @@ -544,6 +544,7 @@ public okhttp3.Call createPricePlanAsync(CreatePricePlanRequest createPricePlanR /** * Build call for getPricePlan * @param pricePlanId (required) + * @param version Optional version to get a specific version. Gets latest version if it is not provided. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -559,7 +560,7 @@ public okhttp3.Call createPricePlanAsync(CreatePricePlanRequest createPricePlanR 0 Error response - */ - public okhttp3.Call getPricePlanCall(String pricePlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getPricePlanCall(String pricePlanId, Integer version, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -585,6 +586,10 @@ public okhttp3.Call getPricePlanCall(String pricePlanId, final ApiCallback _call Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (version != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("version", version)); + } + final String[] localVarAccepts = { "application/json" }; @@ -605,13 +610,13 @@ public okhttp3.Call getPricePlanCall(String pricePlanId, final ApiCallback _call } @SuppressWarnings("rawtypes") - private okhttp3.Call getPricePlanValidateBeforeCall(String pricePlanId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getPricePlanValidateBeforeCall(String pricePlanId, Integer version, final ApiCallback _callback) throws ApiException { // verify the required parameter 'pricePlanId' is set if (pricePlanId == null) { throw new ApiException("Missing the required parameter 'pricePlanId' when calling getPricePlan(Async)"); } - return getPricePlanCall(pricePlanId, _callback); + return getPricePlanCall(pricePlanId, version, _callback); } @@ -619,6 +624,7 @@ private okhttp3.Call getPricePlanValidateBeforeCall(String pricePlanId, final Ap * Get a price plan * Get a price plan details using price plan id * @param pricePlanId (required) + * @param version Optional version to get a specific version. Gets latest version if it is not provided. (optional) * @return PricePlan * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -633,8 +639,8 @@ private okhttp3.Call getPricePlanValidateBeforeCall(String pricePlanId, final Ap 0 Error response - */ - public PricePlan getPricePlan(String pricePlanId) throws ApiException { - ApiResponse localVarResp = getPricePlanWithHttpInfo(pricePlanId); + public PricePlan getPricePlan(String pricePlanId, Integer version) throws ApiException { + ApiResponse localVarResp = getPricePlanWithHttpInfo(pricePlanId, version); return localVarResp.getData(); } @@ -642,6 +648,7 @@ public PricePlan getPricePlan(String pricePlanId) throws ApiException { * Get a price plan * Get a price plan details using price plan id * @param pricePlanId (required) + * @param version Optional version to get a specific version. Gets latest version if it is not provided. (optional) * @return ApiResponse<PricePlan> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -656,8 +663,8 @@ public PricePlan getPricePlan(String pricePlanId) throws ApiException { 0 Error response - */ - public ApiResponse getPricePlanWithHttpInfo(String pricePlanId) throws ApiException { - okhttp3.Call localVarCall = getPricePlanValidateBeforeCall(pricePlanId, null); + public ApiResponse getPricePlanWithHttpInfo(String pricePlanId, Integer version) throws ApiException { + okhttp3.Call localVarCall = getPricePlanValidateBeforeCall(pricePlanId, version, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -666,6 +673,7 @@ public ApiResponse getPricePlanWithHttpInfo(String pricePlanId) throw * Get a price plan (asynchronously) * Get a price plan details using price plan id * @param pricePlanId (required) + * @param version Optional version to get a specific version. Gets latest version if it is not provided. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -681,9 +689,9 @@ public ApiResponse getPricePlanWithHttpInfo(String pricePlanId) throw 0 Error response - */ - public okhttp3.Call getPricePlanAsync(String pricePlanId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getPricePlanAsync(String pricePlanId, Integer version, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getPricePlanValidateBeforeCall(pricePlanId, _callback); + okhttp3.Call localVarCall = getPricePlanValidateBeforeCall(pricePlanId, version, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/togai/client/api/UsageMetersApi.java b/src/main/java/com/togai/client/api/UsageMetersApi.java index d9b65e6..bd4581e 100644 --- a/src/main/java/com/togai/client/api/UsageMetersApi.java +++ b/src/main/java/com/togai/client/api/UsageMetersApi.java @@ -27,6 +27,7 @@ import java.io.IOException; +import com.togai.client.models.BaseSuccessResponse; import java.math.BigDecimal; import com.togai.client.models.CreateUsageMeterRequest; import com.togai.client.models.ErrorResponse; @@ -80,7 +81,6 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for activateUsageMeter - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -97,7 +97,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 0 Error response - */ - public okhttp3.Call activateUsageMeterCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call activateUsageMeterCall(String usageMeterId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -114,8 +114,7 @@ public okhttp3.Call activateUsageMeterCall(String eventSchemaName, String usageM Object localVarPostBody = null; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/activate" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())) + String localVarPath = "/usage_meters/{usage_meter_id}/activate" .replace("{" + "usage_meter_id" + "}", localVarApiClient.escapeString(usageMeterId.toString())); List localVarQueryParams = new ArrayList(); @@ -144,25 +143,19 @@ public okhttp3.Call activateUsageMeterCall(String eventSchemaName, String usageM } @SuppressWarnings("rawtypes") - private okhttp3.Call activateUsageMeterValidateBeforeCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling activateUsageMeter(Async)"); - } - + private okhttp3.Call activateUsageMeterValidateBeforeCall(String usageMeterId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'usageMeterId' is set if (usageMeterId == null) { throw new ApiException("Missing the required parameter 'usageMeterId' when calling activateUsageMeter(Async)"); } - return activateUsageMeterCall(eventSchemaName, usageMeterId, _callback); + return activateUsageMeterCall(usageMeterId, _callback); } /** * Activate usage meter * Activate usage meter - * @param eventSchemaName (required) * @param usageMeterId (required) * @return UsageMeter * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -178,15 +171,14 @@ private okhttp3.Call activateUsageMeterValidateBeforeCall(String eventSchemaName 0 Error response - */ - public UsageMeter activateUsageMeter(String eventSchemaName, String usageMeterId) throws ApiException { - ApiResponse localVarResp = activateUsageMeterWithHttpInfo(eventSchemaName, usageMeterId); + public UsageMeter activateUsageMeter(String usageMeterId) throws ApiException { + ApiResponse localVarResp = activateUsageMeterWithHttpInfo(usageMeterId); return localVarResp.getData(); } /** * Activate usage meter * Activate usage meter - * @param eventSchemaName (required) * @param usageMeterId (required) * @return ApiResponse<UsageMeter> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -202,8 +194,8 @@ public UsageMeter activateUsageMeter(String eventSchemaName, String usageMeterId 0 Error response - */ - public ApiResponse activateUsageMeterWithHttpInfo(String eventSchemaName, String usageMeterId) throws ApiException { - okhttp3.Call localVarCall = activateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, null); + public ApiResponse activateUsageMeterWithHttpInfo(String usageMeterId) throws ApiException { + okhttp3.Call localVarCall = activateUsageMeterValidateBeforeCall(usageMeterId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -211,7 +203,6 @@ public ApiResponse activateUsageMeterWithHttpInfo(String eventSchema /** * Activate usage meter (asynchronously) * Activate usage meter - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -228,16 +219,15 @@ public ApiResponse activateUsageMeterWithHttpInfo(String eventSchema 0 Error response - */ - public okhttp3.Call activateUsageMeterAsync(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call activateUsageMeterAsync(String usageMeterId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = activateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, _callback); + okhttp3.Call localVarCall = activateUsageMeterValidateBeforeCall(usageMeterId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for createUsageMeter - * @param eventSchemaName (required) * @param createUsageMeterRequest Payload to create usage meter (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -254,7 +244,7 @@ public okhttp3.Call activateUsageMeterAsync(String eventSchemaName, String usage 0 Error response - */ - public okhttp3.Call createUsageMeterCall(String eventSchemaName, CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsageMeterCall(CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -271,8 +261,7 @@ public okhttp3.Call createUsageMeterCall(String eventSchemaName, CreateUsageMete Object localVarPostBody = createUsageMeterRequest; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())); + String localVarPath = "/usage_meters"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -301,25 +290,19 @@ public okhttp3.Call createUsageMeterCall(String eventSchemaName, CreateUsageMete } @SuppressWarnings("rawtypes") - private okhttp3.Call createUsageMeterValidateBeforeCall(String eventSchemaName, CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling createUsageMeter(Async)"); - } - + private okhttp3.Call createUsageMeterValidateBeforeCall(CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'createUsageMeterRequest' is set if (createUsageMeterRequest == null) { throw new ApiException("Missing the required parameter 'createUsageMeterRequest' when calling createUsageMeter(Async)"); } - return createUsageMeterCall(eventSchemaName, createUsageMeterRequest, _callback); + return createUsageMeterCall(createUsageMeterRequest, _callback); } /** * Create an usage meter * Create an usage meter and associate with an event schema - * @param eventSchemaName (required) * @param createUsageMeterRequest Payload to create usage meter (required) * @return UsageMeter * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -335,15 +318,14 @@ private okhttp3.Call createUsageMeterValidateBeforeCall(String eventSchemaName, 0 Error response - */ - public UsageMeter createUsageMeter(String eventSchemaName, CreateUsageMeterRequest createUsageMeterRequest) throws ApiException { - ApiResponse localVarResp = createUsageMeterWithHttpInfo(eventSchemaName, createUsageMeterRequest); + public UsageMeter createUsageMeter(CreateUsageMeterRequest createUsageMeterRequest) throws ApiException { + ApiResponse localVarResp = createUsageMeterWithHttpInfo(createUsageMeterRequest); return localVarResp.getData(); } /** * Create an usage meter * Create an usage meter and associate with an event schema - * @param eventSchemaName (required) * @param createUsageMeterRequest Payload to create usage meter (required) * @return ApiResponse<UsageMeter> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -359,8 +341,8 @@ public UsageMeter createUsageMeter(String eventSchemaName, CreateUsageMeterReque 0 Error response - */ - public ApiResponse createUsageMeterWithHttpInfo(String eventSchemaName, CreateUsageMeterRequest createUsageMeterRequest) throws ApiException { - okhttp3.Call localVarCall = createUsageMeterValidateBeforeCall(eventSchemaName, createUsageMeterRequest, null); + public ApiResponse createUsageMeterWithHttpInfo(CreateUsageMeterRequest createUsageMeterRequest) throws ApiException { + okhttp3.Call localVarCall = createUsageMeterValidateBeforeCall(createUsageMeterRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -368,7 +350,6 @@ public ApiResponse createUsageMeterWithHttpInfo(String eventSchemaNa /** * Create an usage meter (asynchronously) * Create an usage meter and associate with an event schema - * @param eventSchemaName (required) * @param createUsageMeterRequest Payload to create usage meter (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -385,16 +366,15 @@ public ApiResponse createUsageMeterWithHttpInfo(String eventSchemaNa 0 Error response - */ - public okhttp3.Call createUsageMeterAsync(String eventSchemaName, CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createUsageMeterAsync(CreateUsageMeterRequest createUsageMeterRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createUsageMeterValidateBeforeCall(eventSchemaName, createUsageMeterRequest, _callback); + okhttp3.Call localVarCall = createUsageMeterValidateBeforeCall(createUsageMeterRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deactivateUsageMeter - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -411,7 +391,7 @@ public okhttp3.Call createUsageMeterAsync(String eventSchemaName, CreateUsageMet 0 Error response - */ - public okhttp3.Call deactivateUsageMeterCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deactivateUsageMeterCall(String usageMeterId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -428,8 +408,7 @@ public okhttp3.Call deactivateUsageMeterCall(String eventSchemaName, String usag Object localVarPostBody = null; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters/{usage_meter_id}/deactivate" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())) + String localVarPath = "/usage_meters/{usage_meter_id}/deactivate" .replace("{" + "usage_meter_id" + "}", localVarApiClient.escapeString(usageMeterId.toString())); List localVarQueryParams = new ArrayList(); @@ -458,25 +437,19 @@ public okhttp3.Call deactivateUsageMeterCall(String eventSchemaName, String usag } @SuppressWarnings("rawtypes") - private okhttp3.Call deactivateUsageMeterValidateBeforeCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling deactivateUsageMeter(Async)"); - } - + private okhttp3.Call deactivateUsageMeterValidateBeforeCall(String usageMeterId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'usageMeterId' is set if (usageMeterId == null) { throw new ApiException("Missing the required parameter 'usageMeterId' when calling deactivateUsageMeter(Async)"); } - return deactivateUsageMeterCall(eventSchemaName, usageMeterId, _callback); + return deactivateUsageMeterCall(usageMeterId, _callback); } /** * Deactivate usage meter * Make an existing active usage meter to be inactive Active Usage Meters with active Pricing Plan attached can also be deactivated. - * @param eventSchemaName (required) * @param usageMeterId (required) * @return UsageMeter * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -492,15 +465,14 @@ private okhttp3.Call deactivateUsageMeterValidateBeforeCall(String eventSchemaNa 0 Error response - */ - public UsageMeter deactivateUsageMeter(String eventSchemaName, String usageMeterId) throws ApiException { - ApiResponse localVarResp = deactivateUsageMeterWithHttpInfo(eventSchemaName, usageMeterId); + public UsageMeter deactivateUsageMeter(String usageMeterId) throws ApiException { + ApiResponse localVarResp = deactivateUsageMeterWithHttpInfo(usageMeterId); return localVarResp.getData(); } /** * Deactivate usage meter * Make an existing active usage meter to be inactive Active Usage Meters with active Pricing Plan attached can also be deactivated. - * @param eventSchemaName (required) * @param usageMeterId (required) * @return ApiResponse<UsageMeter> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -516,8 +488,8 @@ public UsageMeter deactivateUsageMeter(String eventSchemaName, String usageMeter 0 Error response - */ - public ApiResponse deactivateUsageMeterWithHttpInfo(String eventSchemaName, String usageMeterId) throws ApiException { - okhttp3.Call localVarCall = deactivateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, null); + public ApiResponse deactivateUsageMeterWithHttpInfo(String usageMeterId) throws ApiException { + okhttp3.Call localVarCall = deactivateUsageMeterValidateBeforeCall(usageMeterId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -525,7 +497,6 @@ public ApiResponse deactivateUsageMeterWithHttpInfo(String eventSche /** * Deactivate usage meter (asynchronously) * Make an existing active usage meter to be inactive Active Usage Meters with active Pricing Plan attached can also be deactivated. - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -542,16 +513,162 @@ public ApiResponse deactivateUsageMeterWithHttpInfo(String eventSche 0 Error response - */ - public okhttp3.Call deactivateUsageMeterAsync(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deactivateUsageMeterAsync(String usageMeterId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deactivateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, _callback); + okhttp3.Call localVarCall = deactivateUsageMeterValidateBeforeCall(usageMeterId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for deleteUsageMeter + * @param usageMeterId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call deleteUsageMeterCall(String usageMeterId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/usage_meters/{usage_meter_id}" + .replace("{" + "usage_meter_id" + "}", localVarApiClient.escapeString(usageMeterId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearerAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteUsageMeterValidateBeforeCall(String usageMeterId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'usageMeterId' is set + if (usageMeterId == null) { + throw new ApiException("Missing the required parameter 'usageMeterId' when calling deleteUsageMeter(Async)"); + } + + return deleteUsageMeterCall(usageMeterId, _callback); + + } + + /** + * Delete an Usage Meter + * Delete an Usage Meter + * @param usageMeterId (required) + * @return BaseSuccessResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public BaseSuccessResponse deleteUsageMeter(String usageMeterId) throws ApiException { + ApiResponse localVarResp = deleteUsageMeterWithHttpInfo(usageMeterId); + return localVarResp.getData(); + } + + /** + * Delete an Usage Meter + * Delete an Usage Meter + * @param usageMeterId (required) + * @return ApiResponse<BaseSuccessResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public ApiResponse deleteUsageMeterWithHttpInfo(String usageMeterId) throws ApiException { + okhttp3.Call localVarCall = deleteUsageMeterValidateBeforeCall(usageMeterId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete an Usage Meter (asynchronously) + * Delete an Usage Meter + * @param usageMeterId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Error response -
401 Error response -
403 Error response -
404 Error response -
429 Error response -
0 Error response -
+ */ + public okhttp3.Call deleteUsageMeterAsync(String usageMeterId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteUsageMeterValidateBeforeCall(usageMeterId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getUsageMeter - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -568,7 +685,7 @@ public okhttp3.Call deactivateUsageMeterAsync(String eventSchemaName, String usa 0 Error response - */ - public okhttp3.Call getUsageMeterCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUsageMeterCall(String usageMeterId, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -585,8 +702,7 @@ public okhttp3.Call getUsageMeterCall(String eventSchemaName, String usageMeterI Object localVarPostBody = null; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters/{usage_meter_id}" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())) + String localVarPath = "/usage_meters/{usage_meter_id}" .replace("{" + "usage_meter_id" + "}", localVarApiClient.escapeString(usageMeterId.toString())); List localVarQueryParams = new ArrayList(); @@ -615,25 +731,19 @@ public okhttp3.Call getUsageMeterCall(String eventSchemaName, String usageMeterI } @SuppressWarnings("rawtypes") - private okhttp3.Call getUsageMeterValidateBeforeCall(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling getUsageMeter(Async)"); - } - + private okhttp3.Call getUsageMeterValidateBeforeCall(String usageMeterId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'usageMeterId' is set if (usageMeterId == null) { throw new ApiException("Missing the required parameter 'usageMeterId' when calling getUsageMeter(Async)"); } - return getUsageMeterCall(eventSchemaName, usageMeterId, _callback); + return getUsageMeterCall(usageMeterId, _callback); } /** * Get usage meter * Get an usage meter using event schema name and usage meter id. - * @param eventSchemaName (required) * @param usageMeterId (required) * @return UsageMeter * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -649,15 +759,14 @@ private okhttp3.Call getUsageMeterValidateBeforeCall(String eventSchemaName, Str 0 Error response - */ - public UsageMeter getUsageMeter(String eventSchemaName, String usageMeterId) throws ApiException { - ApiResponse localVarResp = getUsageMeterWithHttpInfo(eventSchemaName, usageMeterId); + public UsageMeter getUsageMeter(String usageMeterId) throws ApiException { + ApiResponse localVarResp = getUsageMeterWithHttpInfo(usageMeterId); return localVarResp.getData(); } /** * Get usage meter * Get an usage meter using event schema name and usage meter id. - * @param eventSchemaName (required) * @param usageMeterId (required) * @return ApiResponse<UsageMeter> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -673,8 +782,8 @@ public UsageMeter getUsageMeter(String eventSchemaName, String usageMeterId) thr 0 Error response - */ - public ApiResponse getUsageMeterWithHttpInfo(String eventSchemaName, String usageMeterId) throws ApiException { - okhttp3.Call localVarCall = getUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, null); + public ApiResponse getUsageMeterWithHttpInfo(String usageMeterId) throws ApiException { + okhttp3.Call localVarCall = getUsageMeterValidateBeforeCall(usageMeterId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -682,7 +791,6 @@ public ApiResponse getUsageMeterWithHttpInfo(String eventSchemaName, /** * Get usage meter (asynchronously) * Get an usage meter using event schema name and usage meter id. - * @param eventSchemaName (required) * @param usageMeterId (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -699,16 +807,15 @@ public ApiResponse getUsageMeterWithHttpInfo(String eventSchemaName, 0 Error response - */ - public okhttp3.Call getUsageMeterAsync(String eventSchemaName, String usageMeterId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUsageMeterAsync(String usageMeterId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, _callback); + okhttp3.Call localVarCall = getUsageMeterValidateBeforeCall(usageMeterId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getUsageMetersForEventSchema - * @param eventSchemaName (required) * @param status Filter by status (optional) * @param aggregations Filter by aggregations (optional) * @param nextToken (optional) @@ -728,7 +835,7 @@ public okhttp3.Call getUsageMeterAsync(String eventSchemaName, String usageMeter 0 Error response - */ - public okhttp3.Call getUsageMetersForEventSchemaCall(String eventSchemaName, String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUsageMetersForEventSchemaCall(String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -745,8 +852,7 @@ public okhttp3.Call getUsageMetersForEventSchemaCall(String eventSchemaName, Str Object localVarPostBody = null; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())); + String localVarPath = "/usage_meters"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -790,20 +896,14 @@ public okhttp3.Call getUsageMetersForEventSchemaCall(String eventSchemaName, Str } @SuppressWarnings("rawtypes") - private okhttp3.Call getUsageMetersForEventSchemaValidateBeforeCall(String eventSchemaName, String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling getUsageMetersForEventSchema(Async)"); - } - - return getUsageMetersForEventSchemaCall(eventSchemaName, status, aggregations, nextToken, pageSize, _callback); + private okhttp3.Call getUsageMetersForEventSchemaValidateBeforeCall(String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + return getUsageMetersForEventSchemaCall(status, aggregations, nextToken, pageSize, _callback); } /** * List usage meters for event schema * Get a list of usage meters associated with an event schema - * @param eventSchemaName (required) * @param status Filter by status (optional) * @param aggregations Filter by aggregations (optional) * @param nextToken (optional) @@ -822,15 +922,14 @@ private okhttp3.Call getUsageMetersForEventSchemaValidateBeforeCall(String event 0 Error response - */ - public UsageMeterPaginatedResponse getUsageMetersForEventSchema(String eventSchemaName, String status, String aggregations, String nextToken, BigDecimal pageSize) throws ApiException { - ApiResponse localVarResp = getUsageMetersForEventSchemaWithHttpInfo(eventSchemaName, status, aggregations, nextToken, pageSize); + public UsageMeterPaginatedResponse getUsageMetersForEventSchema(String status, String aggregations, String nextToken, BigDecimal pageSize) throws ApiException { + ApiResponse localVarResp = getUsageMetersForEventSchemaWithHttpInfo(status, aggregations, nextToken, pageSize); return localVarResp.getData(); } /** * List usage meters for event schema * Get a list of usage meters associated with an event schema - * @param eventSchemaName (required) * @param status Filter by status (optional) * @param aggregations Filter by aggregations (optional) * @param nextToken (optional) @@ -849,8 +948,8 @@ public UsageMeterPaginatedResponse getUsageMetersForEventSchema(String eventSche 0 Error response - */ - public ApiResponse getUsageMetersForEventSchemaWithHttpInfo(String eventSchemaName, String status, String aggregations, String nextToken, BigDecimal pageSize) throws ApiException { - okhttp3.Call localVarCall = getUsageMetersForEventSchemaValidateBeforeCall(eventSchemaName, status, aggregations, nextToken, pageSize, null); + public ApiResponse getUsageMetersForEventSchemaWithHttpInfo(String status, String aggregations, String nextToken, BigDecimal pageSize) throws ApiException { + okhttp3.Call localVarCall = getUsageMetersForEventSchemaValidateBeforeCall(status, aggregations, nextToken, pageSize, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -858,7 +957,6 @@ public ApiResponse getUsageMetersForEventSchemaWith /** * List usage meters for event schema (asynchronously) * Get a list of usage meters associated with an event schema - * @param eventSchemaName (required) * @param status Filter by status (optional) * @param aggregations Filter by aggregations (optional) * @param nextToken (optional) @@ -878,16 +976,15 @@ public ApiResponse getUsageMetersForEventSchemaWith 0 Error response - */ - public okhttp3.Call getUsageMetersForEventSchemaAsync(String eventSchemaName, String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getUsageMetersForEventSchemaAsync(String status, String aggregations, String nextToken, BigDecimal pageSize, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getUsageMetersForEventSchemaValidateBeforeCall(eventSchemaName, status, aggregations, nextToken, pageSize, _callback); + okhttp3.Call localVarCall = getUsageMetersForEventSchemaValidateBeforeCall(status, aggregations, nextToken, pageSize, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateUsageMeter - * @param eventSchemaName (required) * @param usageMeterId (required) * @param updateUsageMeterRequest Payload to create usage meter (required) * @param _callback Callback for upload/download progress @@ -905,7 +1002,7 @@ public okhttp3.Call getUsageMetersForEventSchemaAsync(String eventSchemaName, St 0 Error response - */ - public okhttp3.Call updateUsageMeterCall(String eventSchemaName, String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUsageMeterCall(String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -922,8 +1019,7 @@ public okhttp3.Call updateUsageMeterCall(String eventSchemaName, String usageMet Object localVarPostBody = updateUsageMeterRequest; // create path and map variables - String localVarPath = "/event_schema/{event_schema_name}/usage_meters/{usage_meter_id}" - .replace("{" + "event_schema_name" + "}", localVarApiClient.escapeString(eventSchemaName.toString())) + String localVarPath = "/usage_meters/{usage_meter_id}" .replace("{" + "usage_meter_id" + "}", localVarApiClient.escapeString(usageMeterId.toString())); List localVarQueryParams = new ArrayList(); @@ -953,12 +1049,7 @@ public okhttp3.Call updateUsageMeterCall(String eventSchemaName, String usageMet } @SuppressWarnings("rawtypes") - private okhttp3.Call updateUsageMeterValidateBeforeCall(String eventSchemaName, String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'eventSchemaName' is set - if (eventSchemaName == null) { - throw new ApiException("Missing the required parameter 'eventSchemaName' when calling updateUsageMeter(Async)"); - } - + private okhttp3.Call updateUsageMeterValidateBeforeCall(String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'usageMeterId' is set if (usageMeterId == null) { throw new ApiException("Missing the required parameter 'usageMeterId' when calling updateUsageMeter(Async)"); @@ -969,14 +1060,13 @@ private okhttp3.Call updateUsageMeterValidateBeforeCall(String eventSchemaName, throw new ApiException("Missing the required parameter 'updateUsageMeterRequest' when calling updateUsageMeter(Async)"); } - return updateUsageMeterCall(eventSchemaName, usageMeterId, updateUsageMeterRequest, _callback); + return updateUsageMeterCall(usageMeterId, updateUsageMeterRequest, _callback); } /** * Update an usage meter * This API lets you update an existing usage meter. - * @param eventSchemaName (required) * @param usageMeterId (required) * @param updateUsageMeterRequest Payload to create usage meter (required) * @return UsageMeter @@ -993,15 +1083,14 @@ private okhttp3.Call updateUsageMeterValidateBeforeCall(String eventSchemaName, 0 Error response - */ - public UsageMeter updateUsageMeter(String eventSchemaName, String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest) throws ApiException { - ApiResponse localVarResp = updateUsageMeterWithHttpInfo(eventSchemaName, usageMeterId, updateUsageMeterRequest); + public UsageMeter updateUsageMeter(String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest) throws ApiException { + ApiResponse localVarResp = updateUsageMeterWithHttpInfo(usageMeterId, updateUsageMeterRequest); return localVarResp.getData(); } /** * Update an usage meter * This API lets you update an existing usage meter. - * @param eventSchemaName (required) * @param usageMeterId (required) * @param updateUsageMeterRequest Payload to create usage meter (required) * @return ApiResponse<UsageMeter> @@ -1018,8 +1107,8 @@ public UsageMeter updateUsageMeter(String eventSchemaName, String usageMeterId, 0 Error response - */ - public ApiResponse updateUsageMeterWithHttpInfo(String eventSchemaName, String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest) throws ApiException { - okhttp3.Call localVarCall = updateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, updateUsageMeterRequest, null); + public ApiResponse updateUsageMeterWithHttpInfo(String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest) throws ApiException { + okhttp3.Call localVarCall = updateUsageMeterValidateBeforeCall(usageMeterId, updateUsageMeterRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1027,7 +1116,6 @@ public ApiResponse updateUsageMeterWithHttpInfo(String eventSchemaNa /** * Update an usage meter (asynchronously) * This API lets you update an existing usage meter. - * @param eventSchemaName (required) * @param usageMeterId (required) * @param updateUsageMeterRequest Payload to create usage meter (required) * @param _callback The callback to be executed when the API call finishes @@ -1045,9 +1133,9 @@ public ApiResponse updateUsageMeterWithHttpInfo(String eventSchemaNa 0 Error response - */ - public okhttp3.Call updateUsageMeterAsync(String eventSchemaName, String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateUsageMeterAsync(String usageMeterId, UpdateUsageMeterRequest updateUsageMeterRequest, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateUsageMeterValidateBeforeCall(eventSchemaName, usageMeterId, updateUsageMeterRequest, _callback); + okhttp3.Call localVarCall = updateUsageMeterValidateBeforeCall(usageMeterId, updateUsageMeterRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/src/main/java/com/togai/client/models/AddOn.java b/src/main/java/com/togai/client/models/AddOn.java index aac9a44..4181ad4 100644 --- a/src/main/java/com/togai/client/models/AddOn.java +++ b/src/main/java/com/togai/client/models/AddOn.java @@ -56,57 +56,6 @@ public class AddOn implements Serializable { @SerializedName(SERIALIZED_NAME_NAME) private String name; - /** - * Type of addon - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ONE_TIME("ONE_TIME"), - - RECURRING("RECURRING"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; @@ -191,28 +140,6 @@ public void setName(String name) { } - public AddOn type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Type of addon - * @return type - **/ - @javax.annotation.Nonnull - - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - public AddOn id(String id) { this.id = id; @@ -290,7 +217,6 @@ public boolean equals(Object o) { } AddOn addOn = (AddOn) o; return Objects.equals(this.name, addOn.name) && - Objects.equals(this.type, addOn.type) && Objects.equals(this.id, addOn.id) && Objects.equals(this.createdAt, addOn.createdAt) && Objects.equals(this.status, addOn.status); @@ -298,7 +224,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, type, id, createdAt, status); + return Objects.hash(name, id, createdAt, status); } @Override @@ -306,7 +232,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AddOn {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -333,7 +258,6 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("name"); - openapiFields.add("type"); openapiFields.add("id"); openapiFields.add("createdAt"); openapiFields.add("status"); @@ -341,7 +265,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("name"); - openapiRequiredFields.add("type"); openapiRequiredFields.add("id"); openapiRequiredFields.add("createdAt"); openapiRequiredFields.add("status"); @@ -377,9 +300,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } diff --git a/src/main/java/com/togai/client/models/CreateAccountRequest.java b/src/main/java/com/togai/client/models/CreateAccountRequest.java index 45aae32..c16604f 100644 --- a/src/main/java/com/togai/client/models/CreateAccountRequest.java +++ b/src/main/java/com/togai/client/models/CreateAccountRequest.java @@ -74,6 +74,10 @@ public class CreateAccountRequest implements Serializable { @SerializedName(SERIALIZED_NAME_SETTINGS) private List settings = new ArrayList<>(); + public static final String SERIALIZED_NAME_CUSTOMER_ID = "customerId"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) + private String customerId; + public CreateAccountRequest() { } @@ -203,6 +207,28 @@ public void setSettings(List settings) { } + public CreateAccountRequest customerId(String customerId) { + + this.customerId = customerId; + return this; + } + + /** + * Customer Identifier for whom the account is being created + * @return customerId + **/ + @javax.annotation.Nonnull + + public String getCustomerId() { + return customerId; + } + + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + @Override public boolean equals(Object o) { @@ -217,12 +243,13 @@ public boolean equals(Object o) { Objects.equals(this.name, createAccountRequest.name) && Objects.equals(this.invoiceCurrency, createAccountRequest.invoiceCurrency) && Objects.equals(this.aliases, createAccountRequest.aliases) && - Objects.equals(this.settings, createAccountRequest.settings); + Objects.equals(this.settings, createAccountRequest.settings) && + Objects.equals(this.customerId, createAccountRequest.customerId); } @Override public int hashCode() { - return Objects.hash(id, name, invoiceCurrency, aliases, settings); + return Objects.hash(id, name, invoiceCurrency, aliases, settings, customerId); } @Override @@ -234,6 +261,7 @@ public String toString() { sb.append(" invoiceCurrency: ").append(toIndentedString(invoiceCurrency)).append("\n"); sb.append(" aliases: ").append(toIndentedString(aliases)).append("\n"); sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -261,11 +289,13 @@ private String toIndentedString(Object o) { openapiFields.add("invoiceCurrency"); openapiFields.add("aliases"); openapiFields.add("settings"); + openapiFields.add("customerId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("name"); + openapiRequiredFields.add("customerId"); } /** @@ -322,6 +352,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { }; } } + if (!jsonObj.get("customerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerId").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/CreateAccountRequestWithoutCustomerId.java b/src/main/java/com/togai/client/models/CreateAccountRequestWithoutCustomerId.java new file mode 100644 index 0000000..d8b198a --- /dev/null +++ b/src/main/java/com/togai/client/models/CreateAccountRequestWithoutCustomerId.java @@ -0,0 +1,376 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.CreateEntitySetting; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Payload to create account + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CreateAccountRequestWithoutCustomerId implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_INVOICE_CURRENCY = "invoiceCurrency"; + @SerializedName(SERIALIZED_NAME_INVOICE_CURRENCY) + private String invoiceCurrency; + + public static final String SERIALIZED_NAME_ALIASES = "aliases"; + @SerializedName(SERIALIZED_NAME_ALIASES) + private List aliases = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SETTINGS = "settings"; + @SerializedName(SERIALIZED_NAME_SETTINGS) + private List settings = new ArrayList<>(); + + public CreateAccountRequestWithoutCustomerId() { + } + + public CreateAccountRequestWithoutCustomerId id(String id) { + + this.id = id; + return this; + } + + /** + * Identifier of the account + * @return id + **/ + @javax.annotation.Nonnull + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CreateAccountRequestWithoutCustomerId name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the Account + * @return name + **/ + @javax.annotation.Nonnull + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public CreateAccountRequestWithoutCustomerId invoiceCurrency(String invoiceCurrency) { + + this.invoiceCurrency = invoiceCurrency; + return this; + } + + /** + * Use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in which the account must be invoiced. For example: AED is the currency code for United Arab Emirates dirham. + * @return invoiceCurrency + **/ + @javax.annotation.Nullable + + public String getInvoiceCurrency() { + return invoiceCurrency; + } + + + public void setInvoiceCurrency(String invoiceCurrency) { + this.invoiceCurrency = invoiceCurrency; + } + + + public CreateAccountRequestWithoutCustomerId aliases(List aliases) { + + this.aliases = aliases; + return this; + } + + public CreateAccountRequestWithoutCustomerId addAliasesItem(String aliasesItem) { + if (this.aliases == null) { + this.aliases = new ArrayList<>(); + } + this.aliases.add(aliasesItem); + return this; + } + + /** + * Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account. + * @return aliases + **/ + @javax.annotation.Nullable + + public List getAliases() { + return aliases; + } + + + public void setAliases(List aliases) { + this.aliases = aliases; + } + + + public CreateAccountRequestWithoutCustomerId settings(List settings) { + + this.settings = settings; + return this; + } + + public CreateAccountRequestWithoutCustomerId addSettingsItem(CreateEntitySetting settingsItem) { + if (this.settings == null) { + this.settings = new ArrayList<>(); + } + this.settings.add(settingsItem); + return this; + } + + /** + * Get settings + * @return settings + **/ + @javax.annotation.Nullable + + public List getSettings() { + return settings; + } + + + public void setSettings(List settings) { + this.settings = settings; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAccountRequestWithoutCustomerId createAccountRequestWithoutCustomerId = (CreateAccountRequestWithoutCustomerId) o; + return Objects.equals(this.id, createAccountRequestWithoutCustomerId.id) && + Objects.equals(this.name, createAccountRequestWithoutCustomerId.name) && + Objects.equals(this.invoiceCurrency, createAccountRequestWithoutCustomerId.invoiceCurrency) && + Objects.equals(this.aliases, createAccountRequestWithoutCustomerId.aliases) && + Objects.equals(this.settings, createAccountRequestWithoutCustomerId.settings); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, invoiceCurrency, aliases, settings); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateAccountRequestWithoutCustomerId {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" invoiceCurrency: ").append(toIndentedString(invoiceCurrency)).append("\n"); + sb.append(" aliases: ").append(toIndentedString(aliases)).append("\n"); + sb.append(" settings: ").append(toIndentedString(settings)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("invoiceCurrency"); + openapiFields.add("aliases"); + openapiFields.add("settings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CreateAccountRequestWithoutCustomerId + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CreateAccountRequestWithoutCustomerId.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateAccountRequestWithoutCustomerId is not found in the empty JSON string", CreateAccountRequestWithoutCustomerId.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CreateAccountRequestWithoutCustomerId.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAccountRequestWithoutCustomerId` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateAccountRequestWithoutCustomerId.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("invoiceCurrency") != null && !jsonObj.get("invoiceCurrency").isJsonNull()) && !jsonObj.get("invoiceCurrency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `invoiceCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("invoiceCurrency").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("aliases") != null && !jsonObj.get("aliases").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `aliases` to be an array in the JSON string but got `%s`", jsonObj.get("aliases").toString())); + } + if (jsonObj.get("settings") != null && !jsonObj.get("settings").isJsonNull()) { + JsonArray jsonArraysettings = jsonObj.getAsJsonArray("settings"); + if (jsonArraysettings != null) { + // ensure the json data is an array + if (!jsonObj.get("settings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `settings` to be an array in the JSON string but got `%s`", jsonObj.get("settings").toString())); + } + + // validate the optional field `settings` (array) + for (int i = 0; i < jsonArraysettings.size(); i++) { + CreateEntitySetting.validateJsonObject(jsonArraysettings.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAccountRequestWithoutCustomerId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAccountRequestWithoutCustomerId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateAccountRequestWithoutCustomerId.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAccountRequestWithoutCustomerId value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateAccountRequestWithoutCustomerId read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateAccountRequestWithoutCustomerId given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAccountRequestWithoutCustomerId + * @throws IOException if the JSON string is invalid with respect to CreateAccountRequestWithoutCustomerId + */ + public static CreateAccountRequestWithoutCustomerId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAccountRequestWithoutCustomerId.class); + } + + /** + * Convert an instance of CreateAccountRequestWithoutCustomerId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/CreateAddOnRequest.java b/src/main/java/com/togai/client/models/CreateAddOnRequest.java index 5235831..371acb3 100644 --- a/src/main/java/com/togai/client/models/CreateAddOnRequest.java +++ b/src/main/java/com/togai/client/models/CreateAddOnRequest.java @@ -55,57 +55,6 @@ public class CreateAddOnRequest implements Serializable { @SerializedName(SERIALIZED_NAME_NAME) private String name; - /** - * Type of addon - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - ONE_TIME("ONE_TIME"), - - RECURRING("RECURRING"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - public CreateAddOnRequest() { } @@ -131,28 +80,6 @@ public void setName(String name) { } - public CreateAddOnRequest type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Type of addon - * @return type - **/ - @javax.annotation.Nonnull - - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - @Override public boolean equals(Object o) { @@ -163,13 +90,12 @@ public boolean equals(Object o) { return false; } CreateAddOnRequest createAddOnRequest = (CreateAddOnRequest) o; - return Objects.equals(this.name, createAddOnRequest.name) && - Objects.equals(this.type, createAddOnRequest.type); + return Objects.equals(this.name, createAddOnRequest.name); } @Override public int hashCode() { - return Objects.hash(name, type); + return Objects.hash(name); } @Override @@ -177,7 +103,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateAddOnRequest {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -201,12 +126,10 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("name"); - openapiFields.add("type"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("name"); - openapiRequiredFields.add("type"); } /** @@ -239,9 +162,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - if (!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/CreateCreditRequest.java b/src/main/java/com/togai/client/models/CreateCreditRequest.java index e5b1c39..dece806 100644 --- a/src/main/java/com/togai/client/models/CreateCreditRequest.java +++ b/src/main/java/com/togai/client/models/CreateCreditRequest.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.math.BigDecimal; import java.time.LocalDate; +import java.util.LinkedHashSet; +import java.util.Set; import java.io.Serializable; import com.google.gson.Gson; @@ -61,6 +63,10 @@ public class CreateCreditRequest implements Serializable { @SerializedName(SERIALIZED_NAME_PURPOSE) private String purpose; + public static final String SERIALIZED_NAME_APPLICABLE_ENTITY_IDS = "applicableEntityIds"; + @SerializedName(SERIALIZED_NAME_APPLICABLE_ENTITY_IDS) + private Set applicableEntityIds = new LinkedHashSet<>(); + public static final String SERIALIZED_NAME_EFFECTIVE_FROM = "effectiveFrom"; @SerializedName(SERIALIZED_NAME_EFFECTIVE_FROM) private LocalDate effectiveFrom; @@ -124,6 +130,36 @@ public void setPurpose(String purpose) { } + public CreateCreditRequest applicableEntityIds(Set applicableEntityIds) { + + this.applicableEntityIds = applicableEntityIds; + return this; + } + + public CreateCreditRequest addApplicableEntityIdsItem(String applicableEntityIdsItem) { + if (this.applicableEntityIds == null) { + this.applicableEntityIds = new LinkedHashSet<>(); + } + this.applicableEntityIds.add(applicableEntityIdsItem); + return this; + } + + /** + * List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards + * @return applicableEntityIds + **/ + @javax.annotation.Nullable + + public Set getApplicableEntityIds() { + return applicableEntityIds; + } + + + public void setApplicableEntityIds(Set applicableEntityIds) { + this.applicableEntityIds = applicableEntityIds; + } + + public CreateCreditRequest effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; @@ -224,6 +260,7 @@ public boolean equals(Object o) { CreateCreditRequest createCreditRequest = (CreateCreditRequest) o; return Objects.equals(this.accountId, createCreditRequest.accountId) && Objects.equals(this.purpose, createCreditRequest.purpose) && + Objects.equals(this.applicableEntityIds, createCreditRequest.applicableEntityIds) && Objects.equals(this.effectiveFrom, createCreditRequest.effectiveFrom) && Objects.equals(this.effectiveUntil, createCreditRequest.effectiveUntil) && Objects.equals(this.creditAmount, createCreditRequest.creditAmount) && @@ -232,7 +269,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountId, purpose, effectiveFrom, effectiveUntil, creditAmount, priority); + return Objects.hash(accountId, purpose, applicableEntityIds, effectiveFrom, effectiveUntil, creditAmount, priority); } @Override @@ -241,6 +278,7 @@ public String toString() { sb.append("class CreateCreditRequest {\n"); sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); + sb.append(" applicableEntityIds: ").append(toIndentedString(applicableEntityIds)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" effectiveUntil: ").append(toIndentedString(effectiveUntil)).append("\n"); sb.append(" creditAmount: ").append(toIndentedString(creditAmount)).append("\n"); @@ -269,6 +307,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountId"); openapiFields.add("purpose"); + openapiFields.add("applicableEntityIds"); openapiFields.add("effectiveFrom"); openapiFields.add("effectiveUntil"); openapiFields.add("creditAmount"); @@ -316,6 +355,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("purpose").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("applicableEntityIds") != null && !jsonObj.get("applicableEntityIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `applicableEntityIds` to be an array in the JSON string but got `%s`", jsonObj.get("applicableEntityIds").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/CreateCustomerRequest.java b/src/main/java/com/togai/client/models/CreateCustomerRequest.java index 896638d..6825170 100644 --- a/src/main/java/com/togai/client/models/CreateCustomerRequest.java +++ b/src/main/java/com/togai/client/models/CreateCustomerRequest.java @@ -20,7 +20,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.togai.client.models.CreateAccountRequest; +import com.togai.client.models.CreateAccountRequestWithoutCustomerId; import com.togai.client.models.CreateEntitySetting; import java.io.IOException; import java.util.ArrayList; @@ -77,7 +77,7 @@ public class CreateCustomerRequest implements Serializable { public static final String SERIALIZED_NAME_ACCOUNT = "account"; @SerializedName(SERIALIZED_NAME_ACCOUNT) - private CreateAccountRequest account; + private CreateAccountRequestWithoutCustomerId account; public CreateCustomerRequest() { } @@ -200,7 +200,7 @@ public void setSettings(List settings) { } - public CreateCustomerRequest account(CreateAccountRequest account) { + public CreateCustomerRequest account(CreateAccountRequestWithoutCustomerId account) { this.account = account; return this; @@ -212,12 +212,12 @@ public CreateCustomerRequest account(CreateAccountRequest account) { **/ @javax.annotation.Nullable - public CreateAccountRequest getAccount() { + public CreateAccountRequestWithoutCustomerId getAccount() { return account; } - public void setAccount(CreateAccountRequest account) { + public void setAccount(CreateAccountRequestWithoutCustomerId account) { this.account = account; } @@ -347,7 +347,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `account` if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonNull()) { - CreateAccountRequest.validateJsonObject(jsonObj.getAsJsonObject("account")); + CreateAccountRequestWithoutCustomerId.validateJsonObject(jsonObj.getAsJsonObject("account")); } } diff --git a/src/main/java/com/togai/client/models/CreateUsageMeterRequest.java b/src/main/java/com/togai/client/models/CreateUsageMeterRequest.java index 2e905c9..fbd2d5e 100644 --- a/src/main/java/com/togai/client/models/CreateUsageMeterRequest.java +++ b/src/main/java/com/togai/client/models/CreateUsageMeterRequest.java @@ -166,6 +166,10 @@ public AggregationEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_COMPUTATIONS) private List computations = new ArrayList<>(); + public static final String SERIALIZED_NAME_EVENT_SCHEMA_NAME = "eventSchemaName"; + @SerializedName(SERIALIZED_NAME_EVENT_SCHEMA_NAME) + private String eventSchemaName; + public CreateUsageMeterRequest() { } @@ -287,6 +291,28 @@ public void setComputations(List computations) { } + public CreateUsageMeterRequest eventSchemaName(String eventSchemaName) { + + this.eventSchemaName = eventSchemaName; + return this; + } + + /** + * Event Schema Identifier + * @return eventSchemaName + **/ + @javax.annotation.Nonnull + + public String getEventSchemaName() { + return eventSchemaName; + } + + + public void setEventSchemaName(String eventSchemaName) { + this.eventSchemaName = eventSchemaName; + } + + @Override public boolean equals(Object o) { @@ -301,12 +327,13 @@ public boolean equals(Object o) { Objects.equals(this.description, createUsageMeterRequest.description) && Objects.equals(this.type, createUsageMeterRequest.type) && Objects.equals(this.aggregation, createUsageMeterRequest.aggregation) && - Objects.equals(this.computations, createUsageMeterRequest.computations); + Objects.equals(this.computations, createUsageMeterRequest.computations) && + Objects.equals(this.eventSchemaName, createUsageMeterRequest.eventSchemaName); } @Override public int hashCode() { - return Objects.hash(name, description, type, aggregation, computations); + return Objects.hash(name, description, type, aggregation, computations, eventSchemaName); } @Override @@ -318,6 +345,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" aggregation: ").append(toIndentedString(aggregation)).append("\n"); sb.append(" computations: ").append(toIndentedString(computations)).append("\n"); + sb.append(" eventSchemaName: ").append(toIndentedString(eventSchemaName)).append("\n"); sb.append("}"); return sb.toString(); } @@ -345,12 +373,14 @@ private String toIndentedString(Object o) { openapiFields.add("type"); openapiFields.add("aggregation"); openapiFields.add("computations"); + openapiFields.add("eventSchemaName"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); openapiRequiredFields.add("name"); openapiRequiredFields.add("type"); openapiRequiredFields.add("aggregation"); + openapiRequiredFields.add("eventSchemaName"); } /** @@ -406,6 +436,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { }; } } + if (!jsonObj.get("eventSchemaName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eventSchemaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventSchemaName").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/Credit.java b/src/main/java/com/togai/client/models/Credit.java index 46a6c3d..ecf604b 100644 --- a/src/main/java/com/togai/client/models/Credit.java +++ b/src/main/java/com/togai/client/models/Credit.java @@ -24,6 +24,8 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.LinkedHashSet; +import java.util.Set; import java.io.Serializable; import com.google.gson.Gson; @@ -62,6 +64,10 @@ public class Credit implements Serializable { @SerializedName(SERIALIZED_NAME_PURPOSE) private String purpose; + public static final String SERIALIZED_NAME_APPLICABLE_ENTITY_IDS = "applicableEntityIds"; + @SerializedName(SERIALIZED_NAME_APPLICABLE_ENTITY_IDS) + private Set applicableEntityIds = new LinkedHashSet<>(); + public static final String SERIALIZED_NAME_EFFECTIVE_FROM = "effectiveFrom"; @SerializedName(SERIALIZED_NAME_EFFECTIVE_FROM) private LocalDate effectiveFrom; @@ -208,6 +214,36 @@ public void setPurpose(String purpose) { } + public Credit applicableEntityIds(Set applicableEntityIds) { + + this.applicableEntityIds = applicableEntityIds; + return this; + } + + public Credit addApplicableEntityIdsItem(String applicableEntityIdsItem) { + if (this.applicableEntityIds == null) { + this.applicableEntityIds = new LinkedHashSet<>(); + } + this.applicableEntityIds.add(applicableEntityIdsItem); + return this; + } + + /** + * List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards + * @return applicableEntityIds + **/ + @javax.annotation.Nullable + + public Set getApplicableEntityIds() { + return applicableEntityIds; + } + + + public void setApplicableEntityIds(Set applicableEntityIds) { + this.applicableEntityIds = applicableEntityIds; + } + + public Credit effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; @@ -484,6 +520,7 @@ public boolean equals(Object o) { Credit credit = (Credit) o; return Objects.equals(this.accountId, credit.accountId) && Objects.equals(this.purpose, credit.purpose) && + Objects.equals(this.applicableEntityIds, credit.applicableEntityIds) && Objects.equals(this.effectiveFrom, credit.effectiveFrom) && Objects.equals(this.effectiveUntil, credit.effectiveUntil) && Objects.equals(this.creditAmount, credit.creditAmount) && @@ -500,7 +537,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountId, purpose, effectiveFrom, effectiveUntil, creditAmount, priority, id, customerId, status, creditUnit, holdAmount, consumedAmount, createdAt, updatedAt); + return Objects.hash(accountId, purpose, applicableEntityIds, effectiveFrom, effectiveUntil, creditAmount, priority, id, customerId, status, creditUnit, holdAmount, consumedAmount, createdAt, updatedAt); } @Override @@ -509,6 +546,7 @@ public String toString() { sb.append("class Credit {\n"); sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); + sb.append(" applicableEntityIds: ").append(toIndentedString(applicableEntityIds)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" effectiveUntil: ").append(toIndentedString(effectiveUntil)).append("\n"); sb.append(" creditAmount: ").append(toIndentedString(creditAmount)).append("\n"); @@ -545,6 +583,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountId"); openapiFields.add("purpose"); + openapiFields.add("applicableEntityIds"); openapiFields.add("effectiveFrom"); openapiFields.add("effectiveUntil"); openapiFields.add("creditAmount"); @@ -604,6 +643,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("purpose").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("applicableEntityIds") != null && !jsonObj.get("applicableEntityIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `applicableEntityIds` to be an array in the JSON string but got `%s`", jsonObj.get("applicableEntityIds").toString())); + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } diff --git a/src/main/java/com/togai/client/models/CreditDetailsResponse.java b/src/main/java/com/togai/client/models/CreditDetailsResponse.java index 21b4428..86ba519 100644 --- a/src/main/java/com/togai/client/models/CreditDetailsResponse.java +++ b/src/main/java/com/togai/client/models/CreditDetailsResponse.java @@ -26,7 +26,9 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.io.Serializable; import com.google.gson.Gson; @@ -65,6 +67,10 @@ public class CreditDetailsResponse implements Serializable { @SerializedName(SERIALIZED_NAME_PURPOSE) private String purpose; + public static final String SERIALIZED_NAME_APPLICABLE_ENTITY_IDS = "applicableEntityIds"; + @SerializedName(SERIALIZED_NAME_APPLICABLE_ENTITY_IDS) + private Set applicableEntityIds = new LinkedHashSet<>(); + public static final String SERIALIZED_NAME_EFFECTIVE_FROM = "effectiveFrom"; @SerializedName(SERIALIZED_NAME_EFFECTIVE_FROM) private LocalDate effectiveFrom; @@ -215,6 +221,36 @@ public void setPurpose(String purpose) { } + public CreditDetailsResponse applicableEntityIds(Set applicableEntityIds) { + + this.applicableEntityIds = applicableEntityIds; + return this; + } + + public CreditDetailsResponse addApplicableEntityIdsItem(String applicableEntityIdsItem) { + if (this.applicableEntityIds == null) { + this.applicableEntityIds = new LinkedHashSet<>(); + } + this.applicableEntityIds.add(applicableEntityIdsItem); + return this; + } + + /** + * List of entity ids for which the credit is applicable. If null or empty, the credit is applicable to all ids. This list can accept special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To apply the credit to all fixed fee rate cards + * @return applicableEntityIds + **/ + @javax.annotation.Nullable + + public Set getApplicableEntityIds() { + return applicableEntityIds; + } + + + public void setApplicableEntityIds(Set applicableEntityIds) { + this.applicableEntityIds = applicableEntityIds; + } + + public CreditDetailsResponse effectiveFrom(LocalDate effectiveFrom) { this.effectiveFrom = effectiveFrom; @@ -518,6 +554,7 @@ public boolean equals(Object o) { CreditDetailsResponse creditDetailsResponse = (CreditDetailsResponse) o; return Objects.equals(this.accountId, creditDetailsResponse.accountId) && Objects.equals(this.purpose, creditDetailsResponse.purpose) && + Objects.equals(this.applicableEntityIds, creditDetailsResponse.applicableEntityIds) && Objects.equals(this.effectiveFrom, creditDetailsResponse.effectiveFrom) && Objects.equals(this.effectiveUntil, creditDetailsResponse.effectiveUntil) && Objects.equals(this.creditAmount, creditDetailsResponse.creditAmount) && @@ -535,7 +572,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountId, purpose, effectiveFrom, effectiveUntil, creditAmount, priority, id, customerId, status, creditUnit, holdAmount, consumedAmount, createdAt, updatedAt, transactions); + return Objects.hash(accountId, purpose, applicableEntityIds, effectiveFrom, effectiveUntil, creditAmount, priority, id, customerId, status, creditUnit, holdAmount, consumedAmount, createdAt, updatedAt, transactions); } @Override @@ -544,6 +581,7 @@ public String toString() { sb.append("class CreditDetailsResponse {\n"); sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" purpose: ").append(toIndentedString(purpose)).append("\n"); + sb.append(" applicableEntityIds: ").append(toIndentedString(applicableEntityIds)).append("\n"); sb.append(" effectiveFrom: ").append(toIndentedString(effectiveFrom)).append("\n"); sb.append(" effectiveUntil: ").append(toIndentedString(effectiveUntil)).append("\n"); sb.append(" creditAmount: ").append(toIndentedString(creditAmount)).append("\n"); @@ -581,6 +619,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountId"); openapiFields.add("purpose"); + openapiFields.add("applicableEntityIds"); openapiFields.add("effectiveFrom"); openapiFields.add("effectiveUntil"); openapiFields.add("creditAmount"); @@ -642,6 +681,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("purpose").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `purpose` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purpose").toString())); } + // ensure the optional json data is an array if present + if (jsonObj.get("applicableEntityIds") != null && !jsonObj.get("applicableEntityIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `applicableEntityIds` to be an array in the JSON string but got `%s`", jsonObj.get("applicableEntityIds").toString())); + } if (!jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } diff --git a/src/main/java/com/togai/client/models/EditPricingScheduleRequest.java b/src/main/java/com/togai/client/models/EditPricingScheduleRequest.java new file mode 100644 index 0000000..db0aad8 --- /dev/null +++ b/src/main/java/com/togai/client/models/EditPricingScheduleRequest.java @@ -0,0 +1,231 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.UpdatePricingScheduleRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Request to dis/associate one or more schedules to an account + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EditPricingScheduleRequest implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_EDITS = "edits"; + @SerializedName(SERIALIZED_NAME_EDITS) + private List edits = new ArrayList<>(); + + public EditPricingScheduleRequest() { + } + + public EditPricingScheduleRequest edits(List edits) { + + this.edits = edits; + return this; + } + + public EditPricingScheduleRequest addEditsItem(UpdatePricingScheduleRequest editsItem) { + this.edits.add(editsItem); + return this; + } + + /** + * Get edits + * @return edits + **/ + @javax.annotation.Nonnull + + public List getEdits() { + return edits; + } + + + public void setEdits(List edits) { + this.edits = edits; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EditPricingScheduleRequest editPricingScheduleRequest = (EditPricingScheduleRequest) o; + return Objects.equals(this.edits, editPricingScheduleRequest.edits); + } + + @Override + public int hashCode() { + return Objects.hash(edits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EditPricingScheduleRequest {\n"); + sb.append(" edits: ").append(toIndentedString(edits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("edits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("edits"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EditPricingScheduleRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EditPricingScheduleRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EditPricingScheduleRequest is not found in the empty JSON string", EditPricingScheduleRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EditPricingScheduleRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EditPricingScheduleRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EditPricingScheduleRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("edits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `edits` to be an array in the JSON string but got `%s`", jsonObj.get("edits").toString())); + } + + JsonArray jsonArrayedits = jsonObj.getAsJsonArray("edits"); + // validate the required field `edits` (array) + for (int i = 0; i < jsonArrayedits.size(); i++) { + UpdatePricingScheduleRequest.validateJsonObject(jsonArrayedits.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EditPricingScheduleRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EditPricingScheduleRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EditPricingScheduleRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EditPricingScheduleRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EditPricingScheduleRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EditPricingScheduleRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EditPricingScheduleRequest + * @throws IOException if the JSON string is invalid with respect to EditPricingScheduleRequest + */ + public static EditPricingScheduleRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EditPricingScheduleRequest.class); + } + + /** + * Convert an instance of EditPricingScheduleRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/EnrichmentDependency.java b/src/main/java/com/togai/client/models/EnrichmentDependency.java index ddf4692..af214e0 100644 --- a/src/main/java/com/togai/client/models/EnrichmentDependency.java +++ b/src/main/java/com/togai/client/models/EnrichmentDependency.java @@ -104,9 +104,9 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; - public static final String SERIALIZED_NAME_ALIAS = "alias"; - @SerializedName(SERIALIZED_NAME_ALIAS) - private String alias; + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) @@ -159,25 +159,25 @@ public void setType(TypeEnum type) { } - public EnrichmentDependency alias(String alias) { + public EnrichmentDependency name(String name) { - this.alias = alias; + this.name = name; return this; } /** - * Get alias - * @return alias + * Get name + * @return name **/ @javax.annotation.Nullable - public String getAlias() { - return alias; + public String getName() { + return name; } - public void setAlias(String alias) { - this.alias = alias; + public void setName(String name) { + this.name = name; } @@ -215,13 +215,13 @@ public boolean equals(Object o) { EnrichmentDependency enrichmentDependency = (EnrichmentDependency) o; return Objects.equals(this.key, enrichmentDependency.key) && Objects.equals(this.type, enrichmentDependency.type) && - Objects.equals(this.alias, enrichmentDependency.alias) && + Objects.equals(this.name, enrichmentDependency.name) && Objects.equals(this.value, enrichmentDependency.value); } @Override public int hashCode() { - return Objects.hash(key, type, alias, value); + return Objects.hash(key, type, name, value); } @Override @@ -230,7 +230,7 @@ public String toString() { sb.append("class EnrichmentDependency {\n"); sb.append(" key: ").append(toIndentedString(key)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append("}"); return sb.toString(); @@ -256,7 +256,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("key"); openapiFields.add("type"); - openapiFields.add("alias"); + openapiFields.add("name"); openapiFields.add("value"); // a set of required properties/fields (JSON key names) @@ -299,8 +299,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (!jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } - if ((jsonObj.get("alias") != null && !jsonObj.get("alias").isJsonNull()) && !jsonObj.get("alias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if (!jsonObj.get("value").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); diff --git a/src/main/java/com/togai/client/models/Event.java b/src/main/java/com/togai/client/models/Event.java index 4d84dc7..270e0e0 100644 --- a/src/main/java/com/togai/client/models/Event.java +++ b/src/main/java/com/togai/client/models/Event.java @@ -81,6 +81,10 @@ public class Event implements Serializable { @SerializedName(SERIALIZED_NAME_DIMENSIONS) private Map dimensions = new HashMap<>(); + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + public Event() { } @@ -226,6 +230,28 @@ public void setDimensions(Map dimensions) { } + public Event createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Created time stamp of the event. This timestamp must be in ISO 8601 format. + * @return createdAt + **/ + @javax.annotation.Nonnull + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + @Override public boolean equals(Object o) { @@ -241,12 +267,13 @@ public boolean equals(Object o) { Objects.equals(this.timestamp, event.timestamp) && Objects.equals(this.accountId, event.accountId) && Objects.equals(this.attributes, event.attributes) && - Objects.equals(this.dimensions, event.dimensions); + Objects.equals(this.dimensions, event.dimensions) && + Objects.equals(this.createdAt, event.createdAt); } @Override public int hashCode() { - return Objects.hash(schemaName, id, timestamp, accountId, attributes, dimensions); + return Objects.hash(schemaName, id, timestamp, accountId, attributes, dimensions, createdAt); } @Override @@ -259,6 +286,7 @@ public String toString() { sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" dimensions: ").append(toIndentedString(dimensions)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -287,6 +315,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountId"); openapiFields.add("attributes"); openapiFields.add("dimensions"); + openapiFields.add("createdAt"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -296,6 +325,7 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountId"); openapiRequiredFields.add("attributes"); openapiRequiredFields.add("dimensions"); + openapiRequiredFields.add("createdAt"); } /** diff --git a/src/main/java/com/togai/client/models/EventSource.java b/src/main/java/com/togai/client/models/EventSource.java new file mode 100644 index 0000000..c422e07 --- /dev/null +++ b/src/main/java/com/togai/client/models/EventSource.java @@ -0,0 +1,249 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Source of ingestion of event + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventSource implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public EventSource() { + } + + public EventSource id(String id) { + + this.id = id; + return this; + } + + /** + * Unique identifier representing the source + * @return id + **/ + @javax.annotation.Nonnull + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public EventSource type(String type) { + + this.type = type; + return this; + } + + /** + * Type of source + * @return type + **/ + @javax.annotation.Nonnull + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSource eventSource = (EventSource) o; + return Objects.equals(this.id, eventSource.id) && + Objects.equals(this.type, eventSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EventSource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!EventSource.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EventSource is not found in the empty JSON string", EventSource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EventSource.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EventSource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSource.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventSource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventSource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSource + * @throws IOException if the JSON string is invalid with respect to EventSource + */ + public static EventSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSource.class); + } + + /** + * Convert an instance of EventSource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/EventWithStatus.java b/src/main/java/com/togai/client/models/EventWithStatus.java index 987157f..8fbd8e4 100644 --- a/src/main/java/com/togai/client/models/EventWithStatus.java +++ b/src/main/java/com/togai/client/models/EventWithStatus.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.togai.client.models.Event; +import com.togai.client.models.EventSource; import com.togai.client.models.IngestionStatus; import java.io.IOException; import java.io.Serializable; @@ -65,6 +66,10 @@ public class EventWithStatus implements Serializable { @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) private String customerId; + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private EventSource source; + public EventWithStatus() { } @@ -134,6 +139,28 @@ public void setCustomerId(String customerId) { } + public EventWithStatus source(EventSource source) { + + this.source = source; + return this; + } + + /** + * Get source + * @return source + **/ + @javax.annotation.Nullable + + public EventSource getSource() { + return source; + } + + + public void setSource(EventSource source) { + this.source = source; + } + + @Override public boolean equals(Object o) { @@ -146,12 +173,13 @@ public boolean equals(Object o) { EventWithStatus eventWithStatus = (EventWithStatus) o; return Objects.equals(this.eventPayload, eventWithStatus.eventPayload) && Objects.equals(this.ingestionStatus, eventWithStatus.ingestionStatus) && - Objects.equals(this.customerId, eventWithStatus.customerId); + Objects.equals(this.customerId, eventWithStatus.customerId) && + Objects.equals(this.source, eventWithStatus.source); } @Override public int hashCode() { - return Objects.hash(eventPayload, ingestionStatus, customerId); + return Objects.hash(eventPayload, ingestionStatus, customerId, source); } @Override @@ -161,6 +189,7 @@ public String toString() { sb.append(" eventPayload: ").append(toIndentedString(eventPayload)).append("\n"); sb.append(" ingestionStatus: ").append(toIndentedString(ingestionStatus)).append("\n"); sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append("}"); return sb.toString(); } @@ -186,6 +215,7 @@ private String toIndentedString(Object o) { openapiFields.add("eventPayload"); openapiFields.add("ingestionStatus"); openapiFields.add("customerId"); + openapiFields.add("source"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -227,6 +257,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("customerId") != null && !jsonObj.get("customerId").isJsonNull()) && !jsonObj.get("customerId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerId").toString())); } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + EventSource.validateJsonObject(jsonObj.getAsJsonObject("source")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfo.java b/src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfo.java index 6e29171..63281b8 100644 --- a/src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfo.java +++ b/src/main/java/com/togai/client/models/EventWithStatusAndEventPipelineInfo.java @@ -22,6 +22,7 @@ import com.google.gson.stream.JsonWriter; import com.togai.client.models.Event; import com.togai.client.models.EventPipelineInfo; +import com.togai.client.models.EventSource; import com.togai.client.models.IngestionStatus; import java.io.IOException; import java.io.Serializable; @@ -66,6 +67,10 @@ public class EventWithStatusAndEventPipelineInfo implements Serializable { @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) private String customerId; + public static final String SERIALIZED_NAME_SOURCE = "source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + private EventSource source; + public static final String SERIALIZED_NAME_EVENT_PIPELINE_INFO = "EventPipelineInfo"; @SerializedName(SERIALIZED_NAME_EVENT_PIPELINE_INFO) private EventPipelineInfo eventPipelineInfo; @@ -139,6 +144,28 @@ public void setCustomerId(String customerId) { } + public EventWithStatusAndEventPipelineInfo source(EventSource source) { + + this.source = source; + return this; + } + + /** + * Get source + * @return source + **/ + @javax.annotation.Nullable + + public EventSource getSource() { + return source; + } + + + public void setSource(EventSource source) { + this.source = source; + } + + public EventWithStatusAndEventPipelineInfo eventPipelineInfo(EventPipelineInfo eventPipelineInfo) { this.eventPipelineInfo = eventPipelineInfo; @@ -174,12 +201,13 @@ public boolean equals(Object o) { return Objects.equals(this.eventPayload, eventWithStatusAndEventPipelineInfo.eventPayload) && Objects.equals(this.ingestionStatus, eventWithStatusAndEventPipelineInfo.ingestionStatus) && Objects.equals(this.customerId, eventWithStatusAndEventPipelineInfo.customerId) && + Objects.equals(this.source, eventWithStatusAndEventPipelineInfo.source) && Objects.equals(this.eventPipelineInfo, eventWithStatusAndEventPipelineInfo.eventPipelineInfo); } @Override public int hashCode() { - return Objects.hash(eventPayload, ingestionStatus, customerId, eventPipelineInfo); + return Objects.hash(eventPayload, ingestionStatus, customerId, source, eventPipelineInfo); } @Override @@ -189,6 +217,7 @@ public String toString() { sb.append(" eventPayload: ").append(toIndentedString(eventPayload)).append("\n"); sb.append(" ingestionStatus: ").append(toIndentedString(ingestionStatus)).append("\n"); sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" eventPipelineInfo: ").append(toIndentedString(eventPipelineInfo)).append("\n"); sb.append("}"); return sb.toString(); @@ -215,6 +244,7 @@ private String toIndentedString(Object o) { openapiFields.add("eventPayload"); openapiFields.add("ingestionStatus"); openapiFields.add("customerId"); + openapiFields.add("source"); openapiFields.add("EventPipelineInfo"); // a set of required properties/fields (JSON key names) @@ -257,6 +287,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if ((jsonObj.get("customerId") != null && !jsonObj.get("customerId").isJsonNull()) && !jsonObj.get("customerId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerId").toString())); } + // validate the optional field `source` + if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonNull()) { + EventSource.validateJsonObject(jsonObj.getAsJsonObject("source")); + } // validate the optional field `EventPipelineInfo` if (jsonObj.get("EventPipelineInfo") != null && !jsonObj.get("EventPipelineInfo").isJsonNull()) { EventPipelineInfo.validateJsonObject(jsonObj.getAsJsonObject("EventPipelineInfo")); diff --git a/src/main/java/com/togai/client/models/Field.java b/src/main/java/com/togai/client/models/Field.java index 573c92f..1f8e7e1 100644 --- a/src/main/java/com/togai/client/models/Field.java +++ b/src/main/java/com/togai/client/models/Field.java @@ -113,7 +113,9 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public enum EnrichmentTypeEnum { VALUE("VALUE"), - JSON_LOGIC("JSON_LOGIC"); + JSON_LOGIC("JSON_LOGIC"), + + JSON_LOGIC_FROM_DEPENDENCY("JSON_LOGIC_FROM_DEPENDENCY"); private String value; diff --git a/src/main/java/com/togai/client/models/FixedFeeRateCard.java b/src/main/java/com/togai/client/models/FixedFeeRateCard.java index e1e72a3..32df300 100644 --- a/src/main/java/com/togai/client/models/FixedFeeRateCard.java +++ b/src/main/java/com/togai/client/models/FixedFeeRateCard.java @@ -21,6 +21,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.togai.client.models.CurrencyRateValue; +import com.togai.client.models.FixedFeeType; import com.togai.client.models.InvoiceTiming; import java.io.IOException; import java.util.ArrayList; @@ -67,6 +68,10 @@ public class FixedFeeRateCard implements Serializable { @SerializedName(SERIALIZED_NAME_INVOICE_TIMING) private InvoiceTiming invoiceTiming; + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private FixedFeeType type = FixedFeeType.RECURRING; + public static final String SERIALIZED_NAME_RATE_VALUES = "rateValues"; @SerializedName(SERIALIZED_NAME_RATE_VALUES) private List rateValues = new ArrayList<>(); @@ -81,7 +86,7 @@ public FixedFeeRateCard id(String id) { } /** - * Auto generated unique identifier for fixed fees. + * Unique Identifier of the attached AddOn * @return id **/ @javax.annotation.Nonnull @@ -103,7 +108,7 @@ public FixedFeeRateCard displayName(String displayName) { } /** - * Name of the fixed fee. + * Name of the attached AddOn * @return displayName **/ @javax.annotation.Nullable @@ -140,6 +145,28 @@ public void setInvoiceTiming(InvoiceTiming invoiceTiming) { } + public FixedFeeRateCard type(FixedFeeType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + + public FixedFeeType getType() { + return type; + } + + + public void setType(FixedFeeType type) { + this.type = type; + } + + public FixedFeeRateCard rateValues(List rateValues) { this.rateValues = rateValues; @@ -180,12 +207,13 @@ public boolean equals(Object o) { return Objects.equals(this.id, fixedFeeRateCard.id) && Objects.equals(this.displayName, fixedFeeRateCard.displayName) && Objects.equals(this.invoiceTiming, fixedFeeRateCard.invoiceTiming) && + Objects.equals(this.type, fixedFeeRateCard.type) && Objects.equals(this.rateValues, fixedFeeRateCard.rateValues); } @Override public int hashCode() { - return Objects.hash(id, displayName, invoiceTiming, rateValues); + return Objects.hash(id, displayName, invoiceTiming, type, rateValues); } @Override @@ -195,6 +223,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" invoiceTiming: ").append(toIndentedString(invoiceTiming)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" rateValues: ").append(toIndentedString(rateValues)).append("\n"); sb.append("}"); return sb.toString(); @@ -221,6 +250,7 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("displayName"); openapiFields.add("invoiceTiming"); + openapiFields.add("type"); openapiFields.add("rateValues"); // a set of required properties/fields (JSON key names) diff --git a/src/main/java/com/togai/client/models/FixedFeeType.java b/src/main/java/com/togai/client/models/FixedFeeType.java new file mode 100644 index 0000000..d504082 --- /dev/null +++ b/src/main/java/com/togai/client/models/FixedFeeType.java @@ -0,0 +1,74 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.annotations.SerializedName; +import java.io.Serializable; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Fixed fee applies either for a one-time occurrence or for each cycle. + */ +@JsonAdapter(FixedFeeType.Adapter.class) +public enum FixedFeeType { + + ONE_TIME("ONE_TIME"), + + RECURRING("RECURRING"); + + private String value; + + FixedFeeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FixedFeeType fromValue(String value) { + for (FixedFeeType b : FixedFeeType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FixedFeeType enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FixedFeeType read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FixedFeeType.fromValue(value); + } + } +} + diff --git a/src/main/java/com/togai/client/models/IngestBatchEventResponse.java b/src/main/java/com/togai/client/models/IngestBatchEventResponse.java index 148eef0..31d3dde 100644 --- a/src/main/java/com/togai/client/models/IngestBatchEventResponse.java +++ b/src/main/java/com/togai/client/models/IngestBatchEventResponse.java @@ -20,10 +20,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.togai.client.models.IngestError; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import java.io.Serializable; import com.google.gson.Gson; @@ -54,37 +51,162 @@ public class IngestBatchEventResponse implements Serializable { private static final long serialVersionUID = 1L; - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) - private List errors = new ArrayList<>(); + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private Object details; public IngestBatchEventResponse() { } - public IngestBatchEventResponse errors(List errors) { + public IngestBatchEventResponse success(Boolean success) { + + this.success = success; + return this; + } + + /** + * Get success + * @return success + **/ + @javax.annotation.Nullable + + public Boolean getSuccess() { + return success; + } + + + public void setSuccess(Boolean success) { + this.success = success; + } + + + public IngestBatchEventResponse statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * Get statusCode + * @return statusCode + **/ + @javax.annotation.Nullable + + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + + public IngestBatchEventResponse name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public IngestBatchEventResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public IngestBatchEventResponse code(String code) { - this.errors = errors; + this.code = code; return this; } - public IngestBatchEventResponse addErrorsItem(IngestError errorsItem) { - this.errors.add(errorsItem); + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public IngestBatchEventResponse details(Object details) { + + this.details = details; return this; } /** - * Get errors - * @return errors + * Get details + * @return details **/ - @javax.annotation.Nonnull + @javax.annotation.Nullable - public List getErrors() { - return errors; + public Object getDetails() { + return details; } - public void setErrors(List errors) { - this.errors = errors; + public void setDetails(Object details) { + this.details = details; } @@ -98,19 +220,29 @@ public boolean equals(Object o) { return false; } IngestBatchEventResponse ingestBatchEventResponse = (IngestBatchEventResponse) o; - return Objects.equals(this.errors, ingestBatchEventResponse.errors); + return Objects.equals(this.success, ingestBatchEventResponse.success) && + Objects.equals(this.statusCode, ingestBatchEventResponse.statusCode) && + Objects.equals(this.name, ingestBatchEventResponse.name) && + Objects.equals(this.message, ingestBatchEventResponse.message) && + Objects.equals(this.code, ingestBatchEventResponse.code) && + Objects.equals(this.details, ingestBatchEventResponse.details); } @Override public int hashCode() { - return Objects.hash(errors); + return Objects.hash(success, statusCode, name, message, code, details); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IngestBatchEventResponse {\n"); - sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); sb.append("}"); return sb.toString(); } @@ -133,11 +265,15 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("errors"); + openapiFields.add("success"); + openapiFields.add("statusCode"); + openapiFields.add("name"); + openapiFields.add("message"); + openapiFields.add("code"); + openapiFields.add("details"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("errors"); } /** @@ -160,23 +296,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IngestBatchEventResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IngestBatchEventResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } - // ensure the json data is an array - if (!jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); } - - JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("errors"); - // validate the required field `errors` (array) - for (int i = 0; i < jsonArrayerrors.size(); i++) { - IngestError.validateJsonObject(jsonArrayerrors.get(i).getAsJsonObject()); - }; } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/togai/client/models/IngestError.java b/src/main/java/com/togai/client/models/IngestError.java index cf8a35d..8e4dd50 100644 --- a/src/main/java/com/togai/client/models/IngestError.java +++ b/src/main/java/com/togai/client/models/IngestError.java @@ -20,8 +20,8 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.togai.client.models.Event; import java.io.IOException; +import java.math.BigDecimal; import java.io.Serializable; import com.google.gson.Gson; @@ -52,17 +52,69 @@ public class IngestError implements Serializable { private static final long serialVersionUID = 1L; + public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private BigDecimal statusCode; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; - public static final String SERIALIZED_NAME_EVENT_PAYLOAD = "eventPayload"; - @SerializedName(SERIALIZED_NAME_EVENT_PAYLOAD) - private Event eventPayload; + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; public IngestError() { } + public IngestError statusCode(BigDecimal statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * Get statusCode + * @return statusCode + **/ + @javax.annotation.Nullable + + public BigDecimal getStatusCode() { + return statusCode; + } + + + public void setStatusCode(BigDecimal statusCode) { + this.statusCode = statusCode; + } + + + public IngestError name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + public IngestError message(String message) { this.message = message; @@ -85,27 +137,71 @@ public void setMessage(String message) { } - public IngestError eventPayload(Event eventPayload) { + public IngestError code(String code) { - this.eventPayload = eventPayload; + this.code = code; return this; } /** - * Get eventPayload - * @return eventPayload + * Get code + * @return code **/ @javax.annotation.Nullable - public Event getEventPayload() { - return eventPayload; + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IngestError instance itself + */ + public IngestError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } - public void setEventPayload(Event eventPayload) { - this.eventPayload = eventPayload; + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } @Override @@ -117,21 +213,27 @@ public boolean equals(Object o) { return false; } IngestError ingestError = (IngestError) o; - return Objects.equals(this.message, ingestError.message) && - Objects.equals(this.eventPayload, ingestError.eventPayload); + return Objects.equals(this.statusCode, ingestError.statusCode) && + Objects.equals(this.name, ingestError.name) && + Objects.equals(this.message, ingestError.message) && + Objects.equals(this.code, ingestError.code)&& + Objects.equals(this.additionalProperties, ingestError.additionalProperties); } @Override public int hashCode() { - return Objects.hash(message, eventPayload); + return Objects.hash(statusCode, name, message, code, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IngestError {\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" eventPayload: ").append(toIndentedString(eventPayload)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } @@ -154,8 +256,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("statusCode"); + openapiFields.add("name"); openapiFields.add("message"); - openapiFields.add("eventPayload"); + openapiFields.add("code"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -173,20 +277,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field(s) %s in IngestError is not found in the empty JSON string", IngestError.openapiRequiredFields.toString())); } } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!IngestError.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IngestError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } - // validate the optional field `eventPayload` - if (jsonObj.get("eventPayload") != null && !jsonObj.get("eventPayload").isJsonNull()) { - Event.validateJsonObject(jsonObj.getAsJsonObject("eventPayload")); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); } } @@ -205,6 +303,23 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, IngestError value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject()); + } + } + } elementAdapter.write(out, obj); } @@ -212,7 +327,27 @@ public void write(JsonWriter out, IngestError value) throws IOException { public IngestError read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); + // store additional fields in the deserialized instance + IngestError instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; } }.nullSafe(); diff --git a/src/main/java/com/togai/client/models/IngestEventResponse.java b/src/main/java/com/togai/client/models/IngestEventResponse.java index ae31868..6666003 100644 --- a/src/main/java/com/togai/client/models/IngestEventResponse.java +++ b/src/main/java/com/togai/client/models/IngestEventResponse.java @@ -51,32 +51,162 @@ public class IngestEventResponse implements Serializable { private static final long serialVersionUID = 1L; - public static final String SERIALIZED_NAME_INGESTION_REQUEST_ID = "ingestionRequestId"; - @SerializedName(SERIALIZED_NAME_INGESTION_REQUEST_ID) - private String ingestionRequestId; + public static final String SERIALIZED_NAME_SUCCESS = "success"; + @SerializedName(SERIALIZED_NAME_SUCCESS) + private Boolean success; + + public static final String SERIALIZED_NAME_STATUS_CODE = "statusCode"; + @SerializedName(SERIALIZED_NAME_STATUS_CODE) + private Integer statusCode; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private Object details; public IngestEventResponse() { } - public IngestEventResponse ingestionRequestId(String ingestionRequestId) { + public IngestEventResponse success(Boolean success) { - this.ingestionRequestId = ingestionRequestId; + this.success = success; return this; } /** - * On successful ingestion acceptance request, ingestion request id will be returned. This ingestion id can be used by clients to query the status of ingestion (IN_PROGRESS, COMPLETED). - * @return ingestionRequestId + * Get success + * @return success **/ - @javax.annotation.Nonnull + @javax.annotation.Nullable - public String getIngestionRequestId() { - return ingestionRequestId; + public Boolean getSuccess() { + return success; } - public void setIngestionRequestId(String ingestionRequestId) { - this.ingestionRequestId = ingestionRequestId; + public void setSuccess(Boolean success) { + this.success = success; + } + + + public IngestEventResponse statusCode(Integer statusCode) { + + this.statusCode = statusCode; + return this; + } + + /** + * Get statusCode + * @return statusCode + **/ + @javax.annotation.Nullable + + public Integer getStatusCode() { + return statusCode; + } + + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + + public IngestEventResponse name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public IngestEventResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public IngestEventResponse code(String code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public IngestEventResponse details(Object details) { + + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nullable + + public Object getDetails() { + return details; + } + + + public void setDetails(Object details) { + this.details = details; } @@ -90,19 +220,29 @@ public boolean equals(Object o) { return false; } IngestEventResponse ingestEventResponse = (IngestEventResponse) o; - return Objects.equals(this.ingestionRequestId, ingestEventResponse.ingestionRequestId); + return Objects.equals(this.success, ingestEventResponse.success) && + Objects.equals(this.statusCode, ingestEventResponse.statusCode) && + Objects.equals(this.name, ingestEventResponse.name) && + Objects.equals(this.message, ingestEventResponse.message) && + Objects.equals(this.code, ingestEventResponse.code) && + Objects.equals(this.details, ingestEventResponse.details); } @Override public int hashCode() { - return Objects.hash(ingestionRequestId); + return Objects.hash(success, statusCode, name, message, code, details); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IngestEventResponse {\n"); - sb.append(" ingestionRequestId: ").append(toIndentedString(ingestionRequestId)).append("\n"); + sb.append(" success: ").append(toIndentedString(success)).append("\n"); + sb.append(" statusCode: ").append(toIndentedString(statusCode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); sb.append("}"); return sb.toString(); } @@ -125,11 +265,15 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("ingestionRequestId"); + openapiFields.add("success"); + openapiFields.add("statusCode"); + openapiFields.add("name"); + openapiFields.add("message"); + openapiFields.add("code"); + openapiFields.add("details"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("ingestionRequestId"); } /** @@ -152,15 +296,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IngestEventResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IngestEventResponse.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } - if (!jsonObj.get("ingestionRequestId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ingestionRequestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ingestionRequestId").toString())); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); } } diff --git a/src/main/java/com/togai/client/models/IngestionStatus.java b/src/main/java/com/togai/client/models/IngestionStatus.java index 1a98fed..8d640df 100644 --- a/src/main/java/com/togai/client/models/IngestionStatus.java +++ b/src/main/java/com/togai/client/models/IngestionStatus.java @@ -66,8 +66,6 @@ public enum StatusEnum { INGESTION_FAILED_UNITS_INVALID("INGESTION_FAILED_UNITS_INVALID"), - INGESTION_FAILED_EVENT_INVALID("INGESTION_FAILED_EVENT_INVALID"), - INGESTION_COMPLETED_NO_MATCHING_METERS("INGESTION_COMPLETED_NO_MATCHING_METERS"), INGESTION_COMPLETED_EVENT_METERED("INGESTION_COMPLETED_EVENT_METERED"), diff --git a/src/main/java/com/togai/client/models/InternalFixedFeeRateCard.java b/src/main/java/com/togai/client/models/InternalFixedFeeRateCard.java index 3ea116b..29b890e 100644 --- a/src/main/java/com/togai/client/models/InternalFixedFeeRateCard.java +++ b/src/main/java/com/togai/client/models/InternalFixedFeeRateCard.java @@ -20,6 +20,7 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.togai.client.models.FixedFeeType; import com.togai.client.models.InvoiceTiming; import java.io.IOException; import java.math.BigDecimal; @@ -73,6 +74,10 @@ public class InternalFixedFeeRateCard implements Serializable { @SerializedName(SERIALIZED_NAME_INVOICE_TIMING) private InvoiceTiming invoiceTiming; + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private FixedFeeType type = FixedFeeType.RECURRING; + public InternalFixedFeeRateCard() { } @@ -186,6 +191,28 @@ public void setInvoiceTiming(InvoiceTiming invoiceTiming) { } + public InternalFixedFeeRateCard type(FixedFeeType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + + public FixedFeeType getType() { + return type; + } + + + public void setType(FixedFeeType type) { + this.type = type; + } + + @Override public boolean equals(Object o) { @@ -200,12 +227,13 @@ public boolean equals(Object o) { Objects.equals(this.displayName, internalFixedFeeRateCard.displayName) && Objects.equals(this.currency, internalFixedFeeRateCard.currency) && Objects.equals(this.rate, internalFixedFeeRateCard.rate) && - Objects.equals(this.invoiceTiming, internalFixedFeeRateCard.invoiceTiming); + Objects.equals(this.invoiceTiming, internalFixedFeeRateCard.invoiceTiming) && + Objects.equals(this.type, internalFixedFeeRateCard.type); } @Override public int hashCode() { - return Objects.hash(id, displayName, currency, rate, invoiceTiming); + return Objects.hash(id, displayName, currency, rate, invoiceTiming, type); } @Override @@ -217,6 +245,7 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" rate: ").append(toIndentedString(rate)).append("\n"); sb.append(" invoiceTiming: ").append(toIndentedString(invoiceTiming)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -244,6 +273,7 @@ private String toIndentedString(Object o) { openapiFields.add("currency"); openapiFields.add("rate"); openapiFields.add("invoiceTiming"); + openapiFields.add("type"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/togai/client/models/InvoiceLineItem.java b/src/main/java/com/togai/client/models/InvoiceLineItem.java index dfcbb9f..8b8a7b7 100644 --- a/src/main/java/com/togai/client/models/InvoiceLineItem.java +++ b/src/main/java/com/togai/client/models/InvoiceLineItem.java @@ -56,6 +56,10 @@ public class InvoiceLineItem implements Serializable { private static final long serialVersionUID = 1L; + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) private String description; @@ -91,6 +95,28 @@ public class InvoiceLineItem implements Serializable { public InvoiceLineItem() { } + public InvoiceLineItem id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + public InvoiceLineItem description(String description) { this.description = description; @@ -290,7 +316,8 @@ public boolean equals(Object o) { return false; } InvoiceLineItem invoiceLineItem = (InvoiceLineItem) o; - return Objects.equals(this.description, invoiceLineItem.description) && + return Objects.equals(this.id, invoiceLineItem.id) && + Objects.equals(this.description, invoiceLineItem.description) && Objects.equals(this.type, invoiceLineItem.type) && Objects.equals(this.valuePerQuantity, invoiceLineItem.valuePerQuantity) && Objects.equals(this.quantity, invoiceLineItem.quantity) && @@ -302,13 +329,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(description, type, valuePerQuantity, quantity, units, value, metadata, lineItems); + return Objects.hash(id, description, type, valuePerQuantity, quantity, units, value, metadata, lineItems); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class InvoiceLineItem {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" valuePerQuantity: ").append(toIndentedString(valuePerQuantity)).append("\n"); @@ -339,6 +367,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("id"); openapiFields.add("description"); openapiFields.add("type"); openapiFields.add("valuePerQuantity"); @@ -382,6 +411,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } if (!jsonObj.get("description").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } diff --git a/src/main/java/com/togai/client/models/ManageMiscellaneousChargesRequest.java b/src/main/java/com/togai/client/models/ManageMiscellaneousChargesRequest.java new file mode 100644 index 0000000..1632488 --- /dev/null +++ b/src/main/java/com/togai/client/models/ManageMiscellaneousChargesRequest.java @@ -0,0 +1,231 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.MiscellaneousCharge; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Payload to update custom line items + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ManageMiscellaneousChargesRequest implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = new ArrayList<>(); + + public ManageMiscellaneousChargesRequest() { + } + + public ManageMiscellaneousChargesRequest items(List items) { + + this.items = items; + return this; + } + + public ManageMiscellaneousChargesRequest addItemsItem(MiscellaneousCharge itemsItem) { + this.items.add(itemsItem); + return this; + } + + /** + * Get items + * @return items + **/ + @javax.annotation.Nonnull + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageMiscellaneousChargesRequest manageMiscellaneousChargesRequest = (ManageMiscellaneousChargesRequest) o; + return Objects.equals(this.items, manageMiscellaneousChargesRequest.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageMiscellaneousChargesRequest {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("items"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("items"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ManageMiscellaneousChargesRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!ManageMiscellaneousChargesRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageMiscellaneousChargesRequest is not found in the empty JSON string", ManageMiscellaneousChargesRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ManageMiscellaneousChargesRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ManageMiscellaneousChargesRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ManageMiscellaneousChargesRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("items").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + } + + JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); + // validate the required field `items` (array) + for (int i = 0; i < jsonArrayitems.size(); i++) { + MiscellaneousCharge.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ManageMiscellaneousChargesRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageMiscellaneousChargesRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageMiscellaneousChargesRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ManageMiscellaneousChargesRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ManageMiscellaneousChargesRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageMiscellaneousChargesRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageMiscellaneousChargesRequest + * @throws IOException if the JSON string is invalid with respect to ManageMiscellaneousChargesRequest + */ + public static ManageMiscellaneousChargesRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageMiscellaneousChargesRequest.class); + } + + /** + * Convert an instance of ManageMiscellaneousChargesRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/MetricName.java b/src/main/java/com/togai/client/models/MetricName.java index 680db52..da8e235 100644 --- a/src/main/java/com/togai/client/models/MetricName.java +++ b/src/main/java/com/togai/client/models/MetricName.java @@ -25,7 +25,7 @@ import com.google.gson.stream.JsonWriter; /** - * Define the metric you would like to get - allowed options are EVENTS - Aggregation of raw events, USAGE - Aggregated usage value from Usage meters, REVENUE - Aggregated of revenue value from Pricing Plans + * Define the metric you would like to get - allowed options are EVENTS - Aggregation of raw events, USAGE - Aggregated usage value from Usage meters, REVENUE - Aggregated revenue value from Pricing Plans USAGE_FOR_CYCLE - Usage in pricing cycle REVENUE_FOR_CYCLE - Revenue in pricing cycle */ @JsonAdapter(MetricName.Adapter.class) public enum MetricName { @@ -34,7 +34,11 @@ public enum MetricName { USAGE("USAGE"), - REVENUE("REVENUE"); + REVENUE("REVENUE"), + + USAGE_FOR_CYCLE("USAGE_FOR_CYCLE"), + + REVENUE_FOR_CYCLE("REVENUE_FOR_CYCLE"); private String value; diff --git a/src/main/java/com/togai/client/models/MetricQuery.java b/src/main/java/com/togai/client/models/MetricQuery.java index 25f5a4f..a22a95f 100644 --- a/src/main/java/com/togai/client/models/MetricQuery.java +++ b/src/main/java/com/togai/client/models/MetricQuery.java @@ -236,7 +236,7 @@ public MetricQuery putConfigsItem(String key, String configsItem) { } /** - * Configurations. | Metric Name | Config Key | Allowed Values | Default value | Description | |-------------|------------|-----------------|---------------|-----------------------------------| | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | + * Configurations. | Metric Name | Config Key | Allowed Values | Default value | Description | |-------------------|------------|-----------------|---------------|-----------------------------------| | REVENUE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | | REVENUE_FOR_CYCLE | CURRENCY | BASE or INVOICE | BASE | currency to return the revenue in | * @return configs **/ @javax.annotation.Nullable diff --git a/src/main/java/com/togai/client/models/MetricQueryFilterEntry.java b/src/main/java/com/togai/client/models/MetricQueryFilterEntry.java index b450c5a..2bf0dcb 100644 --- a/src/main/java/com/togai/client/models/MetricQueryFilterEntry.java +++ b/src/main/java/com/togai/client/models/MetricQueryFilterEntry.java @@ -47,7 +47,7 @@ import com.togai.client.JSON; /** - * | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | |-------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<one or more valid account IDs> | CUSTOMER_ID | | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<one or more valid customer IDs> | CUSTOMER_ID | | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<at most one valid schema names> | CUSTOMER_ID | | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | CUSTOMER_ID | | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | + * | Metric Name | FilterEntry Name | Allowed groupBy fields | Default Values | Allowed Values | |-------------------|------------------|-------------------------------------------|--------------------------|-------------------------------------------------| | EVENTS | ACCOUNT_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<one or more valid account IDs> | | EVENTS | CUSTOMER_ID | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<one or more valid customer IDs> | | EVENTS | SCHEMA_NAME | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | None | *\\<at most one valid schema names> | | EVENTS | EVENT_STATUS | ACCOUNT_ID, EVENT_STATUS, SCHEMA_NAME, | [PROCESSED, UNPROCESSED] | oneOrMoreOf PROCESSED, UNPROCESSED, IN_PROGRESS | | USAGE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | USAGE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | USAGE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | | REVENUE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | REVENUE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | REVENUE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | | EVENTS | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | | USAGE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | | REVENUE | ORGANIZATION_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | <From auth token> | | | USAGE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | USAGE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | USAGE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | | REVENUE_FOR_CYCLE | ACCOUNT_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid account IDs> | | REVENUE_FOR_CYCLE | CUSTOMER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid customer IDs> | | REVENUE_FOR_CYCLE | USAGE_METER_ID | ACCOUNT_ID, USAGE_METER_ID, CUSTOMER_ID | None | *\\<one or more valid usage meter name> | */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MetricQueryFilterEntry implements Serializable { diff --git a/src/main/java/com/togai/client/models/MiscellaneousCharge.java b/src/main/java/com/togai/client/models/MiscellaneousCharge.java new file mode 100644 index 0000000..1649278 --- /dev/null +++ b/src/main/java/com/togai/client/models/MiscellaneousCharge.java @@ -0,0 +1,249 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Miscellaneous charges are the charges that can be added to the invoice + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MiscellaneousCharge implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public MiscellaneousCharge() { + } + + public MiscellaneousCharge name(String name) { + + this.name = name; + return this; + } + + /** + * Name of the miscellaneous charge + * @return name + **/ + @javax.annotation.Nonnull + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public MiscellaneousCharge value(String value) { + + this.value = value; + return this; + } + + /** + * Value of the charge + * @return value + **/ + @javax.annotation.Nonnull + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MiscellaneousCharge miscellaneousCharge = (MiscellaneousCharge) o; + return Objects.equals(this.name, miscellaneousCharge.name) && + Objects.equals(this.value, miscellaneousCharge.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MiscellaneousCharge {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MiscellaneousCharge + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MiscellaneousCharge.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MiscellaneousCharge is not found in the empty JSON string", MiscellaneousCharge.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MiscellaneousCharge.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MiscellaneousCharge` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MiscellaneousCharge.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MiscellaneousCharge.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MiscellaneousCharge' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MiscellaneousCharge.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MiscellaneousCharge value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MiscellaneousCharge read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MiscellaneousCharge given an JSON string + * + * @param jsonString JSON string + * @return An instance of MiscellaneousCharge + * @throws IOException if the JSON string is invalid with respect to MiscellaneousCharge + */ + public static MiscellaneousCharge fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MiscellaneousCharge.class); + } + + /** + * Convert an instance of MiscellaneousCharge to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/MiscellaneousChargesResponse.java b/src/main/java/com/togai/client/models/MiscellaneousChargesResponse.java new file mode 100644 index 0000000..9c3dee0 --- /dev/null +++ b/src/main/java/com/togai/client/models/MiscellaneousChargesResponse.java @@ -0,0 +1,231 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.MiscellaneousCharge; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * Miscellaneous charges response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class MiscellaneousChargesResponse implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data = new ArrayList<>(); + + public MiscellaneousChargesResponse() { + } + + public MiscellaneousChargesResponse data(List data) { + + this.data = data; + return this; + } + + public MiscellaneousChargesResponse addDataItem(MiscellaneousCharge dataItem) { + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nonnull + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MiscellaneousChargesResponse miscellaneousChargesResponse = (MiscellaneousChargesResponse) o; + return Objects.equals(this.data, miscellaneousChargesResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MiscellaneousChargesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MiscellaneousChargesResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!MiscellaneousChargesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MiscellaneousChargesResponse is not found in the empty JSON string", MiscellaneousChargesResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MiscellaneousChargesResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MiscellaneousChargesResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MiscellaneousChargesResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + MiscellaneousCharge.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MiscellaneousChargesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MiscellaneousChargesResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MiscellaneousChargesResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MiscellaneousChargesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MiscellaneousChargesResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MiscellaneousChargesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MiscellaneousChargesResponse + * @throws IOException if the JSON string is invalid with respect to MiscellaneousChargesResponse + */ + public static MiscellaneousChargesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MiscellaneousChargesResponse.class); + } + + /** + * Convert an instance of MiscellaneousChargesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/PlanOverride.java b/src/main/java/com/togai/client/models/PlanOverride.java index 62e0c72..5cf34ae 100644 --- a/src/main/java/com/togai/client/models/PlanOverride.java +++ b/src/main/java/com/togai/client/models/PlanOverride.java @@ -53,6 +53,10 @@ public class PlanOverride implements Serializable { private static final long serialVersionUID = 1L; + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + public static final String SERIALIZED_NAME_PRICE_PLAN_ID = "pricePlanId"; @SerializedName(SERIALIZED_NAME_PRICE_PLAN_ID) private String pricePlanId; @@ -76,6 +80,28 @@ public class PlanOverride implements Serializable { public PlanOverride() { } + public PlanOverride id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + public PlanOverride pricePlanId(String pricePlanId) { this.pricePlanId = pricePlanId; @@ -196,7 +222,8 @@ public boolean equals(Object o) { return false; } PlanOverride planOverride = (PlanOverride) o; - return Objects.equals(this.pricePlanId, planOverride.pricePlanId) && + return Objects.equals(this.id, planOverride.id) && + Objects.equals(this.pricePlanId, planOverride.pricePlanId) && Objects.equals(this.pricePlanName, planOverride.pricePlanName) && Objects.equals(this.pricePlanDetailsOverride, planOverride.pricePlanDetailsOverride) && Objects.equals(this.startDate, planOverride.startDate) && @@ -205,13 +232,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(pricePlanId, pricePlanName, pricePlanDetailsOverride, startDate, endDate); + return Objects.hash(id, pricePlanId, pricePlanName, pricePlanDetailsOverride, startDate, endDate); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlanOverride {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" pricePlanId: ").append(toIndentedString(pricePlanId)).append("\n"); sb.append(" pricePlanName: ").append(toIndentedString(pricePlanName)).append("\n"); sb.append(" pricePlanDetailsOverride: ").append(toIndentedString(pricePlanDetailsOverride)).append("\n"); @@ -239,6 +267,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("id"); openapiFields.add("pricePlanId"); openapiFields.add("pricePlanName"); openapiFields.add("pricePlanDetailsOverride"); @@ -247,6 +276,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); openapiRequiredFields.add("pricePlanId"); openapiRequiredFields.add("pricePlanName"); openapiRequiredFields.add("startDate"); @@ -280,6 +310,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } if (!jsonObj.get("pricePlanId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `pricePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricePlanId").toString())); } diff --git a/src/main/java/com/togai/client/models/PricePlanDetailsConfig.java b/src/main/java/com/togai/client/models/PricePlanDetailsConfig.java index 1de269b..a6dc52c 100644 --- a/src/main/java/com/togai/client/models/PricePlanDetailsConfig.java +++ b/src/main/java/com/togai/client/models/PricePlanDetailsConfig.java @@ -122,6 +122,10 @@ public ModeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EFFECTIVE_ON) private OffsetDateTime effectiveOn; + public static final String SERIALIZED_NAME_PRICING_CYCLE_ORDINAL = "pricingCycleOrdinal"; + @SerializedName(SERIALIZED_NAME_PRICING_CYCLE_ORDINAL) + private Integer pricingCycleOrdinal; + public PricePlanDetailsConfig() { } @@ -235,6 +239,28 @@ public void setEffectiveOn(OffsetDateTime effectiveOn) { } + public PricePlanDetailsConfig pricingCycleOrdinal(Integer pricingCycleOrdinal) { + + this.pricingCycleOrdinal = pricingCycleOrdinal; + return this; + } + + /** + * nth cycle, will be used to calculate revenue for the particular cycle, only used if mode is CUSTOM or PRICE_PLAN + * @return pricingCycleOrdinal + **/ + @javax.annotation.Nullable + + public Integer getPricingCycleOrdinal() { + return pricingCycleOrdinal; + } + + + public void setPricingCycleOrdinal(Integer pricingCycleOrdinal) { + this.pricingCycleOrdinal = pricingCycleOrdinal; + } + + @Override public boolean equals(Object o) { @@ -249,12 +275,13 @@ public boolean equals(Object o) { Objects.equals(this.pricePlanDetails, pricePlanDetailsConfig.pricePlanDetails) && Objects.equals(this.pricePlanId, pricePlanDetailsConfig.pricePlanId) && Objects.equals(this.accountId, pricePlanDetailsConfig.accountId) && - Objects.equals(this.effectiveOn, pricePlanDetailsConfig.effectiveOn); + Objects.equals(this.effectiveOn, pricePlanDetailsConfig.effectiveOn) && + Objects.equals(this.pricingCycleOrdinal, pricePlanDetailsConfig.pricingCycleOrdinal); } @Override public int hashCode() { - return Objects.hash(mode, pricePlanDetails, pricePlanId, accountId, effectiveOn); + return Objects.hash(mode, pricePlanDetails, pricePlanId, accountId, effectiveOn, pricingCycleOrdinal); } @Override @@ -266,6 +293,7 @@ public String toString() { sb.append(" pricePlanId: ").append(toIndentedString(pricePlanId)).append("\n"); sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); sb.append(" effectiveOn: ").append(toIndentedString(effectiveOn)).append("\n"); + sb.append(" pricingCycleOrdinal: ").append(toIndentedString(pricingCycleOrdinal)).append("\n"); sb.append("}"); return sb.toString(); } @@ -293,6 +321,7 @@ private String toIndentedString(Object o) { openapiFields.add("pricePlanId"); openapiFields.add("accountId"); openapiFields.add("effectiveOn"); + openapiFields.add("pricingCycleOrdinal"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/togai/client/models/PricePlanListData.java b/src/main/java/com/togai/client/models/PricePlanListData.java index 505ee26..14dbf33 100644 --- a/src/main/java/com/togai/client/models/PricePlanListData.java +++ b/src/main/java/com/togai/client/models/PricePlanListData.java @@ -63,6 +63,10 @@ public class PricePlanListData implements Serializable { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private Integer version; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; @SerializedName(SERIALIZED_NAME_DESCRIPTION) private String description; @@ -183,6 +187,28 @@ public void setName(String name) { } + public PricePlanListData version(Integer version) { + + this.version = version; + return this; + } + + /** + * Version of the price plan + * @return version + **/ + @javax.annotation.Nonnull + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + public PricePlanListData description(String description) { this.description = description; @@ -332,6 +358,7 @@ public boolean equals(Object o) { PricePlanListData pricePlanListData = (PricePlanListData) o; return Objects.equals(this.id, pricePlanListData.id) && Objects.equals(this.name, pricePlanListData.name) && + Objects.equals(this.version, pricePlanListData.version) && Objects.equals(this.description, pricePlanListData.description) && Objects.equals(this.status, pricePlanListData.status) && Objects.equals(this.usageMeters, pricePlanListData.usageMeters) && @@ -342,7 +369,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, name, description, status, usageMeters, pricePlanDetails, createdAt, updatedAt); + return Objects.hash(id, name, version, description, status, usageMeters, pricePlanDetails, createdAt, updatedAt); } @Override @@ -351,6 +378,7 @@ public String toString() { sb.append("class PricePlanListData {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" usageMeters: ").append(toIndentedString(usageMeters)).append("\n"); @@ -381,6 +409,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("name"); + openapiFields.add("version"); openapiFields.add("description"); openapiFields.add("status"); openapiFields.add("usageMeters"); @@ -392,6 +421,7 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); openapiRequiredFields.add("name"); + openapiRequiredFields.add("version"); openapiRequiredFields.add("status"); openapiRequiredFields.add("usageMeters"); openapiRequiredFields.add("pricePlanDetails"); diff --git a/src/main/java/com/togai/client/models/PricingSchedule.java b/src/main/java/com/togai/client/models/PricingSchedule.java index d21ddd9..756067d 100644 --- a/src/main/java/com/togai/client/models/PricingSchedule.java +++ b/src/main/java/com/togai/client/models/PricingSchedule.java @@ -53,6 +53,10 @@ public class PricingSchedule implements Serializable { private static final long serialVersionUID = 1L; + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + public static final String SERIALIZED_NAME_PRICE_PLAN_DETAILS = "pricePlanDetails"; @SerializedName(SERIALIZED_NAME_PRICE_PLAN_DETAILS) private PricePlanDetails pricePlanDetails; @@ -65,9 +69,35 @@ public class PricingSchedule implements Serializable { @SerializedName(SERIALIZED_NAME_END_DATE) private OffsetDateTime endDate; + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private Integer version; + public PricingSchedule() { } + public PricingSchedule id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + public PricingSchedule pricePlanDetails(PricePlanDetails pricePlanDetails) { this.pricePlanDetails = pricePlanDetails; @@ -134,6 +164,29 @@ public void setEndDate(OffsetDateTime endDate) { } + public PricingSchedule version(Integer version) { + + this.version = version; + return this; + } + + /** + * Get version + * minimum: 1 + * @return version + **/ + @javax.annotation.Nonnull + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + @Override public boolean equals(Object o) { @@ -144,23 +197,27 @@ public boolean equals(Object o) { return false; } PricingSchedule pricingSchedule = (PricingSchedule) o; - return Objects.equals(this.pricePlanDetails, pricingSchedule.pricePlanDetails) && + return Objects.equals(this.id, pricingSchedule.id) && + Objects.equals(this.pricePlanDetails, pricingSchedule.pricePlanDetails) && Objects.equals(this.startDate, pricingSchedule.startDate) && - Objects.equals(this.endDate, pricingSchedule.endDate); + Objects.equals(this.endDate, pricingSchedule.endDate) && + Objects.equals(this.version, pricingSchedule.version); } @Override public int hashCode() { - return Objects.hash(pricePlanDetails, startDate, endDate); + return Objects.hash(id, pricePlanDetails, startDate, endDate, version); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PricingSchedule {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" pricePlanDetails: ").append(toIndentedString(pricePlanDetails)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append("}"); return sb.toString(); } @@ -183,14 +240,18 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("id"); openapiFields.add("pricePlanDetails"); openapiFields.add("startDate"); openapiFields.add("endDate"); + openapiFields.add("version"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); openapiRequiredFields.add("startDate"); openapiRequiredFields.add("endDate"); + openapiRequiredFields.add("version"); } /** @@ -220,6 +281,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } // validate the optional field `pricePlanDetails` if (jsonObj.get("pricePlanDetails") != null && !jsonObj.get("pricePlanDetails").isJsonNull()) { PricePlanDetails.validateJsonObject(jsonObj.getAsJsonObject("pricePlanDetails")); diff --git a/src/main/java/com/togai/client/models/PricingSchedulePaginatedResponse.java b/src/main/java/com/togai/client/models/PricingSchedulePaginatedResponse.java new file mode 100644 index 0000000..10f1f12 --- /dev/null +++ b/src/main/java/com/togai/client/models/PricingSchedulePaginatedResponse.java @@ -0,0 +1,294 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.PricingScheduleWithPricePlanId; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * PricingSchedulePaginatedResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PricingSchedulePaginatedResponse implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT_TOKEN = "nextToken"; + @SerializedName(SERIALIZED_NAME_NEXT_TOKEN) + private String nextToken; + + public static final String SERIALIZED_NAME_PREVIOUS_TOKEN = "previousToken"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_TOKEN) + private String previousToken; + + public PricingSchedulePaginatedResponse() { + } + + public PricingSchedulePaginatedResponse data(List data) { + + this.data = data; + return this; + } + + public PricingSchedulePaginatedResponse addDataItem(PricingScheduleWithPricePlanId dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + public PricingSchedulePaginatedResponse nextToken(String nextToken) { + + this.nextToken = nextToken; + return this; + } + + /** + * Get nextToken + * @return nextToken + **/ + @javax.annotation.Nullable + + public String getNextToken() { + return nextToken; + } + + + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + + public PricingSchedulePaginatedResponse previousToken(String previousToken) { + + this.previousToken = previousToken; + return this; + } + + /** + * Get previousToken + * @return previousToken + **/ + @javax.annotation.Nullable + + public String getPreviousToken() { + return previousToken; + } + + + public void setPreviousToken(String previousToken) { + this.previousToken = previousToken; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PricingSchedulePaginatedResponse pricingSchedulePaginatedResponse = (PricingSchedulePaginatedResponse) o; + return Objects.equals(this.data, pricingSchedulePaginatedResponse.data) && + Objects.equals(this.nextToken, pricingSchedulePaginatedResponse.nextToken) && + Objects.equals(this.previousToken, pricingSchedulePaginatedResponse.previousToken); + } + + @Override + public int hashCode() { + return Objects.hash(data, nextToken, previousToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PricingSchedulePaginatedResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" nextToken: ").append(toIndentedString(nextToken)).append("\n"); + sb.append(" previousToken: ").append(toIndentedString(previousToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("nextToken"); + openapiFields.add("previousToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PricingSchedulePaginatedResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PricingSchedulePaginatedResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PricingSchedulePaginatedResponse is not found in the empty JSON string", PricingSchedulePaginatedResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PricingSchedulePaginatedResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PricingSchedulePaginatedResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + PricingScheduleWithPricePlanId.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); + }; + } + } + if ((jsonObj.get("nextToken") != null && !jsonObj.get("nextToken").isJsonNull()) && !jsonObj.get("nextToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nextToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nextToken").toString())); + } + if ((jsonObj.get("previousToken") != null && !jsonObj.get("previousToken").isJsonNull()) && !jsonObj.get("previousToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `previousToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previousToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PricingSchedulePaginatedResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PricingSchedulePaginatedResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PricingSchedulePaginatedResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PricingSchedulePaginatedResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PricingSchedulePaginatedResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PricingSchedulePaginatedResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PricingSchedulePaginatedResponse + * @throws IOException if the JSON string is invalid with respect to PricingSchedulePaginatedResponse + */ + public static PricingSchedulePaginatedResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PricingSchedulePaginatedResponse.class); + } + + /** + * Convert an instance of PricingSchedulePaginatedResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanId.java b/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanId.java new file mode 100644 index 0000000..47817fe --- /dev/null +++ b/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanId.java @@ -0,0 +1,375 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.togai.client.models.PricePlanDetails; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * PricingScheduleWithPricePlanId + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PricingScheduleWithPricePlanId implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PRICE_PLAN_DETAILS = "pricePlanDetails"; + @SerializedName(SERIALIZED_NAME_PRICE_PLAN_DETAILS) + private PricePlanDetails pricePlanDetails; + + public static final String SERIALIZED_NAME_START_DATE = "startDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "endDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_VERSION = "version"; + @SerializedName(SERIALIZED_NAME_VERSION) + private Integer version; + + public static final String SERIALIZED_NAME_PRICE_PLAN_ID = "pricePlanId"; + @SerializedName(SERIALIZED_NAME_PRICE_PLAN_ID) + private String pricePlanId; + + public PricingScheduleWithPricePlanId() { + } + + public PricingScheduleWithPricePlanId id(String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nonnull + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PricingScheduleWithPricePlanId pricePlanDetails(PricePlanDetails pricePlanDetails) { + + this.pricePlanDetails = pricePlanDetails; + return this; + } + + /** + * Get pricePlanDetails + * @return pricePlanDetails + **/ + @javax.annotation.Nullable + + public PricePlanDetails getPricePlanDetails() { + return pricePlanDetails; + } + + + public void setPricePlanDetails(PricePlanDetails pricePlanDetails) { + this.pricePlanDetails = pricePlanDetails; + } + + + public PricingScheduleWithPricePlanId startDate(OffsetDateTime startDate) { + + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + **/ + @javax.annotation.Nonnull + + public OffsetDateTime getStartDate() { + return startDate; + } + + + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public PricingScheduleWithPricePlanId endDate(OffsetDateTime endDate) { + + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + **/ + @javax.annotation.Nonnull + + public OffsetDateTime getEndDate() { + return endDate; + } + + + public void setEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public PricingScheduleWithPricePlanId version(Integer version) { + + this.version = version; + return this; + } + + /** + * Get version + * minimum: 1 + * @return version + **/ + @javax.annotation.Nonnull + + public Integer getVersion() { + return version; + } + + + public void setVersion(Integer version) { + this.version = version; + } + + + public PricingScheduleWithPricePlanId pricePlanId(String pricePlanId) { + + this.pricePlanId = pricePlanId; + return this; + } + + /** + * Get pricePlanId + * @return pricePlanId + **/ + @javax.annotation.Nonnull + + public String getPricePlanId() { + return pricePlanId; + } + + + public void setPricePlanId(String pricePlanId) { + this.pricePlanId = pricePlanId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PricingScheduleWithPricePlanId pricingScheduleWithPricePlanId = (PricingScheduleWithPricePlanId) o; + return Objects.equals(this.id, pricingScheduleWithPricePlanId.id) && + Objects.equals(this.pricePlanDetails, pricingScheduleWithPricePlanId.pricePlanDetails) && + Objects.equals(this.startDate, pricingScheduleWithPricePlanId.startDate) && + Objects.equals(this.endDate, pricingScheduleWithPricePlanId.endDate) && + Objects.equals(this.version, pricingScheduleWithPricePlanId.version) && + Objects.equals(this.pricePlanId, pricingScheduleWithPricePlanId.pricePlanId); + } + + @Override + public int hashCode() { + return Objects.hash(id, pricePlanDetails, startDate, endDate, version, pricePlanId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PricingScheduleWithPricePlanId {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" pricePlanDetails: ").append(toIndentedString(pricePlanDetails)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" pricePlanId: ").append(toIndentedString(pricePlanId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("pricePlanDetails"); + openapiFields.add("startDate"); + openapiFields.add("endDate"); + openapiFields.add("version"); + openapiFields.add("pricePlanId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("startDate"); + openapiRequiredFields.add("endDate"); + openapiRequiredFields.add("version"); + openapiRequiredFields.add("pricePlanId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PricingScheduleWithPricePlanId + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PricingScheduleWithPricePlanId.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PricingScheduleWithPricePlanId is not found in the empty JSON string", PricingScheduleWithPricePlanId.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PricingScheduleWithPricePlanId.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PricingScheduleWithPricePlanId` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PricingScheduleWithPricePlanId.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field `pricePlanDetails` + if (jsonObj.get("pricePlanDetails") != null && !jsonObj.get("pricePlanDetails").isJsonNull()) { + PricePlanDetails.validateJsonObject(jsonObj.getAsJsonObject("pricePlanDetails")); + } + if (!jsonObj.get("pricePlanId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pricePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricePlanId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PricingScheduleWithPricePlanId.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PricingScheduleWithPricePlanId' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PricingScheduleWithPricePlanId.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PricingScheduleWithPricePlanId value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PricingScheduleWithPricePlanId read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PricingScheduleWithPricePlanId given an JSON string + * + * @param jsonString JSON string + * @return An instance of PricingScheduleWithPricePlanId + * @throws IOException if the JSON string is invalid with respect to PricingScheduleWithPricePlanId + */ + public static PricingScheduleWithPricePlanId fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PricingScheduleWithPricePlanId.class); + } + + /** + * Convert an instance of PricingScheduleWithPricePlanId to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanIdAllOf.java b/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanIdAllOf.java new file mode 100644 index 0000000..e999909 --- /dev/null +++ b/src/main/java/com/togai/client/models/PricingScheduleWithPricePlanIdAllOf.java @@ -0,0 +1,216 @@ +/* + * Togai Apis + * APIs for Togai App + * + * The version of the OpenAPI document: 1.0 + * Contact: engg@togai.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.togai.client.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.togai.client.JSON; + +/** + * PricingScheduleWithPricePlanIdAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PricingScheduleWithPricePlanIdAllOf implements Serializable { + private static final long serialVersionUID = 1L; + + public static final String SERIALIZED_NAME_PRICE_PLAN_ID = "pricePlanId"; + @SerializedName(SERIALIZED_NAME_PRICE_PLAN_ID) + private String pricePlanId; + + public PricingScheduleWithPricePlanIdAllOf() { + } + + public PricingScheduleWithPricePlanIdAllOf pricePlanId(String pricePlanId) { + + this.pricePlanId = pricePlanId; + return this; + } + + /** + * Get pricePlanId + * @return pricePlanId + **/ + @javax.annotation.Nonnull + + public String getPricePlanId() { + return pricePlanId; + } + + + public void setPricePlanId(String pricePlanId) { + this.pricePlanId = pricePlanId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PricingScheduleWithPricePlanIdAllOf pricingScheduleWithPricePlanIdAllOf = (PricingScheduleWithPricePlanIdAllOf) o; + return Objects.equals(this.pricePlanId, pricingScheduleWithPricePlanIdAllOf.pricePlanId); + } + + @Override + public int hashCode() { + return Objects.hash(pricePlanId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PricingScheduleWithPricePlanIdAllOf {\n"); + sb.append(" pricePlanId: ").append(toIndentedString(pricePlanId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pricePlanId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pricePlanId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PricingScheduleWithPricePlanIdAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!PricingScheduleWithPricePlanIdAllOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PricingScheduleWithPricePlanIdAllOf is not found in the empty JSON string", PricingScheduleWithPricePlanIdAllOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PricingScheduleWithPricePlanIdAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PricingScheduleWithPricePlanIdAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PricingScheduleWithPricePlanIdAllOf.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("pricePlanId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pricePlanId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricePlanId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PricingScheduleWithPricePlanIdAllOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PricingScheduleWithPricePlanIdAllOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PricingScheduleWithPricePlanIdAllOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PricingScheduleWithPricePlanIdAllOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PricingScheduleWithPricePlanIdAllOf read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PricingScheduleWithPricePlanIdAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of PricingScheduleWithPricePlanIdAllOf + * @throws IOException if the JSON string is invalid with respect to PricingScheduleWithPricePlanIdAllOf + */ + public static PricingScheduleWithPricePlanIdAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PricingScheduleWithPricePlanIdAllOf.class); + } + + /** + * Convert an instance of PricingScheduleWithPricePlanIdAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/togai/client/models/UpdatePricePlanRequest.java b/src/main/java/com/togai/client/models/UpdatePricePlanRequest.java index e68fdac..b404f2c 100644 --- a/src/main/java/com/togai/client/models/UpdatePricePlanRequest.java +++ b/src/main/java/com/togai/client/models/UpdatePricePlanRequest.java @@ -60,6 +60,114 @@ public class UpdatePricePlanRequest implements Serializable { @SerializedName(SERIALIZED_NAME_PRICE_PLAN_DETAILS) private CreatePricePlanDetailsOverride pricePlanDetails; + /** + * Gets or Sets migrationMode + */ + @JsonAdapter(MigrationModeEnum.Adapter.class) + public enum MigrationModeEnum { + IMMEDIATE("IMMEDIATE"), + + IMMEDIATE_IGNORE_OVERRIDE("IMMEDIATE_IGNORE_OVERRIDE"), + + NEXT_CYCLE("NEXT_CYCLE"), + + NEXT_CYCLE_IGNORE_OVERRIDE("NEXT_CYCLE_IGNORE_OVERRIDE"), + + NONE("NONE"); + + private String value; + + MigrationModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MigrationModeEnum fromValue(String value) { + for (MigrationModeEnum b : MigrationModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MigrationModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MigrationModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MigrationModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_MIGRATION_MODE = "migrationMode"; + @SerializedName(SERIALIZED_NAME_MIGRATION_MODE) + private MigrationModeEnum migrationMode; + + /** + * Gets or Sets versionsToMigrate + */ + @JsonAdapter(VersionsToMigrateEnum.Adapter.class) + public enum VersionsToMigrateEnum { + LATEST_VERSION("LATEST_VERSION"), + + ALL_VERSION("ALL_VERSION"); + + private String value; + + VersionsToMigrateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VersionsToMigrateEnum fromValue(String value) { + for (VersionsToMigrateEnum b : VersionsToMigrateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VersionsToMigrateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VersionsToMigrateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VersionsToMigrateEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_VERSIONS_TO_MIGRATE = "versionsToMigrate"; + @SerializedName(SERIALIZED_NAME_VERSIONS_TO_MIGRATE) + private VersionsToMigrateEnum versionsToMigrate; + public UpdatePricePlanRequest() { } @@ -107,6 +215,50 @@ public void setPricePlanDetails(CreatePricePlanDetailsOverride pricePlanDetails) } + public UpdatePricePlanRequest migrationMode(MigrationModeEnum migrationMode) { + + this.migrationMode = migrationMode; + return this; + } + + /** + * Get migrationMode + * @return migrationMode + **/ + @javax.annotation.Nullable + + public MigrationModeEnum getMigrationMode() { + return migrationMode; + } + + + public void setMigrationMode(MigrationModeEnum migrationMode) { + this.migrationMode = migrationMode; + } + + + public UpdatePricePlanRequest versionsToMigrate(VersionsToMigrateEnum versionsToMigrate) { + + this.versionsToMigrate = versionsToMigrate; + return this; + } + + /** + * Get versionsToMigrate + * @return versionsToMigrate + **/ + @javax.annotation.Nullable + + public VersionsToMigrateEnum getVersionsToMigrate() { + return versionsToMigrate; + } + + + public void setVersionsToMigrate(VersionsToMigrateEnum versionsToMigrate) { + this.versionsToMigrate = versionsToMigrate; + } + + @Override public boolean equals(Object o) { @@ -118,12 +270,14 @@ public boolean equals(Object o) { } UpdatePricePlanRequest updatePricePlanRequest = (UpdatePricePlanRequest) o; return Objects.equals(this.description, updatePricePlanRequest.description) && - Objects.equals(this.pricePlanDetails, updatePricePlanRequest.pricePlanDetails); + Objects.equals(this.pricePlanDetails, updatePricePlanRequest.pricePlanDetails) && + Objects.equals(this.migrationMode, updatePricePlanRequest.migrationMode) && + Objects.equals(this.versionsToMigrate, updatePricePlanRequest.versionsToMigrate); } @Override public int hashCode() { - return Objects.hash(description, pricePlanDetails); + return Objects.hash(description, pricePlanDetails, migrationMode, versionsToMigrate); } @Override @@ -132,6 +286,8 @@ public String toString() { sb.append("class UpdatePricePlanRequest {\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" pricePlanDetails: ").append(toIndentedString(pricePlanDetails)).append("\n"); + sb.append(" migrationMode: ").append(toIndentedString(migrationMode)).append("\n"); + sb.append(" versionsToMigrate: ").append(toIndentedString(versionsToMigrate)).append("\n"); sb.append("}"); return sb.toString(); } @@ -156,6 +312,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("description"); openapiFields.add("pricePlanDetails"); + openapiFields.add("migrationMode"); + openapiFields.add("versionsToMigrate"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -188,6 +346,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("pricePlanDetails") != null && !jsonObj.get("pricePlanDetails").isJsonNull()) { CreatePricePlanDetailsOverride.validateJsonObject(jsonObj.getAsJsonObject("pricePlanDetails")); } + if ((jsonObj.get("migrationMode") != null && !jsonObj.get("migrationMode").isJsonNull()) && !jsonObj.get("migrationMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `migrationMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("migrationMode").toString())); + } + if ((jsonObj.get("versionsToMigrate") != null && !jsonObj.get("versionsToMigrate").isJsonNull()) && !jsonObj.get("versionsToMigrate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `versionsToMigrate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("versionsToMigrate").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory {