Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vlad/update customer invoices #32

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "octane-node",
"version": "2.2.0",
"version": "2.3.0",
"description": "Node bindings for the Octane API",
"author": "team@getoctane.io",
"main": "build/index.js",
Expand Down
43 changes: 43 additions & 0 deletions src/codegen/apis/CreditsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export interface CreditsGrantGetRequest {
listCreditGrantsArgs: ListCreditGrantsArgs;
}

export interface CreditsGrantGrantUuidGrantPostRequest {
grantUuid: string;
}

export interface CreditsGrantGrantUuidVoidPostRequest {
grantUuid: string;
voidCreditGrantArgs?: VoidCreditGrantArgs;
Expand Down Expand Up @@ -105,6 +109,45 @@ export class CreditsApi extends runtime.BaseAPI {
return await response.value();
}

/**
* Adds a credit grant to the ledger with the given grant UUID, if it was not immediately granted on creation.
* Add Credit Grant to Ledger
*/
async creditsGrantGrantUuidGrantPostRaw(requestParameters: CreditsGrantGrantUuidGrantPostRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<void>> {
if (requestParameters.grantUuid === null || requestParameters.grantUuid === undefined) {
throw new runtime.RequiredError('grantUuid','Required parameter requestParameters.grantUuid was null or undefined when calling creditsGrantGrantUuidGrantPost.');
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("BearerApiKeyAuth", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/credits/grant/{grant_uuid}/grant`.replace(`{${"grant_uuid"}}`, encodeURIComponent(String(requestParameters.grantUuid))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.VoidApiResponse(response);
}

/**
* Adds a credit grant to the ledger with the given grant UUID, if it was not immediately granted on creation.
* Add Credit Grant to Ledger
*/
async creditsGrantGrantUuidGrantPost(requestParameters: CreditsGrantGrantUuidGrantPostRequest, initOverrides?: RequestInit): Promise<void> {
await this.creditsGrantGrantUuidGrantPostRaw(requestParameters, initOverrides);
}

/**
* Deactivates a credit grant with the given grant UUID.
* Void a Credit Grant
Expand Down
25 changes: 18 additions & 7 deletions src/codegen/apis/CustomerPortalApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ import {
CustomerPortalCreditPurchase,
CustomerPortalCreditPurchaseFromJSON,
CustomerPortalCreditPurchaseToJSON,
CustomerPortalCustomerPortalUrlInputArgs,
CustomerPortalCustomerPortalUrlInputArgsFromJSON,
CustomerPortalCustomerPortalUrlInputArgsToJSON,
CustomerPortalDailyAccruedRevenue,
CustomerPortalDailyAccruedRevenueFromJSON,
CustomerPortalDailyAccruedRevenueToJSON,
Expand Down Expand Up @@ -133,13 +136,17 @@ export interface EcpCreditPurchasePostRequest {
}

export interface EcpCustomerPortalUrlPostRequest {
customerPortalTokenInputArgs: CustomerPortalTokenInputArgs;
customerPortalCustomerPortalUrlInputArgs: CustomerPortalCustomerPortalUrlInputArgs;
}

export interface EcpFilteredUsagePostRequest {
customerPortalMeterLabelFilter: CustomerPortalMeterLabelFilter;
}

export interface EcpPortalUrlGetRequest {
isFrame?: boolean;
}

export interface EcpSpendByTimePostRequest {
customerPortalSpendByTimeInput: CustomerPortalSpendByTimeInput;
}
Expand Down Expand Up @@ -553,8 +560,8 @@ export class CustomerPortalApi extends runtime.BaseAPI {
* Generate Customer Portal Url
*/
async ecpCustomerPortalUrlPostRaw(requestParameters: EcpCustomerPortalUrlPostRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<CustomerPortalUrl>> {
if (requestParameters.customerPortalTokenInputArgs === null || requestParameters.customerPortalTokenInputArgs === undefined) {
throw new runtime.RequiredError('customerPortalTokenInputArgs','Required parameter requestParameters.customerPortalTokenInputArgs was null or undefined when calling ecpCustomerPortalUrlPost.');
if (requestParameters.customerPortalCustomerPortalUrlInputArgs === null || requestParameters.customerPortalCustomerPortalUrlInputArgs === undefined) {
throw new runtime.RequiredError('customerPortalCustomerPortalUrlInputArgs','Required parameter requestParameters.customerPortalCustomerPortalUrlInputArgs was null or undefined when calling ecpCustomerPortalUrlPost.');
}

const queryParameters: any = {};
Expand All @@ -576,7 +583,7 @@ export class CustomerPortalApi extends runtime.BaseAPI {
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CustomerPortalTokenInputArgsToJSON(requestParameters.customerPortalTokenInputArgs),
body: CustomerPortalCustomerPortalUrlInputArgsToJSON(requestParameters.customerPortalCustomerPortalUrlInputArgs),
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => CustomerPortalUrlFromJSON(jsonValue));
Expand Down Expand Up @@ -818,9 +825,13 @@ export class CustomerPortalApi extends runtime.BaseAPI {
* Get the url to the customer portal. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
* Get the Customer Portal Url
*/
async ecpPortalUrlGetRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<CustomerPortalUrl>> {
async ecpPortalUrlGetRaw(requestParameters: EcpPortalUrlGetRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<CustomerPortalUrl>> {
const queryParameters: any = {};

if (requestParameters.isFrame !== undefined) {
queryParameters['is_frame'] = requestParameters.isFrame;
}

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
Expand All @@ -845,8 +856,8 @@ export class CustomerPortalApi extends runtime.BaseAPI {
* Get the url to the customer portal. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
* Get the Customer Portal Url
*/
async ecpPortalUrlGet(initOverrides?: RequestInit): Promise<CustomerPortalUrl> {
const response = await this.ecpPortalUrlGetRaw(initOverrides);
async ecpPortalUrlGet(requestParameters: EcpPortalUrlGetRequest = {}, initOverrides?: RequestInit): Promise<CustomerPortalUrl> {
const response = await this.ecpPortalUrlGetRaw(requestParameters, initOverrides);
return await response.value();
}

Expand Down
Loading