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

release reservations RP-Billing plan 2019-04 #5449

Merged
merged 1 commit into from
Oct 8, 2019
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
2 changes: 1 addition & 1 deletion sdk/reservations/arm-reservations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@azure/arm-reservations",
"author": "Microsoft Corporation",
"description": "AzureReservationAPI Library with typescript type definitions for node.js and browser.",
"version": "3.0.0",
"version": "4.0.0",
"dependencies": {
"@azure/ms-rest-azure-js": "^2.0.1",
"@azure/ms-rest-js": "^2.0.4",
Expand Down
3 changes: 2 additions & 1 deletion sdk/reservations/arm-reservations/src/azureReservationAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class AzureReservationAPI extends AzureReservationAPIContext {
}

/**
* Get applicable `Reservation`s that are applied to this subscription.
* Get applicable `Reservation`s that are applied to this subscription or a resource group under
* this subscription.
* @summary Get list of applicable `Reservation`s.
* @param subscriptionId Id of the subscription
* @param [options] The optional parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "@azure/arm-reservations";
const packageVersion = "3.0.0";
const packageVersion = "4.0.0";

export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
Expand All @@ -32,7 +32,7 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -46,10 +46,10 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
122 changes: 122 additions & 0 deletions sdk/reservations/arm-reservations/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ export interface SkuName {
name?: string;
}

/**
* An interface representing CatalogBillingPlansItem.
*/
export interface CatalogBillingPlansItem {
/**
* The term for the billing SKU is available for. Possible values include: 'P1Y', 'P3Y'
*/
name?: ReservationTerm;
/**
* Describes unknown properties. The value of an unknown property MUST be of type
* "ReservationBillingPlan[]". Due to valid TS constraints we have modeled this as a union of
* `ReservationBillingPlan[] | any`.
*/
[property: string]: ReservationBillingPlan[] | any;
}

/**
* An interface representing SkuProperty.
*/
Expand Down Expand Up @@ -65,6 +81,10 @@ export interface Catalog {
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly name?: string;
/**
* The billing plan options available for this SKU.
*/
billingPlans?: CatalogBillingPlansItem[];
/**
* Available reservation terms for this resource
* **NOTE: This property will not be serialized. It can only be populated by the server.**
Expand All @@ -84,6 +104,17 @@ export interface Catalog {
readonly restrictions?: SkuRestriction[];
}

/**
* An interface representing Price.
*/
export interface Price {
/**
* The ISO 4217 3-letter currency code for the currency used by this purchase record.
*/
currencyCode?: string;
amount?: number;
}

/**
* An interface representing ExtendedStatusInfo.
*/
Expand All @@ -99,6 +130,57 @@ export interface ExtendedStatusInfo {
message?: string;
}

/**
* Information about payment related to a reservation order.
*/
export interface PaymentDetail {
/**
* Date when the payment needs to be done.
*/
dueDate?: Date;
/**
* Date when the transaction is completed. Is null when it is scheduled.
*/
paymentDate?: Date;
/**
* Amount in pricing currency. Tax not included.
*/
pricingCurrencyTotal?: Price;
/**
* Amount charged in Billing currency. Tax not included. Is null for future payments
*/
billingCurrencyTotal?: Price;
/**
* Shows the Account that is charged for this payment.
*/
billingAccount?: string;
/**
* Possible values include: 'Succeeded', 'Failed', 'Scheduled', 'Cancelled'
*/
status?: PaymentStatus;
extendedStatusInfo?: ExtendedStatusInfo;
}

/**
* Information describing the type of billing plan for this reservation.
*/
export interface ReservationOrderBillingPlanInformation {
/**
* Amount of money to be paid for the Order. Tax is not included.
*/
pricingCurrencyTotal?: Price;
/**
* Date when the billing plan has started.
*/
startDate?: Date;
/**
* For recurring billing plans, indicates the date when next payment will be processed. Null when
* total is paid off.
*/
nextPaymentDueDate?: Date;
transactions?: PaymentDetail[];
}

/**
* An interface representing ReservationSplitProperties.
*/
Expand Down Expand Up @@ -161,6 +243,10 @@ export interface PurchaseRequest {
* Possible values include: 'P1Y', 'P3Y'
*/
term?: ReservationTerm;
/**
* Possible values include: 'Upfront', 'Monthly'
*/
billingPlan?: ReservationBillingPlan;
quantity?: number;
/**
* Friendly name of the Reservation
Expand Down Expand Up @@ -258,6 +344,10 @@ export interface ReservationProperties {
*/
skuDescription?: string;
extendedStatusInfo?: ExtendedStatusInfo;
/**
* Possible values include: 'Upfront', 'Monthly'
*/
billingPlan?: ReservationBillingPlan;
splitProperties?: ReservationSplitProperties;
mergeProperties?: ReservationMergeProperties;
billingScopeId?: string;
Expand Down Expand Up @@ -350,6 +440,11 @@ export interface ReservationOrderResponse extends BaseResource {
* Current state of the reservation.
*/
provisioningState?: string;
/**
* Possible values include: 'Upfront', 'Monthly'
*/
billingPlan?: ReservationBillingPlan;
planInformation?: ReservationOrderBillingPlanInformation;
reservations?: ReservationResponse[];
/**
* Type of resource. "Microsoft.Capacity/reservations"
Expand Down Expand Up @@ -406,6 +501,7 @@ export interface CalculatePriceResponseProperties {
* not included.
*/
pricingCurrencyTotal?: CalculatePriceResponsePropertiesPricingCurrencyTotal;
paymentSchedule?: PaymentDetail[];
}

/**
Expand Down Expand Up @@ -600,6 +696,16 @@ export interface AzureReservationAPIGetCatalogOptionalParams extends msRest.Requ
location?: string;
}

/**
* Optional Parameters.
*/
export interface ReservationOrderGetOptionalParams extends msRest.RequestOptionsBase {
/**
* May be used to expand the planInformation.
*/
expand?: string;
}

/**
* An interface representing AzureReservationAPIOptions.
*/
Expand Down Expand Up @@ -678,6 +784,14 @@ export type ReservationStatusCode = 'None' | 'Pending' | 'Active' | 'PurchaseErr
*/
export type ErrorResponseCode = 'NotSpecified' | 'InternalServerError' | 'ServerTimeout' | 'AuthorizationFailed' | 'BadRequest' | 'ClientCertificateThumbprintNotSet' | 'InvalidRequestContent' | 'OperationFailed' | 'HttpMethodNotSupported' | 'InvalidRequestUri' | 'MissingTenantId' | 'InvalidTenantId' | 'InvalidReservationOrderId' | 'InvalidReservationId' | 'ReservationIdNotInReservationOrder' | 'ReservationOrderNotFound' | 'InvalidSubscriptionId' | 'InvalidAccessToken' | 'InvalidLocationId' | 'UnauthenticatedRequestsThrottled' | 'InvalidHealthCheckType' | 'Forbidden' | 'BillingScopeIdCannotBeChanged' | 'AppliedScopesNotAssociatedWithCommerceAccount' | 'PatchValuesSameAsExisting' | 'RoleAssignmentCreationFailed' | 'ReservationOrderCreationFailed' | 'ReservationOrderNotEnabled' | 'CapacityUpdateScopesFailed' | 'UnsupportedReservationTerm' | 'ReservationOrderIdAlreadyExists' | 'RiskCheckFailed' | 'CreateQuoteFailed' | 'ActivateQuoteFailed' | 'NonsupportedAccountId' | 'PaymentInstrumentNotFound' | 'MissingAppliedScopesForSingle' | 'NoValidReservationsToReRate' | 'ReRateOnlyAllowedForEA' | 'OperationCannotBePerformedInCurrentState' | 'InvalidSingleAppliedScopesCount' | 'InvalidFulfillmentRequestParameters' | 'NotSupportedCountry' | 'InvalidRefundQuantity' | 'PurchaseError' | 'BillingCustomerInputError' | 'BillingPaymentInstrumentSoftError' | 'BillingPaymentInstrumentHardError' | 'BillingTransientError' | 'BillingError' | 'FulfillmentConfigurationError' | 'FulfillmentOutOfStockError' | 'FulfillmentTransientError' | 'FulfillmentError' | 'CalculatePriceFailed';

/**
* Defines values for ReservationBillingPlan.
* Possible values include: 'Upfront', 'Monthly'
* @readonly
* @enum {string}
*/
export type ReservationBillingPlan = 'Upfront' | 'Monthly';

/**
* Defines values for ReservationTerm.
* Possible values include: 'P1Y', 'P3Y'
Expand All @@ -686,6 +800,14 @@ export type ErrorResponseCode = 'NotSpecified' | 'InternalServerError' | 'Server
*/
export type ReservationTerm = 'P1Y' | 'P3Y';

/**
* Defines values for PaymentStatus.
* Possible values include: 'Succeeded', 'Failed', 'Scheduled', 'Cancelled'
* @readonly
* @enum {string}
*/
export type PaymentStatus = 'Succeeded' | 'Failed' | 'Scheduled' | 'Cancelled';

/**
* Defines values for ReservedResourceType.
* Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat',
Expand Down
Loading