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

[AutoPR reservations/resource-manager] [Hub Generated] Review request for Microsoft.Capacity to add version 2019-04-01 #2035

Merged
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 packages/@azure/arm-reservations/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 4 additions & 7 deletions packages/@azure/arm-reservations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for AzureReservationAPI.

### How to Install

```
```bash
npm install @azure/arm-reservations
```

Expand All @@ -19,13 +19,13 @@ npm install @azure/arm-reservations

##### Install @azure/ms-rest-nodeauth

```
```bash
npm install @azure/ms-rest-nodeauth
```

##### Sample code

```ts
```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
Expand All @@ -50,7 +50,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {

##### Install @azure/ms-rest-browserauth

```
```bash
npm install @azure/ms-rest-browserauth
```

Expand Down Expand Up @@ -100,6 +100,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Farm-reservations%2FREADME.png)
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 = "0.1.0";
const packageVersion = "2.2.0";

export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
Expand All @@ -39,7 +39,7 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {

super(credentials, options);

this.apiVersion = '2018-06-01';
this.apiVersion = '2019-04-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
Expand Down
230 changes: 218 additions & 12 deletions packages/@azure/arm-reservations/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,12 @@ export interface ReservationMergeProperties {
export interface ReservationProperties {
/**
* @member {ReservedResourceType} [reservedResourceType] Possible values
* include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb',
* 'RedHat'
* include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb'
*/
reservedResourceType?: ReservedResourceType;
/**
* @member {InstanceFlexibility} [instanceFlexibility] Possible values
* include: 'On', 'Off', 'NotSupported'
* include: 'True', 'False'
*/
instanceFlexibility?: InstanceFlexibility;
/**
Expand All @@ -190,8 +189,7 @@ export interface ReservationProperties {
*/
appliedScopeType?: AppliedScopeType;
/**
* @member {number} [quantity] Quantity of the SKUs that are part of the
* Reservation.
* @member {number} [quantity]
*/
quantity?: number;
/**
Expand Down Expand Up @@ -322,8 +320,7 @@ export interface ReservationOrderResponse extends BaseResource {
*/
expiryDate?: Date;
/**
* @member {number} [originalQuantity] Total Quantity of the SKUs purchased
* in the Reservation.
* @member {number} [originalQuantity]
*/
originalQuantity?: number;
/**
Expand All @@ -347,6 +344,106 @@ export interface ReservationOrderResponse extends BaseResource {
readonly type?: string;
}

/**
* @interface
* An interface representing CalculatePriceResponsePropertiesBillingCurrencyTotal.
* Currency and amount that customer will be charged in customer's local
* currency. Tax is not included.
*
*/
export interface CalculatePriceResponsePropertiesBillingCurrencyTotal {
/**
* @member {string} [currencyCode]
*/
currencyCode?: string;
/**
* @member {number} [amount]
*/
amount?: number;
}

/**
* @interface
* An interface representing CalculatePriceResponsePropertiesPricingCurrencyTotal.
* Amount that Microsoft uses for record. Used during refund for calculating
* refund limit. Tax is not included.
*
*/
export interface CalculatePriceResponsePropertiesPricingCurrencyTotal {
/**
* @member {string} [currencyCode]
*/
currencyCode?: string;
/**
* @member {number} [amount]
*/
amount?: number;
}

/**
* @interface
* An interface representing CalculatePriceResponseProperties.
*/
export interface CalculatePriceResponseProperties {
/**
* @member {CalculatePriceResponsePropertiesBillingCurrencyTotal}
* [billingCurrencyTotal] Currency and amount that customer will be charged
* in customer's local currency. Tax is not included.
*/
billingCurrencyTotal?: CalculatePriceResponsePropertiesBillingCurrencyTotal;
/**
* @member {boolean} [isBillingPartnerManaged] True if billing is managed by
* Microsoft Partner. Used only for CSP accounts.
*/
isBillingPartnerManaged?: boolean;
/**
* @member {string} [reservationOrderId] GUID that represents reservation
* order that can be placed after calculating price.
*/
reservationOrderId?: string;
/**
* @member {string} [skuTitle] Title of SKU that is being purchased.
*/
skuTitle?: string;
/**
* @member {string} [skuDescription] Description of SKU that is being
* purchased.
*/
skuDescription?: string;
/**
* @member {CalculatePriceResponsePropertiesPricingCurrencyTotal}
* [pricingCurrencyTotal] Amount that Microsoft uses for record. Used during
* refund for calculating refund limit. Tax is not included.
*/
pricingCurrencyTotal?: CalculatePriceResponsePropertiesPricingCurrencyTotal;
}

/**
* @interface
* An interface representing CalculatePriceResponse.
*/
export interface CalculatePriceResponse {
/**
* @member {CalculatePriceResponseProperties} [properties]
*/
properties?: CalculatePriceResponseProperties;
}

/**
* @interface
* An interface representing PurchaseRequestPropertiesReservedResourceProperties.
* Properties specific to each reserved resource type. Not required if not
* applicable.
*
*/
export interface PurchaseRequestPropertiesReservedResourceProperties {
/**
* @member {InstanceFlexibility} [instanceFlexibility] Possible values
* include: 'True', 'False'
*/
instanceFlexibility?: InstanceFlexibility;
}

/**
* @interface
* An interface representing MergeRequest.
Expand All @@ -359,6 +456,58 @@ export interface MergeRequest {
sources?: string[];
}

/**
* @interface
* An interface representing PurchaseRequest.
*/
export interface PurchaseRequest {
/**
* @member {SkuName} [sku]
*/
sku?: SkuName;
/**
* @member {string} [location] The Azure Region where the reserved resource
* lives.
*/
location?: string;
/**
* @member {ReservedResourceType} [reservedResourceType] Possible values
* include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb'
*/
reservedResourceType?: ReservedResourceType;
/**
* @member {string} [billingScopeId]
*/
billingScopeId?: string;
/**
* @member {ReservationTerm} [term] Possible values include: 'P1Y', 'P3Y'
*/
term?: ReservationTerm;
/**
* @member {number} [quantity]
*/
quantity?: number;
/**
* @member {string} [displayName] Friendly name of the Reservation
*/
displayName?: string;
/**
* @member {AppliedScopeType} [appliedScopeType] Possible values include:
* 'Single', 'Shared'
*/
appliedScopeType?: AppliedScopeType;
/**
* @member {string[]} [appliedScopes]
*/
appliedScopes?: string[];
/**
* @member {PurchaseRequestPropertiesReservedResourceProperties}
* [reservedResourceProperties] Properties specific to each reserved resource
* type. Not required if not applicable.
*/
reservedResourceProperties?: PurchaseRequestPropertiesReservedResourceProperties;
}

/**
* @interface
* An interface representing Patch.
Expand All @@ -375,7 +524,7 @@ export interface Patch {
appliedScopes?: string[];
/**
* @member {InstanceFlexibility} [instanceFlexibility] Possible values
* include: 'On', 'Off', 'NotSupported'
* include: 'True', 'False'
*/
instanceFlexibility?: InstanceFlexibility;
/**
Expand Down Expand Up @@ -649,19 +798,19 @@ export type ReservationTerm = 'P1Y' | 'P3Y';

/**
* Defines values for ReservedResourceType.
* Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat'
* Possible values include: 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb'
* @readonly
* @enum {string}
*/
export type ReservedResourceType = 'VirtualMachines' | 'SqlDatabases' | 'SuseLinux' | 'CosmosDb' | 'RedHat';
export type ReservedResourceType = 'VirtualMachines' | 'SqlDatabases' | 'SuseLinux' | 'CosmosDb';

/**
* Defines values for InstanceFlexibility.
* Possible values include: 'On', 'Off', 'NotSupported'
* Possible values include: 'True', 'False'
* @readonly
* @enum {string}
*/
export type InstanceFlexibility = 'On' | 'Off' | 'NotSupported';
export type InstanceFlexibility = 'True' | 'False';

/**
* Defines values for AppliedScopeType.
Expand Down Expand Up @@ -709,6 +858,25 @@ export type GetAppliedReservationListResponse = AppliedReservations & {
};
};

/**
* Contains response data for the calculate operation.
*/
export type ReservationOrderCalculateResponse = CalculatePriceResponse & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: CalculatePriceResponse;
};
};

/**
* Contains response data for the list operation.
*/
Expand All @@ -728,6 +896,25 @@ export type ReservationOrderListResponse = ReservationOrderList & {
};
};

/**
* Contains response data for the purchase operation.
*/
export type ReservationOrderPurchaseResponse = ReservationOrderResponse & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ReservationOrderResponse;
};
};

/**
* Contains response data for the get operation.
*/
Expand All @@ -747,6 +934,25 @@ export type ReservationOrderGetResponse = ReservationOrderResponse & {
};
};

/**
* Contains response data for the beginPurchase operation.
*/
export type ReservationOrderBeginPurchaseResponse = ReservationOrderResponse & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ReservationOrderResponse;
};
};

/**
* Contains response data for the listNext operation.
*/
Expand Down
Loading