Skip to content
Closed
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
461 changes: 461 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/models/index.ts

Large diffs are not rendered by default.

571 changes: 571 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/models/mappers.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

export {
discriminators,
OperationListResult,
Operation,
OperationDisplay,
CloudError
} from "../models/mappers";

32 changes: 32 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/models/parameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";

export const acceptLanguage: msRest.OperationParameter = {
parameterPath: "acceptLanguage",
mapper: {
serializedName: "accept-language",
defaultValue: 'en-US',
type: {
name: "String"
}
}
};
export const apiVersion: msRest.OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
required: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
11 changes: 11 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/operations/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

export * from "./operations";
74 changes: 74 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/operations/operations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/operationsMappers";
import * as Parameters from "../models/parameters";
import { ResourceGraphClientContext } from "../resourceGraphClientContext";

/** Class representing a Operations. */
export class Operations {
private readonly client: ResourceGraphClientContext;

/**
* Create a Operations.
* @param {ResourceGraphClientContext} client Reference to the service client.
*/
constructor(client: ResourceGraphClientContext) {
this.client = client;
}

/**
* Lists all of the available REST API operations.
* @param [options] The optional parameters
* @returns Promise<Models.OperationsListResponse>
*/
list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
/**
* @param callback The callback
*/
list(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
/**
* @param options The optional parameters
* @param callback The callback
*/
list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.OperationsListResponse> {
return this.client.sendOperationRequest(
{
options
},
listOperationSpec,
callback) as Promise<Models.OperationsListResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "providers/Microsoft.ResourceGraph/operations",
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.OperationListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};
98 changes: 98 additions & 0 deletions sdk/resourcegraph/arm-resourcegraph/lib/resourceGraphClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
import * as operations from "./operations";
import { ResourceGraphClientContext } from "./resourceGraphClientContext";


class ResourceGraphClient extends ResourceGraphClientContext {
// Operation groups
operations: operations.Operations;

/**
* Initializes a new instance of the ResourceGraphClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ResourceGraphClientOptions) {
super(credentials, options);
this.operations = new operations.Operations(this);
}

/**
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the
* request.
* @param query Request specifying query and its options.
* @param [options] The optional parameters
* @returns Promise<Models.ResourcesResponse>
*/
resources(query: Models.QueryRequest, options?: msRest.RequestOptionsBase): Promise<Models.ResourcesResponse>;
/**
* @param query Request specifying query and its options.
* @param callback The callback
*/
resources(query: Models.QueryRequest, callback: msRest.ServiceCallback<Models.QueryResponse>): void;
/**
* @param query Request specifying query and its options.
* @param options The optional parameters
* @param callback The callback
*/
resources(query: Models.QueryRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.QueryResponse>): void;
resources(query: Models.QueryRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.QueryResponse>, callback?: msRest.ServiceCallback<Models.QueryResponse>): Promise<Models.ResourcesResponse> {
return this.sendOperationRequest(
{
query,
options
},
resourcesOperationSpec,
callback) as Promise<Models.ResourcesResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const resourcesOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "providers/Microsoft.ResourceGraph/resources",
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: "query",
mapper: {
...Mappers.QueryRequest,
required: true
}
},
responses: {
200: {
bodyMapper: Mappers.QueryResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};

export {
ResourceGraphClient,
ResourceGraphClientContext,
Models as ResourceGraphModels,
Mappers as ResourceGraphMappers
};
export * from "./operations";
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as Models from "./models";
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "@azure/arm-resourcegraph";
const packageVersion = "1.0.0";

export class ResourceGraphClientContext extends msRestAzure.AzureServiceClient {
credentials: msRest.ServiceClientCredentials;
apiVersion?: string;

/**
* Initializes a new instance of the ResourceGraphClient class.
* @param credentials Credentials needed for the client to connect to Azure.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ResourceGraphClientOptions) {
if (credentials == undefined) {
throw new Error('\'credentials\' cannot be null.');
}

if (!options) {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2019-04-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;

if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
}
12 changes: 5 additions & 7 deletions sdk/resourcegraph/arm-resourcegraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "ResourceGraphClient Library with typescript type definitions for node.js and browser.",
"version": "1.0.0",
"dependencies": {
"@azure/ms-rest-azure-js": "^1.3.2",
"@azure/ms-rest-js": "^1.6.0",
"@azure/ms-rest-azure-js": "^1.2.0",
"@azure/ms-rest-js": "^1.2.0",
"tslib": "^1.9.3"
},
"keywords": [
Expand All @@ -26,7 +26,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"uglify-js": "^3.4.9"
},
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/resourcegraph/arm-resourcegraph",
"homepage": "https://github.com/azure/azure-sdk-for-js",
"repository": {
"type": "git",
"url": "https://github.com/azure/azure-sdk-for-js.git"
Expand All @@ -43,8 +43,7 @@
"esm/**/*.js.map",
"esm/**/*.d.ts",
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"lib/**/*.ts",
"rollup.config.js",
"tsconfig.json"
],
Expand All @@ -53,6 +52,5 @@
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-resourcegraph.js.map'\" -o ./dist/arm-resourcegraph.min.js ./dist/arm-resourcegraph.js",
"prepack": "npm install && npm run build"
},
"sideEffects": false,
"autoPublish": true
"sideEffects": false
}
2 changes: 1 addition & 1 deletion sdk/resourcegraph/arm-resourcegraph/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"outDir": "./esm",
"importHelpers": true
},
"include": ["./src/**/*.ts"],
"include": ["./lib/**/*.ts"],
"exclude": ["node_modules"]
}