diff --git a/sdk/managementpartner/arm-managementpartner/LICENSE.txt b/sdk/managementpartner/arm-managementpartner/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/managementpartner/arm-managementpartner/LICENSE.txt +++ b/sdk/managementpartner/arm-managementpartner/LICENSE.txt @@ -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 diff --git a/sdk/managementpartner/arm-managementpartner/README.md b/sdk/managementpartner/arm-managementpartner/README.md index 04a812ae6559..ad8d42130cbb 100644 --- a/sdk/managementpartner/arm-managementpartner/README.md +++ b/sdk/managementpartner/arm-managementpartner/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for ACEProvisioningManagementPartnerAPI. ### How to Install -``` +```bash npm install @azure/arm-managementpartner ``` @@ -19,13 +19,13 @@ npm install @azure/arm-managementpartner ##### 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"; @@ -48,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -96,6 +96,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/sdk/managementpartner/arm-managementpartner/README.png) diff --git a/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPI.ts b/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPI.ts new file mode 100644 index 000000000000..4e571aed6ba2 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPI.ts @@ -0,0 +1,45 @@ +/* + * 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 operations from "./operations"; +import { ACEProvisioningManagementPartnerAPIContext } from "./aCEProvisioningManagementPartnerAPIContext"; + + +class ACEProvisioningManagementPartnerAPI extends ACEProvisioningManagementPartnerAPIContext { + // Operation groups + partner: operations.Partner; + operation: operations.Operation; + partners: operations.Partners; + + /** + * Initializes a new instance of the ACEProvisioningManagementPartnerAPI class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ACEProvisioningManagementPartnerAPIOptions) { + super(credentials, options); + this.partner = new operations.Partner(this); + this.operation = new operations.Operation(this); + this.partners = new operations.Partners(this); + } +} + +// Operation Specifications + +export { + ACEProvisioningManagementPartnerAPI, + ACEProvisioningManagementPartnerAPIContext, + Models as ACEProvisioningManagementPartnerAPIModels, + Mappers as ACEProvisioningManagementPartnerAPIMappers +}; +export * from "./operations"; diff --git a/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPIContext.ts b/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPIContext.ts new file mode 100644 index 000000000000..dd467e975047 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/aCEProvisioningManagementPartnerAPIContext.ts @@ -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-managementpartner"; +const packageVersion = "1.1.0"; + +export class ACEProvisioningManagementPartnerAPIContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + apiVersion?: string; + + /** + * Initializes a new instance of the ACEProvisioningManagementPartnerAPI class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, options?: Models.ACEProvisioningManagementPartnerAPIOptions) { + 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 = '2018-02-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; + } + } +} diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/index.ts b/sdk/managementpartner/arm-managementpartner/lib/models/index.ts new file mode 100644 index 000000000000..310d80bd4674 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/index.ts @@ -0,0 +1,318 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing PartnerResponse. + * this is the management partner operations response + * + * @extends BaseResource + */ +export interface PartnerResponse extends BaseResource { + /** + * @member {number} [etag] Type of the partner + */ + etag?: number; + /** + * @member {string} [id] Identifier of the partner + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Name of the partner + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [partnerId] This is the partner id + */ + partnerId?: string; + /** + * @member {string} [partnerName] This is the partner name + */ + partnerName?: string; + /** + * @member {string} [tenantId] This is the tenant id. + */ + tenantId?: string; + /** + * @member {string} [objectId] This is the object id. + */ + objectId?: string; + /** + * @member {string} [version] This is the version. + */ + version?: string; + /** + * @member {Date} [updatedTime] This is the DateTime when the partner was + * updated. + */ + updatedTime?: Date; + /** + * @member {Date} [createdTime] This is the DateTime when the partner was + * created. + */ + createdTime?: Date; + /** + * @member {State} [state] This is the partner state. Possible values + * include: 'Active', 'Deleted' + */ + state?: State; + /** + * @member {string} [type] Type of resource. + * "Microsoft.ManagementPartner/partners" + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing ExtendedErrorInfo. + * this is the extended error info + * + */ +export interface ExtendedErrorInfo { + /** + * @member {Code} [code] this is the error response code. Possible values + * include: 'NotFound', 'Conflict', 'BadRequest' + */ + code?: Code; + /** + * @member {string} [message] this is the extended error info message + */ + message?: string; +} + +/** + * @interface + * An interface representing ErrorModel. + * this is the management partner operations error + * + */ +export interface ErrorModel { + /** + * @member {ExtendedErrorInfo} [error] this is the ExtendedErrorInfo property + */ + error?: ExtendedErrorInfo; +} + +/** + * @interface + * An interface representing OperationDisplay. + * this is the management partner operation + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] the is management partner provider + */ + provider?: string; + /** + * @member {string} [resource] the is management partner resource + */ + resource?: string; + /** + * @member {string} [operation] the is management partner operation + */ + operation?: string; + /** + * @member {string} [description] the is management partner operation + * description + */ + description?: string; +} + +/** + * @interface + * An interface representing OperationResponse. + * this is the management partner operations response + * + */ +export interface OperationResponse { + /** + * @member {string} [name] this is the operation response name + */ + name?: string; + /** + * @member {OperationDisplay} [display] this is the operation display + */ + display?: OperationDisplay; + /** + * @member {string} [origin] the is operation response origin information + */ + origin?: string; +} + +/** + * @interface + * An interface representing ACEProvisioningManagementPartnerAPIOptions. + * @extends AzureServiceClientOptions + */ +export interface ACEProvisioningManagementPartnerAPIOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationList. + * this is the management partner operations list + * + * @extends Array + */ +export interface OperationList extends Array { + /** + * @member {string} [nextLink] Url to get the next page of items. + */ + nextLink?: string; +} + +/** + * Defines values for State. + * Possible values include: 'Active', 'Deleted' + * @readonly + * @enum {string} + */ +export type State = 'Active' | 'Deleted'; + +/** + * Defines values for Code. + * Possible values include: 'NotFound', 'Conflict', 'BadRequest' + * @readonly + * @enum {string} + */ +export type Code = 'NotFound' | 'Conflict' | 'BadRequest'; + +/** + * Contains response data for the get operation. + */ +export type PartnerGetResponse = PartnerResponse & { + /** + * 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: PartnerResponse; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type PartnerCreateResponse = PartnerResponse & { + /** + * 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: PartnerResponse; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PartnerUpdateResponse = PartnerResponse & { + /** + * 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: PartnerResponse; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationListResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationListNextResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PartnersGetResponse = PartnerResponse & { + /** + * 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: PartnerResponse; + }; +}; diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/mappers.ts b/sdk/managementpartner/arm-managementpartner/lib/models/mappers.ts new file mode 100644 index 000000000000..abdba22c5a52 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/mappers.ts @@ -0,0 +1,230 @@ +/* + * 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 { 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 PartnerResponse: msRest.CompositeMapper = { + serializedName: "PartnerResponse", + type: { + name: "Composite", + className: "PartnerResponse", + modelProperties: { + etag: { + serializedName: "etag", + type: { + name: "Number" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + partnerId: { + serializedName: "properties.partnerId", + type: { + name: "String" + } + }, + partnerName: { + serializedName: "properties.partnerName", + type: { + name: "String" + } + }, + tenantId: { + serializedName: "properties.tenantId", + type: { + name: "String" + } + }, + objectId: { + serializedName: "properties.objectId", + type: { + name: "String" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + updatedTime: { + serializedName: "properties.updatedTime", + type: { + name: "DateTime" + } + }, + createdTime: { + serializedName: "properties.createdTime", + type: { + name: "DateTime" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const ExtendedErrorInfo: msRest.CompositeMapper = { + serializedName: "ExtendedErrorInfo", + type: { + name: "Composite", + className: "ExtendedErrorInfo", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ExtendedErrorInfo" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "OperationDisplay", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const OperationResponse: msRest.CompositeMapper = { + serializedName: "OperationResponse", + type: { + name: "Composite", + className: "OperationResponse", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const OperationList: msRest.CompositeMapper = { + serializedName: "OperationList", + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "OperationResponse" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/operationMappers.ts b/sdk/managementpartner/arm-managementpartner/lib/models/operationMappers.ts new file mode 100644 index 000000000000..e360e157e02e --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/operationMappers.ts @@ -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 { + OperationList, + OperationResponse, + OperationDisplay, + ErrorModel, + ExtendedErrorInfo +} from "../models/mappers"; + diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/parameters.ts b/sdk/managementpartner/arm-managementpartner/lib/models/parameters.ts new file mode 100644 index 000000000000..6108e0ed6cb4 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/parameters.ts @@ -0,0 +1,53 @@ +/* + * 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" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const partnerId: msRest.OperationURLParameter = { + parameterPath: "partnerId", + mapper: { + required: true, + serializedName: "partnerId", + type: { + name: "String" + } + } +}; diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/partnerMappers.ts b/sdk/managementpartner/arm-managementpartner/lib/models/partnerMappers.ts new file mode 100644 index 000000000000..0629f716e619 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/partnerMappers.ts @@ -0,0 +1,17 @@ +/* + * 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 { + PartnerResponse, + BaseResource, + ErrorModel, + ExtendedErrorInfo +} from "../models/mappers"; + diff --git a/sdk/managementpartner/arm-managementpartner/lib/models/partnersMappers.ts b/sdk/managementpartner/arm-managementpartner/lib/models/partnersMappers.ts new file mode 100644 index 000000000000..0629f716e619 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/models/partnersMappers.ts @@ -0,0 +1,17 @@ +/* + * 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 { + PartnerResponse, + BaseResource, + ErrorModel, + ExtendedErrorInfo +} from "../models/mappers"; + diff --git a/sdk/managementpartner/arm-managementpartner/lib/operations/index.ts b/sdk/managementpartner/arm-managementpartner/lib/operations/index.ts new file mode 100644 index 000000000000..6880265bf671 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/operations/index.ts @@ -0,0 +1,13 @@ +/* + * 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 "./partner"; +export * from "./operation"; +export * from "./partners"; diff --git a/sdk/managementpartner/arm-managementpartner/lib/operations/operation.ts b/sdk/managementpartner/arm-managementpartner/lib/operations/operation.ts new file mode 100644 index 000000000000..5d00c81e4a8f --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/operations/operation.ts @@ -0,0 +1,125 @@ +/* + * 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/operationMappers"; +import * as Parameters from "../models/parameters"; +import { ACEProvisioningManagementPartnerAPIContext } from "../aCEProvisioningManagementPartnerAPIContext"; + +/** Class representing a Operation. */ +export class Operation { + private readonly client: ACEProvisioningManagementPartnerAPIContext; + + /** + * Create a Operation. + * @param {ACEProvisioningManagementPartnerAPIContext} client Reference to the service client. + */ + constructor(client: ACEProvisioningManagementPartnerAPIContext) { + this.client = client; + } + + /** + * List all the operations. + * @summary Get operations. + * @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; + } + + /** + * List all the operations. + * @summary Get operations. + * @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.ManagementPartner/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/managementpartner/arm-managementpartner/lib/operations/partner.ts b/sdk/managementpartner/arm-managementpartner/lib/operations/partner.ts new file mode 100644 index 000000000000..cb179faa6450 --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/operations/partner.ts @@ -0,0 +1,236 @@ +/* + * 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/partnerMappers"; +import * as Parameters from "../models/parameters"; +import { ACEProvisioningManagementPartnerAPIContext } from "../aCEProvisioningManagementPartnerAPIContext"; + +/** Class representing a Partner. */ +export class Partner { + private readonly client: ACEProvisioningManagementPartnerAPIContext; + + /** + * Create a Partner. + * @param {ACEProvisioningManagementPartnerAPIContext} client Reference to the service client. + */ + constructor(client: ACEProvisioningManagementPartnerAPIContext) { + this.client = client; + } + + /** + * Get the management partner using the partnerId, objectId and tenantId. + * @summary Get a specific `Partner`. + * @param partnerId Id of the Partner + * @param [options] The optional parameters + * @returns Promise + */ + get(partnerId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param partnerId Id of the Partner + * @param callback The callback + */ + get(partnerId: string, callback: msRest.ServiceCallback): void; + /** + * @param partnerId Id of the Partner + * @param options The optional parameters + * @param callback The callback + */ + get(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + partnerId, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Create a management partner for the objectId and tenantId. + * @summary Create a specific `Partner`. + * @param partnerId Id of the Partner + * @param [options] The optional parameters + * @returns Promise + */ + create(partnerId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param partnerId Id of the Partner + * @param callback The callback + */ + create(partnerId: string, callback: msRest.ServiceCallback): void; + /** + * @param partnerId Id of the Partner + * @param options The optional parameters + * @param callback The callback + */ + create(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + partnerId, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Update the management partner for the objectId and tenantId. + * @summary Update a specific `Partner`. + * @param partnerId Id of the Partner + * @param [options] The optional parameters + * @returns Promise + */ + update(partnerId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param partnerId Id of the Partner + * @param callback The callback + */ + update(partnerId: string, callback: msRest.ServiceCallback): void; + /** + * @param partnerId Id of the Partner + * @param options The optional parameters + * @param callback The callback + */ + update(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + partnerId, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Delete the management partner for the objectId and tenantId. + * @summary Delete a specific `Partner`. + * @param partnerId Id of the Partner + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(partnerId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param partnerId Id of the Partner + * @param callback The callback + */ + deleteMethod(partnerId: string, callback: msRest.ServiceCallback): void; + /** + * @param partnerId Id of the Partner + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(partnerId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(partnerId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + partnerId, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", + urlParameters: [ + Parameters.partnerId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PartnerResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", + urlParameters: [ + Parameters.partnerId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PartnerResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", + urlParameters: [ + Parameters.partnerId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PartnerResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "providers/Microsoft.ManagementPartner/partners/{partnerId}", + urlParameters: [ + Parameters.partnerId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/managementpartner/arm-managementpartner/lib/operations/partners.ts b/sdk/managementpartner/arm-managementpartner/lib/operations/partners.ts new file mode 100644 index 000000000000..152b79ceb6ae --- /dev/null +++ b/sdk/managementpartner/arm-managementpartner/lib/operations/partners.ts @@ -0,0 +1,75 @@ +/* + * 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/partnersMappers"; +import * as Parameters from "../models/parameters"; +import { ACEProvisioningManagementPartnerAPIContext } from "../aCEProvisioningManagementPartnerAPIContext"; + +/** Class representing a Partners. */ +export class Partners { + private readonly client: ACEProvisioningManagementPartnerAPIContext; + + /** + * Create a Partners. + * @param {ACEProvisioningManagementPartnerAPIContext} client Reference to the service client. + */ + constructor(client: ACEProvisioningManagementPartnerAPIContext) { + this.client = client; + } + + /** + * Get the management partner using the objectId and tenantId. + * @summary Get a specific `Partner`. + * @param [options] The optional parameters + * @returns Promise + */ + get(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + get(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + get(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.ManagementPartner/partners", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PartnerResponse + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; diff --git a/sdk/managementpartner/arm-managementpartner/package.json b/sdk/managementpartner/arm-managementpartner/package.json index 8a5638399372..92739c0da0bf 100644 --- a/sdk/managementpartner/arm-managementpartner/package.json +++ b/sdk/managementpartner/arm-managementpartner/package.json @@ -4,8 +4,8 @@ "description": "ACEProvisioningManagementPartnerAPI Library with typescript type definitions for node.js and browser.", "version": "1.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -23,9 +23,10 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/managementpartner/arm-managementpartner", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -42,7 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -51,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-managementpartner.js.map'\" -o ./dist/arm-managementpartner.min.js ./dist/arm-managementpartner.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/managementpartner/arm-managementpartner/rollup.config.js b/sdk/managementpartner/arm-managementpartner/rollup.config.js index f35592c8b48e..85bee6bbee85 100644 --- a/sdk/managementpartner/arm-managementpartner/rollup.config.js +++ b/sdk/managementpartner/arm-managementpartner/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/aCEProvisioningManagementPartnerAPI.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/aCEProvisioningManagementPartnerAPI.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-managementpartner.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; diff --git a/sdk/managementpartner/arm-managementpartner/tsconfig.json b/sdk/managementpartner/arm-managementpartner/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/managementpartner/arm-managementpartner/tsconfig.json +++ b/sdk/managementpartner/arm-managementpartner/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }