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 @azure/arm-reservations] fix: reservations model validation #4447

Closed
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
10 changes: 6 additions & 4 deletions sdk/reservations/arm-reservations/README.md
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@ npm install @azure/ms-rest-nodeauth
##### Sample code

```typescript
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as coreHttp from "@azure/core-http";
import * as coreArm from "@azure/core-arm";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { AzureReservationAPI, AzureReservationAPIModels, AzureReservationAPIMappers } from "@azure/arm-reservations";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
@@ -64,8 +64,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<html lang="en">
<head>
<title>@azure/arm-reservations sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/core-http/dist/coreHttp.browser.js"></script>
<script src="node_modules/@azure/core-arm/dist/coreArm.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-reservations/dist/arm-reservations.js"></script>
<script type="text/javascript">
@@ -100,3 +100,5 @@ 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/sdk/reservations/arm-reservations/README.png)
10 changes: 5 additions & 5 deletions sdk/reservations/arm-reservations/package.json
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
"description": "AzureReservationAPI Library with typescript type definitions for node.js and browser.",
"version": "2.3.0",
"dependencies": {
"@azure/ms-rest-azure-js": "^1.3.2",
"@azure/ms-rest-js": "^1.8.1",
"@azure/core-arm": "^1.0.0-preview.1",
"@azure/core-http": "^1.0.0-preview.1",
"tslib": "^1.9.3"
},
"keywords": [
@@ -26,13 +26,13 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
},
"homepage": "https://github.com/azure/azure-sdk-for-js",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/reservations/arm-reservations",
"repository": {
"type": "git",
"url": "https://github.com/azure/azure-sdk-for-js.git"
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/azure/azure-sdk-for-js/issues"
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
8 changes: 4 additions & 4 deletions sdk/reservations/arm-reservations/rollup.config.js
Original file line number Diff line number Diff line change
@@ -8,17 +8,17 @@ import sourcemaps from "rollup-plugin-sourcemaps";
const config = {
input: "./esm/azureReservationAPI.js",
external: [
"@azure/ms-rest-js",
"@azure/ms-rest-azure-js"
"@azure/core-http",
"@azure/core-arm"
],
output: {
file: "./dist/arm-reservations.js",
format: "umd",
name: "Azure.ArmReservations",
sourcemap: true,
globals: {
"@azure/ms-rest-js": "msRest",
"@azure/ms-rest-azure-js": "msRestAzure"
"@azure/core-http": "coreHttp",
"@azure/core-arm": "coreArm"
},
banner: `/*
* Copyright (c) Microsoft Corporation. All rights reserved.
24 changes: 12 additions & 12 deletions sdk/reservations/arm-reservations/src/azureReservationAPI.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as coreHttp from "@azure/core-http";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
@@ -27,7 +27,7 @@ class AzureReservationAPI extends AzureReservationAPIContext {
* @param credentials Credentials needed for the client to connect to Azure.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) {
constructor(credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) {
super(credentials, options);
this.reservationOrder = new operations.ReservationOrder(this);
this.reservation = new operations.Reservation(this);
@@ -48,15 +48,15 @@ class AzureReservationAPI extends AzureReservationAPIContext {
* @param reservedResourceType The type of the resource for which the skus should be provided.
* @param callback The callback
*/
getCatalog(subscriptionId: string, reservedResourceType: string, callback: msRest.ServiceCallback<Models.Catalog[]>): void;
getCatalog(subscriptionId: string, reservedResourceType: string, callback: coreHttp.ServiceCallback<Models.Catalog[]>): void;
/**
* @param subscriptionId Id of the subscription
* @param reservedResourceType The type of the resource for which the skus should be provided.
* @param options The optional parameters
* @param callback The callback
*/
getCatalog(subscriptionId: string, reservedResourceType: string, options: Models.AzureReservationAPIGetCatalogOptionalParams, callback: msRest.ServiceCallback<Models.Catalog[]>): void;
getCatalog(subscriptionId: string, reservedResourceType: string, options?: Models.AzureReservationAPIGetCatalogOptionalParams | msRest.ServiceCallback<Models.Catalog[]>, callback?: msRest.ServiceCallback<Models.Catalog[]>): Promise<Models.GetCatalogResponse> {
getCatalog(subscriptionId: string, reservedResourceType: string, options: Models.AzureReservationAPIGetCatalogOptionalParams, callback: coreHttp.ServiceCallback<Models.Catalog[]>): void;
getCatalog(subscriptionId: string, reservedResourceType: string, options?: Models.AzureReservationAPIGetCatalogOptionalParams | coreHttp.ServiceCallback<Models.Catalog[]>, callback?: coreHttp.ServiceCallback<Models.Catalog[]>): Promise<Models.GetCatalogResponse> {
return this.sendOperationRequest(
{
subscriptionId,
@@ -74,19 +74,19 @@ class AzureReservationAPI extends AzureReservationAPIContext {
* @param [options] The optional parameters
* @returns Promise<Models.GetAppliedReservationListResponse>
*/
getAppliedReservationList(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise<Models.GetAppliedReservationListResponse>;
getAppliedReservationList(subscriptionId: string, options?: coreHttp.RequestOptionsBase): Promise<Models.GetAppliedReservationListResponse>;
/**
* @param subscriptionId Id of the subscription
* @param callback The callback
*/
getAppliedReservationList(subscriptionId: string, callback: msRest.ServiceCallback<Models.AppliedReservations>): void;
getAppliedReservationList(subscriptionId: string, callback: coreHttp.ServiceCallback<Models.AppliedReservations>): void;
/**
* @param subscriptionId Id of the subscription
* @param options The optional parameters
* @param callback The callback
*/
getAppliedReservationList(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.AppliedReservations>): void;
getAppliedReservationList(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.AppliedReservations>, callback?: msRest.ServiceCallback<Models.AppliedReservations>): Promise<Models.GetAppliedReservationListResponse> {
getAppliedReservationList(subscriptionId: string, options: coreHttp.RequestOptionsBase, callback: coreHttp.ServiceCallback<Models.AppliedReservations>): void;
getAppliedReservationList(subscriptionId: string, options?: coreHttp.RequestOptionsBase | coreHttp.ServiceCallback<Models.AppliedReservations>, callback?: coreHttp.ServiceCallback<Models.AppliedReservations>): Promise<Models.GetAppliedReservationListResponse> {
return this.sendOperationRequest(
{
subscriptionId,
@@ -98,8 +98,8 @@ class AzureReservationAPI extends AzureReservationAPIContext {
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const getCatalogOperationSpec: msRest.OperationSpec = {
const serializer = new coreHttp.Serializer(Mappers);
const getCatalogOperationSpec: coreHttp.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs",
urlParameters: [
@@ -135,7 +135,7 @@ const getCatalogOperationSpec: msRest.OperationSpec = {
serializer
};

const getAppliedReservationListOperationSpec: msRest.OperationSpec = {
const getAppliedReservationListOperationSpec: coreHttp.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations",
urlParameters: [
Original file line number Diff line number Diff line change
@@ -9,22 +9,22 @@
*/

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as coreHttp from "@azure/core-http";
import * as coreArm from "@azure/core-arm";

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

export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
export class AzureReservationAPIContext extends coreArm.AzureServiceClient {
credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials;
apiVersion?: string;

/**
* Initializes a new instance of the AzureReservationAPI class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) {
constructor(credentials: coreHttp.TokenCredential | coreHttp.ServiceClientCredentials, options?: Models.AzureReservationAPIOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}
@@ -33,7 +33,7 @@ export class AzureReservationAPIContext extends msRestAzure.AzureServiceClient {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
const defaultUserAgent = coreArm.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

Loading