forked from eclipse-xpanse/xpanse-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update price api. (eclipse-xpanse#827)
- Loading branch information
Showing
6 changed files
with
487 additions
and
340 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
*/ | ||
|
||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { Price } from './Price'; | ||
export type FlavorPriceResult = { | ||
/** | ||
* The name of the flavor. | ||
*/ | ||
flavorName: string; | ||
/** | ||
* The billing mode of the price. | ||
*/ | ||
billingMode: FlavorPriceResult.billingMode; | ||
recurringPrice?: Price; | ||
oneTimePaymentPrice?: Price; | ||
/** | ||
* Error reason when price calculation fails. | ||
*/ | ||
errorMessage?: string; | ||
successful?: boolean; | ||
}; | ||
export namespace FlavorPriceResult { | ||
/** | ||
* The billing mode of the price. | ||
*/ | ||
export enum billingMode { | ||
FIXED = 'Fixed', | ||
PAY_PER_USE = 'Pay per Use', | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* SPDX-FileCopyrightText: Huawei Inc. | ||
*/ | ||
|
||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { CancelablePromise } from '../core/CancelablePromise'; | ||
import { OpenAPI } from '../core/OpenAPI'; | ||
import { request as __request } from '../core/request'; | ||
import type { FlavorPriceResult } from '../models/FlavorPriceResult'; | ||
export class ServicePricesService { | ||
/** | ||
* Get the price of one specific flavor of the service.<br>Required role:<b> admin</b> or <b>user</b> | ||
* @param templateId id of the service template | ||
* @param region region name of the service | ||
* @param billingMode mode of billing | ||
* @param flavorName flavor name of the service | ||
* @returns FlavorPriceResult OK | ||
* @throws ApiError | ||
*/ | ||
public static getServicePriceByFlavor( | ||
templateId: string, | ||
region: string, | ||
billingMode: 'Fixed' | 'Pay per Use', | ||
flavorName: string | ||
): CancelablePromise<FlavorPriceResult> { | ||
return __request(OpenAPI, { | ||
method: 'GET', | ||
url: '/xpanse/pricing/{templateId}/{region}/{billingMode}/{flavorName}', | ||
path: { | ||
templateId: templateId, | ||
region: region, | ||
billingMode: billingMode, | ||
flavorName: flavorName, | ||
}, | ||
errors: { | ||
400: `Bad Request`, | ||
401: `Unauthorized`, | ||
403: `Forbidden`, | ||
422: `Unprocessable Entity`, | ||
500: `Internal Server Error`, | ||
502: `Bad Gateway`, | ||
}, | ||
}); | ||
} | ||
/** | ||
* Get the prices of all flavors of the service<br>Required role:<b> admin</b> or <b>user</b> | ||
* @param templateId id of the service template | ||
* @param region region name of the service | ||
* @param billingMode mode of billing | ||
* @returns FlavorPriceResult OK | ||
* @throws ApiError | ||
*/ | ||
public static getPricesByService( | ||
templateId: string, | ||
region: string, | ||
billingMode: 'Fixed' | 'Pay per Use' | ||
): CancelablePromise<Array<FlavorPriceResult>> { | ||
return __request(OpenAPI, { | ||
method: 'GET', | ||
url: '/xpanse/pricing/service/{templateId}/{region}/{billingMode}', | ||
path: { | ||
templateId: templateId, | ||
region: region, | ||
billingMode: billingMode, | ||
}, | ||
errors: { | ||
400: `Bad Request`, | ||
401: `Unauthorized`, | ||
403: `Forbidden`, | ||
422: `Unprocessable Entity`, | ||
500: `Internal Server Error`, | ||
502: `Bad Gateway`, | ||
}, | ||
}); | ||
} | ||
} |