From a5516ab23df20137594422eff56956d6e3ad6362 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 9 Nov 2020 11:50:26 +0000 Subject: [PATCH] Generated from 0e3888663995ddcf2a83f45727b2342b0226d4c4 --- sdk/devops/arm-devops/LICENSE.txt | 21 + sdk/devops/arm-devops/README.md | 98 +++ sdk/devops/arm-devops/package.json | 58 ++ sdk/devops/arm-devops/rollup.config.js | 37 ++ sdk/devops/arm-devops/src/devOpsClient.ts | 46 ++ .../arm-devops/src/devOpsClientContext.ts | 62 ++ sdk/devops/arm-devops/src/models/index.ts | 570 ++++++++++++++++++ sdk/devops/arm-devops/src/models/mappers.ts | 540 +++++++++++++++++ .../src/models/operationsMappers.ts | 13 + .../arm-devops/src/models/parameters.ts | 72 +++ .../pipelineTemplateDefinitionsMappers.ts | 15 + .../arm-devops/src/models/pipelinesMappers.ts | 22 + sdk/devops/arm-devops/src/operations/index.ts | 12 + .../arm-devops/src/operations/operations.ts | 125 ++++ .../operations/pipelineTemplateDefinitions.ts | 125 ++++ .../arm-devops/src/operations/pipelines.ts | 481 +++++++++++++++ sdk/devops/arm-devops/tsconfig.json | 19 + 17 files changed, 2316 insertions(+) create mode 100644 sdk/devops/arm-devops/LICENSE.txt create mode 100644 sdk/devops/arm-devops/README.md create mode 100644 sdk/devops/arm-devops/package.json create mode 100644 sdk/devops/arm-devops/rollup.config.js create mode 100644 sdk/devops/arm-devops/src/devOpsClient.ts create mode 100644 sdk/devops/arm-devops/src/devOpsClientContext.ts create mode 100644 sdk/devops/arm-devops/src/models/index.ts create mode 100644 sdk/devops/arm-devops/src/models/mappers.ts create mode 100644 sdk/devops/arm-devops/src/models/operationsMappers.ts create mode 100644 sdk/devops/arm-devops/src/models/parameters.ts create mode 100644 sdk/devops/arm-devops/src/models/pipelineTemplateDefinitionsMappers.ts create mode 100644 sdk/devops/arm-devops/src/models/pipelinesMappers.ts create mode 100644 sdk/devops/arm-devops/src/operations/index.ts create mode 100644 sdk/devops/arm-devops/src/operations/operations.ts create mode 100644 sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts create mode 100644 sdk/devops/arm-devops/src/operations/pipelines.ts create mode 100644 sdk/devops/arm-devops/tsconfig.json diff --git a/sdk/devops/arm-devops/LICENSE.txt b/sdk/devops/arm-devops/LICENSE.txt new file mode 100644 index 000000000000..ea8fb1516028 --- /dev/null +++ b/sdk/devops/arm-devops/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/devops/arm-devops/README.md b/sdk/devops/arm-devops/README.md new file mode 100644 index 000000000000..f6e369cf1121 --- /dev/null +++ b/sdk/devops/arm-devops/README.md @@ -0,0 +1,98 @@ +## Azure DevOpsClient SDK for JavaScript + +This package contains an isomorphic SDK for DevOpsClient. + +### Currently supported environments + +- Node.js version 6.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install @azure/arm-devops +``` + +### How to use + +#### nodejs - client creation and list operations as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" +``` + +##### Sample code + +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { DevOpsClient } = require("@azure/arm-devops"); +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new DevOpsClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +#### browser - Authentication, client creation and list operations as an example written in JavaScript. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-devops sample + + + + + + + + +``` + +## 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/devops/arm-devops/README.png) diff --git a/sdk/devops/arm-devops/package.json b/sdk/devops/arm-devops/package.json new file mode 100644 index 000000000000..75869c623780 --- /dev/null +++ b/sdk/devops/arm-devops/package.json @@ -0,0 +1,58 @@ +{ + "name": "@azure/arm-devops", + "author": "Microsoft Corporation", + "description": "DevOpsClient Library with typescript type definitions for node.js and browser.", + "version": "1.0.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-devops.js", + "module": "./esm/devOpsClient.js", + "types": "./esm/devOpsClient.d.ts", + "devDependencies": { + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/devops/arm-devops", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-devops.js.map'\" -o ./dist/arm-devops.min.js ./dist/arm-devops.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/sdk/devops/arm-devops/rollup.config.js b/sdk/devops/arm-devops/rollup.config.js new file mode 100644 index 000000000000..601dbf4c259c --- /dev/null +++ b/sdk/devops/arm-devops/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/devOpsClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-devops.js", + format: "umd", + name: "Azure.ArmDevops", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@azure/ms-rest-azure-js": "msRestAzure" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/devops/arm-devops/src/devOpsClient.ts b/sdk/devops/arm-devops/src/devOpsClient.ts new file mode 100644 index 000000000000..f2e08c7827a9 --- /dev/null +++ b/sdk/devops/arm-devops/src/devOpsClient.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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 operations from "./operations"; +import { DevOpsClientContext } from "./devOpsClientContext"; + + +class DevOpsClient extends DevOpsClientContext { + // Operation groups + operations: operations.Operations; + pipelineTemplateDefinitions: operations.PipelineTemplateDefinitions; + pipelines: operations.Pipelines; + + /** + * Initializes a new instance of the DevOpsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Unique identifier of the Azure subscription. This is a GUID-formatted + * string (e.g. 00000000-0000-0000-0000-000000000000). + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DevOpsClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.pipelineTemplateDefinitions = new operations.PipelineTemplateDefinitions(this); + this.pipelines = new operations.Pipelines(this); + } +} + +// Operation Specifications + +export { + DevOpsClient, + DevOpsClientContext, + Models as DevOpsModels, + Mappers as DevOpsMappers +}; +export * from "./operations"; diff --git a/sdk/devops/arm-devops/src/devOpsClientContext.ts b/sdk/devops/arm-devops/src/devOpsClientContext.ts new file mode 100644 index 000000000000..44a837de0c36 --- /dev/null +++ b/sdk/devops/arm-devops/src/devOpsClientContext.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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-devops"; +const packageVersion = "1.0.0"; + +export class DevOpsClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the DevOpsClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Unique identifier of the Azure subscription. This is a GUID-formatted + * string (e.g. 00000000-0000-0000-0000-000000000000). + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DevOpsClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-07-01-preview'; + 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; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/devops/arm-devops/src/models/index.ts b/sdk/devops/arm-devops/src/models/index.ts new file mode 100644 index 000000000000..a4b18cebf955 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/index.ts @@ -0,0 +1,570 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + +/** + * Properties of an Operation. + */ +export interface Operation { + /** + * Name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Indicates whether the operation applies to data-plane. + */ + isDataAction?: string; + /** + * Friendly name of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * Friendly name of the resource type the operation applies to. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly resource?: string; + /** + * Friendly description of the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; + /** + * Friendly name of the resource provider. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provider?: string; +} + +/** + * Representation of a pipeline template input parameter value. + */ +export interface InputValue { + /** + * Value of an input parameter. + */ + value?: string; + /** + * Description of the input parameter value. + */ + displayValue?: string; +} + +/** + * Representation of a pipeline template input parameter. + */ +export interface InputDescriptor { + /** + * Identifier of the input parameter. + */ + id: string; + /** + * Description of the input parameter. + */ + description?: string; + /** + * Data type of the value of the input parameter. Possible values include: 'String', + * 'SecureString', 'Int', 'Bool', 'Authorization' + */ + type: InputDataType; + /** + * List of possible values for the input parameter. + */ + possibleValues?: InputValue[]; +} + +/** + * Definition of a pipeline template. + */ +export interface PipelineTemplateDefinition { + /** + * Unique identifier of the pipeline template. + */ + id: string; + /** + * Description of the pipeline enabled by the template. + */ + description?: string; + /** + * List of input parameters required by the template to create a pipeline. + */ + inputs?: InputDescriptor[]; +} + +/** + * Reference to an Azure DevOps Organization. + */ +export interface OrganizationReference { + /** + * Unique immutable identifier for the Azure DevOps Organization. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Name of the Azure DevOps Organization. + */ + name: string; +} + +/** + * Reference to an Azure DevOps Project. + */ +export interface ProjectReference { + /** + * Unique immutable identifier of the Azure DevOps Project. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Name of the Azure DevOps Project. + */ + name: string; +} + +/** + * Authorization info used to access a resource (like code repository). + */ +export interface Authorization { + /** + * Authorization parameters corresponding to the authorization type. + */ + parameters?: { [propertyName: string]: string }; +} + +/** + * Repository containing the source code for a pipeline. + */ +export interface CodeRepository { + /** + * Type of code repository. Possible values include: 'gitHub', 'vstsGit' + */ + repositoryType: CodeRepositoryType; + /** + * Unique immutable identifier of the code repository. + */ + id: string; + /** + * Default branch used to configure Continuous Integration (CI) in the pipeline. + */ + defaultBranch: string; + /** + * Authorization info to access the code repository. + */ + authorization?: Authorization; + /** + * Repository-specific properties. + */ + properties?: { [propertyName: string]: string }; +} + +/** + * Template used to bootstrap the pipeline. + */ +export interface PipelineTemplate { + /** + * Unique identifier of the pipeline template. + */ + id: string; + /** + * Dictionary of input parameters used in the pipeline template. + */ + parameters?: { [propertyName: string]: string }; +} + +/** + * Configuration used to bootstrap a Pipeline. + */ +export interface BootstrapConfiguration { + /** + * Repository containing the source code for the pipeline. + */ + repository?: CodeRepository; + /** + * Template used to bootstrap the pipeline. + */ + template: PipelineTemplate; +} + +/** + * An Azure Resource Manager (ARM) resource. + */ +export interface Resource extends BaseResource { + /** + * Resource Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Resource Type + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Resource Tags + */ + tags?: { [propertyName: string]: string }; + /** + * Resource Location + */ + location?: string; + /** + * Resource Name + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; +} + +/** + * Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) + * for Azure resources. + */ +export interface PipelineModel extends Resource { + /** + * Unique identifier of the Azure Pipeline within the Azure DevOps Project. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly pipelineId?: number; + /** + * Reference to the Azure DevOps Organization containing the Pipeline. + */ + organization: OrganizationReference; + /** + * Reference to the Azure DevOps Project containing the Pipeline. + */ + project: ProjectReference; + /** + * Configuration used to bootstrap the Pipeline. + */ + bootstrapConfiguration: BootstrapConfiguration; +} + +/** + * Request payload used to update an existing Azure Pipeline. + */ +export interface PipelineUpdateParameters { + /** + * Dictionary of key-value pairs to be set as tags on the Azure Pipeline. This will overwrite any + * existing tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Optional Parameters. + */ +export interface PipelinesUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * Dictionary of key-value pairs to be set as tags on the Azure Pipeline. This will overwrite any + * existing tags. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * An interface representing DevOpsClientOptions. + */ +export interface DevOpsClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * @interface + * Result of a request to list all operations supported by Microsoft.DevOps resource provider. + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * The URL to get the next set of operations, if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * Result of a request to list all pipeline template definitions. + * @extends Array + */ +export interface PipelineTemplateDefinitionListResult extends Array { + /** + * The URL to get the next set of pipeline template definitions, if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * Result of a request to list all Azure Pipelines under a given scope. + * @extends Array + */ +export interface PipelineListResult extends Array { + /** + * URL to get the next set of Pipelines, if there are any. + */ + nextLink?: string; +} + +/** + * Defines values for InputDataType. + * Possible values include: 'String', 'SecureString', 'Int', 'Bool', 'Authorization' + * @readonly + * @enum {string} + */ +export type InputDataType = 'String' | 'SecureString' | 'Int' | 'Bool' | 'Authorization'; + +/** + * Defines values for CodeRepositoryType. + * Possible values include: 'gitHub', 'vstsGit' + * @readonly + * @enum {string} + */ +export type CodeRepositoryType = 'gitHub' | 'vstsGit'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PipelineTemplateDefinitionsListResponse = PipelineTemplateDefinitionListResult & { + /** + * 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: PipelineTemplateDefinitionListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type PipelineTemplateDefinitionsListNextResponse = PipelineTemplateDefinitionListResult & { + /** + * 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: PipelineTemplateDefinitionListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PipelinesCreateOrUpdateResponse = PipelineModel & { + /** + * 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: PipelineModel; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PipelinesGetResponse = PipelineModel & { + /** + * 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: PipelineModel; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PipelinesUpdateResponse = PipelineModel & { + /** + * 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: PipelineModel; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type PipelinesListByResourceGroupResponse = PipelineListResult & { + /** + * 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: PipelineListResult; + }; +}; + +/** + * Contains response data for the listBySubscription operation. + */ +export type PipelinesListBySubscriptionResponse = PipelineListResult & { + /** + * 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: PipelineListResult; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type PipelinesBeginCreateOrUpdateResponse = PipelineModel & { + /** + * 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: PipelineModel; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type PipelinesListByResourceGroupNextResponse = PipelineListResult & { + /** + * 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: PipelineListResult; + }; +}; + +/** + * Contains response data for the listBySubscriptionNext operation. + */ +export type PipelinesListBySubscriptionNextResponse = PipelineListResult & { + /** + * 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: PipelineListResult; + }; +}; diff --git a/sdk/devops/arm-devops/src/models/mappers.ts b/sdk/devops/arm-devops/src/models/mappers.ts new file mode 100644 index 000000000000..355da97b1641 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/mappers.ts @@ -0,0 +1,540 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "display.operation", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "display.resource", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "display.description", + type: { + name: "String" + } + }, + provider: { + readOnly: true, + serializedName: "display.provider", + type: { + name: "String" + } + } + } + } +}; + +export const InputValue: msRest.CompositeMapper = { + serializedName: "InputValue", + type: { + name: "Composite", + className: "InputValue", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + displayValue: { + serializedName: "displayValue", + type: { + name: "String" + } + } + } + } +}; + +export const InputDescriptor: msRest.CompositeMapper = { + serializedName: "InputDescriptor", + type: { + name: "Composite", + className: "InputDescriptor", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + possibleValues: { + serializedName: "possibleValues", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InputValue" + } + } + } + } + } + } +}; + +export const PipelineTemplateDefinition: msRest.CompositeMapper = { + serializedName: "PipelineTemplateDefinition", + type: { + name: "Composite", + className: "PipelineTemplateDefinition", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + inputs: { + serializedName: "inputs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InputDescriptor" + } + } + } + } + } + } +}; + +export const OrganizationReference: msRest.CompositeMapper = { + serializedName: "OrganizationReference", + type: { + name: "Composite", + className: "OrganizationReference", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const ProjectReference: msRest.CompositeMapper = { + serializedName: "ProjectReference", + type: { + name: "Composite", + className: "ProjectReference", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Authorization: msRest.CompositeMapper = { + serializedName: "Authorization", + type: { + name: "Composite", + className: "Authorization", + modelProperties: { + authorizationType: { + required: true, + isConstant: true, + serializedName: "authorizationType", + defaultValue: 'personalAccessToken', + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const CodeRepository: msRest.CompositeMapper = { + serializedName: "CodeRepository", + type: { + name: "Composite", + className: "CodeRepository", + modelProperties: { + repositoryType: { + required: true, + serializedName: "repositoryType", + type: { + name: "String" + } + }, + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + defaultBranch: { + required: true, + serializedName: "defaultBranch", + type: { + name: "String" + } + }, + authorization: { + serializedName: "authorization", + type: { + name: "Composite", + className: "Authorization" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PipelineTemplate: msRest.CompositeMapper = { + serializedName: "PipelineTemplate", + type: { + name: "Composite", + className: "PipelineTemplate", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const BootstrapConfiguration: msRest.CompositeMapper = { + serializedName: "BootstrapConfiguration", + type: { + name: "Composite", + className: "BootstrapConfiguration", + modelProperties: { + repository: { + serializedName: "repository", + type: { + name: "Composite", + className: "CodeRepository" + } + }, + template: { + required: true, + serializedName: "template", + type: { + name: "Composite", + className: "PipelineTemplate" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const PipelineModel: msRest.CompositeMapper = { + serializedName: "Pipeline", + type: { + name: "Composite", + className: "PipelineModel", + modelProperties: { + ...Resource.type.modelProperties, + pipelineId: { + readOnly: true, + serializedName: "properties.pipelineId", + type: { + name: "Number" + } + }, + organization: { + required: true, + serializedName: "properties.organization", + type: { + name: "Composite", + className: "OrganizationReference" + } + }, + project: { + required: true, + serializedName: "properties.project", + type: { + name: "Composite", + className: "ProjectReference" + } + }, + bootstrapConfiguration: { + required: true, + serializedName: "properties.bootstrapConfiguration", + defaultValue: {}, + type: { + name: "Composite", + className: "BootstrapConfiguration" + } + } + } + } +}; + +export const PipelineUpdateParameters: msRest.CompositeMapper = { + serializedName: "PipelineUpdateParameters", + type: { + name: "Composite", + className: "PipelineUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + readOnly: true, + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PipelineTemplateDefinitionListResult: msRest.CompositeMapper = { + serializedName: "PipelineTemplateDefinitionListResult", + type: { + name: "Composite", + className: "PipelineTemplateDefinitionListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PipelineTemplateDefinition" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const PipelineListResult: msRest.CompositeMapper = { + serializedName: "PipelineListResult", + type: { + name: "Composite", + className: "PipelineListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PipelineModel" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/devops/arm-devops/src/models/operationsMappers.ts b/sdk/devops/arm-devops/src/models/operationsMappers.ts new file mode 100644 index 000000000000..a401123dc90d --- /dev/null +++ b/sdk/devops/arm-devops/src/models/operationsMappers.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + CloudError, + Operation, + OperationListResult +} from "../models/mappers"; diff --git a/sdk/devops/arm-devops/src/models/parameters.ts b/sdk/devops/arm-devops/src/models/parameters.ts new file mode 100644 index 000000000000..ca89a2c24aa2 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/parameters.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const pipelineName: msRest.OperationURLParameter = { + parameterPath: "pipelineName", + mapper: { + required: true, + serializedName: "pipelineName", + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/devops/arm-devops/src/models/pipelineTemplateDefinitionsMappers.ts b/sdk/devops/arm-devops/src/models/pipelineTemplateDefinitionsMappers.ts new file mode 100644 index 000000000000..549243aa889b --- /dev/null +++ b/sdk/devops/arm-devops/src/models/pipelineTemplateDefinitionsMappers.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + CloudError, + InputDescriptor, + InputValue, + PipelineTemplateDefinition, + PipelineTemplateDefinitionListResult +} from "../models/mappers"; diff --git a/sdk/devops/arm-devops/src/models/pipelinesMappers.ts b/sdk/devops/arm-devops/src/models/pipelinesMappers.ts new file mode 100644 index 000000000000..8ed98bf4a481 --- /dev/null +++ b/sdk/devops/arm-devops/src/models/pipelinesMappers.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + Authorization, + BaseResource, + BootstrapConfiguration, + CloudError, + CodeRepository, + OrganizationReference, + PipelineListResult, + PipelineModel, + PipelineTemplate, + PipelineUpdateParameters, + ProjectReference, + Resource +} from "../models/mappers"; diff --git a/sdk/devops/arm-devops/src/operations/index.ts b/sdk/devops/arm-devops/src/operations/index.ts new file mode 100644 index 000000000000..e4f1bdc1cce0 --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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"; +export * from "./pipelineTemplateDefinitions"; +export * from "./pipelines"; diff --git a/sdk/devops/arm-devops/src/operations/operations.ts b/sdk/devops/arm-devops/src/operations/operations.ts new file mode 100644 index 000000000000..ea637037d06e --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/operations.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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 { DevOpsClientContext } from "../devOpsClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: DevOpsClientContext; + + /** + * Create a Operations. + * @param {DevOpsClientContext} client Reference to the service client. + */ + constructor(client: DevOpsClientContext) { + this.client = client; + } + + /** + * Lists all the operations supported by Microsoft.DevOps resource provider. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all the operations supported by Microsoft.DevOps resource provider. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.DevOps/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts b/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts new file mode 100644 index 000000000000..55221cf612ca --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/pipelineTemplateDefinitions.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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/pipelineTemplateDefinitionsMappers"; +import * as Parameters from "../models/parameters"; +import { DevOpsClientContext } from "../devOpsClientContext"; + +/** Class representing a PipelineTemplateDefinitions. */ +export class PipelineTemplateDefinitions { + private readonly client: DevOpsClientContext; + + /** + * Create a PipelineTemplateDefinitions. + * @param {DevOpsClientContext} client Reference to the service client. + */ + constructor(client: DevOpsClientContext) { + this.client = client; + } + + /** + * Lists all pipeline templates which can be used to configure an Azure Pipeline. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all pipeline templates which can be used to configure an Azure Pipeline. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.DevOps/pipelineTemplateDefinitions", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineTemplateDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineTemplateDefinitionListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/devops/arm-devops/src/operations/pipelines.ts b/sdk/devops/arm-devops/src/operations/pipelines.ts new file mode 100644 index 000000000000..4cdf8f6374e7 --- /dev/null +++ b/sdk/devops/arm-devops/src/operations/pipelines.ts @@ -0,0 +1,481 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/pipelinesMappers"; +import * as Parameters from "../models/parameters"; +import { DevOpsClientContext } from "../devOpsClientContext"; + +/** Class representing a Pipelines. */ +export class Pipelines { + private readonly client: DevOpsClientContext; + + /** + * Create a Pipelines. + * @param {DevOpsClientContext} client Reference to the service client. + */ + constructor(client: DevOpsClientContext) { + this.client = client; + } + + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, pipelineName: string, createOperationParameters: Models.PipelineModel, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,pipelineName,createOperationParameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets an existing Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, pipelineName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param callback The callback + */ + get(resourceGroupName: string, pipelineName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, pipelineName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, pipelineName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + pipelineName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates the properties of an Azure Pipeline. Currently, only tags can be updated. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, pipelineName: string, options?: Models.PipelinesUpdateOptionalParams): Promise; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param callback The callback + */ + update(resourceGroupName: string, pipelineName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, pipelineName: string, options: Models.PipelinesUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, pipelineName: string, options?: Models.PipelinesUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + pipelineName, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, pipelineName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, pipelineName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, pipelineName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, pipelineName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + pipelineName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Lists all Azure Pipelines under the specified resource group. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Lists all Azure Pipelines under the specified subscription. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscription(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listBySubscription(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listBySubscription(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscription(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listBySubscriptionOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates an Azure Pipeline. + * @param resourceGroupName Name of the resource group within the Azure subscription. + * @param pipelineName The name of the Azure Pipeline resource in ARM. + * @param createOperationParameters The request payload to create the Azure Pipeline. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, pipelineName: string, createOperationParameters: Models.PipelineModel, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + pipelineName, + createOperationParameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Lists all Azure Pipelines under the specified resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } + + /** + * Lists all Azure Pipelines under the specified subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listBySubscriptionNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listBySubscriptionNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listBySubscriptionNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineModel + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + tags: [ + "options", + "tags" + ] + }, + mapper: { + ...Mappers.PipelineUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PipelineModel + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DevOps/pipelines", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOps/pipelines/{pipelineName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.pipelineName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "createOperationParameters", + mapper: { + ...Mappers.PipelineModel, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PipelineModel + }, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PipelineListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/devops/arm-devops/tsconfig.json b/sdk/devops/arm-devops/tsconfig.json new file mode 100644 index 000000000000..422b584abd5e --- /dev/null +++ b/sdk/devops/arm-devops/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +}