diff --git a/sdk/devspaces/arm-devspaces/LICENSE.txt b/sdk/devspaces/arm-devspaces/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/devspaces/arm-devspaces/LICENSE.txt +++ b/sdk/devspaces/arm-devspaces/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/devspaces/arm-devspaces/README.md b/sdk/devspaces/arm-devspaces/README.md index 5daf4fdb8067..8bf79e7a92d5 100644 --- a/sdk/devspaces/arm-devspaces/README.md +++ b/sdk/devspaces/arm-devspaces/README.md @@ -9,23 +9,23 @@ This package contains an isomorphic SDK for DevSpacesManagementClient. ### How to Install -``` +```bash npm install @azure/arm-devspaces ``` ### How to use -#### nodejs - Authentication, client creation and get controllers as an example written in TypeScript. +#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. ##### 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"; @@ -34,9 +34,7 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new DevSpacesManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const name = "testname"; - client.controllers.get(resourceGroupName, name).then((result) => { + client.operations.list().then((result) => { console.log("The result is:"); console.log(result); }); @@ -45,11 +43,11 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and get controllers as an example written in JavaScript. +#### 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 ``` @@ -79,9 +77,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.ArmDevspaces.DevSpacesManagementClient(res.creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const name = "testname"; - client.controllers.get(resourceGroupName, name).then((result) => { + client.operations.list().then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -98,6 +94,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/devspaces/arm-devspaces/README.png) diff --git a/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClient.ts b/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClient.ts new file mode 100644 index 000000000000..c39ca90cf495 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClient.ts @@ -0,0 +1,46 @@ +/* + * 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 { DevSpacesManagementClientContext } from "./devSpacesManagementClientContext"; + + +class DevSpacesManagementClient extends DevSpacesManagementClientContext { + // Operation groups + containerHostMappings: operations.ContainerHostMappings; + operations: operations.Operations; + controllers: operations.Controllers; + + /** + * Initializes a new instance of the DevSpacesManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DevSpacesManagementClientOptions) { + super(credentials, subscriptionId, options); + this.containerHostMappings = new operations.ContainerHostMappings(this); + this.operations = new operations.Operations(this); + this.controllers = new operations.Controllers(this); + } +} + +// Operation Specifications + +export { + DevSpacesManagementClient, + DevSpacesManagementClientContext, + Models as DevSpacesManagementModels, + Mappers as DevSpacesManagementMappers +}; +export * from "./operations"; diff --git a/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClientContext.ts b/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClientContext.ts new file mode 100644 index 000000000000..d95c67364ae9 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/devSpacesManagementClientContext.ts @@ -0,0 +1,62 @@ +/* + * 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-devspaces"; +const packageVersion = "1.1.0"; + +export class DevSpacesManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the DevSpacesManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Azure subscription ID. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DevSpacesManagementClientOptions) { + 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-04-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + 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/devspaces/arm-devspaces/lib/models/containerHostMappingsMappers.ts b/sdk/devspaces/arm-devspaces/lib/models/containerHostMappingsMappers.ts new file mode 100644 index 000000000000..938f9ab457ae --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/containerHostMappingsMappers.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 { + discriminators, + ContainerHostMapping, + ErrorResponse, + ErrorDetails +} from "../models/mappers"; + diff --git a/sdk/devspaces/arm-devspaces/lib/models/controllersMappers.ts b/sdk/devspaces/arm-devspaces/lib/models/controllersMappers.ts new file mode 100644 index 000000000000..36975921e2fb --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/controllersMappers.ts @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + Controller, + TrackedResource, + Resource, + BaseResource, + Sku, + ErrorResponse, + ErrorDetails, + ControllerUpdateParameters, + ControllerList, + ListConnectionDetailsParameters, + ControllerConnectionDetailsList, + ControllerConnectionDetails, + OrchestratorSpecificConnectionDetails, + KubernetesConnectionDetails +} from "../models/mappers"; + diff --git a/sdk/devspaces/arm-devspaces/lib/models/index.ts b/sdk/devspaces/arm-devspaces/lib/models/index.ts new file mode 100644 index 000000000000..f433c07f7cc5 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/index.ts @@ -0,0 +1,595 @@ +/* + * 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 ContainerHostMapping. + * Container host mapping object specifying the Container host resource ID and + * its associated Controller resource. + * + */ +export interface ContainerHostMapping { + /** + * @member {string} [containerHostResourceId] ARM ID of the Container Host + * resource + */ + containerHostResourceId?: string; + /** + * @member {string} [mappedControllerResourceId] ARM ID of the mapped + * Controller resource + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly mappedControllerResourceId?: string; +} + +/** + * @interface + * An interface representing Resource. + * An Azure resource. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Fully qualified resource Id for the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + +/** + * @interface + * An interface representing TrackedResource. + * The resource model definition for a ARM tracked top level resource. + * + * @extends Resource + */ +export interface TrackedResource extends Resource { + /** + * @member {{ [propertyName: string]: string }} [tags] Tags for the Azure + * resource. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {string} [location] Region where the Azure resource is located. + */ + location?: string; +} + +/** + * @interface + * An interface representing ResourceProviderOperationDisplay. + */ +export interface ResourceProviderOperationDisplay { + /** + * @member {string} [provider] Name of the resource provider. + */ + provider?: string; + /** + * @member {string} [resource] Name of the resource type. + */ + resource?: string; + /** + * @member {string} [operation] Name of the resource provider operation. + */ + operation?: string; + /** + * @member {string} [description] Description of the resource provider + * operation. + */ + description?: string; +} + +/** + * @interface + * An interface representing ResourceProviderOperationDefinition. + */ +export interface ResourceProviderOperationDefinition { + /** + * @member {string} [name] Resource provider operation name. + */ + name?: string; + /** + * @member {ResourceProviderOperationDisplay} [display] + */ + display?: ResourceProviderOperationDisplay; +} + +/** + * @interface + * An interface representing Sku. + * Model representing SKU for Azure Dev Spaces Controller. + * + */ +export interface Sku { + /** + * @member {SkuTier} [tier] The tier of the SKU for Azure Dev Spaces + * Controller. Possible values include: 'Standard' + */ + tier?: SkuTier; +} + +/** + * @interface + * An interface representing Controller. + * @extends TrackedResource + */ +export interface Controller extends TrackedResource { + /** + * @member {ProvisioningState} [provisioningState] Provisioning state of the + * Azure Dev Spaces Controller. Possible values include: 'Succeeded', + * 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', 'Deleted' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {string} [hostSuffix] DNS suffix for public endpoints running in + * the Azure Dev Spaces Controller. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hostSuffix?: string; + /** + * @member {string} [dataPlaneFqdn] DNS name for accessing DataPlane services + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dataPlaneFqdn?: string; + /** + * @member {string} targetContainerHostResourceId Resource ID of the target + * container host + */ + targetContainerHostResourceId: string; + /** + * @member {string} targetContainerHostCredentialsBase64 Credentials of the + * target container host (base64). + */ + targetContainerHostCredentialsBase64: string; + /** + * @member {Sku} sku + */ + sku: Sku; +} + +/** + * @interface + * An interface representing ControllerUpdateParameters. + * Parameters for updating an Azure Dev Spaces Controller. + * + */ +export interface ControllerUpdateParameters { + /** + * @member {{ [propertyName: string]: string }} [tags] Tags for the Azure Dev + * Spaces Controller. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ListConnectionDetailsParameters. + * Parameters for listing connection details of an Azure Dev Spaces Controller. + * + */ +export interface ListConnectionDetailsParameters { + /** + * @member {string} targetContainerHostResourceId Resource ID of the target + * container host mapped to the Azure Dev Spaces Controller. + */ + targetContainerHostResourceId: string; +} + +/** + * Contains the possible cases for OrchestratorSpecificConnectionDetails. + */ +export type OrchestratorSpecificConnectionDetailsUnion = OrchestratorSpecificConnectionDetails | KubernetesConnectionDetails; + +/** + * @interface + * An interface representing OrchestratorSpecificConnectionDetails. + * Base class for types that supply values used to connect to container + * orchestrators + * + */ +export interface OrchestratorSpecificConnectionDetails { + /** + * @member {string} instanceType Polymorphic Discriminator + */ + instanceType: "OrchestratorSpecificConnectionDetails"; +} + +/** + * @interface + * An interface representing ControllerConnectionDetails. + */ +export interface ControllerConnectionDetails { + /** + * @member {OrchestratorSpecificConnectionDetailsUnion} + * [orchestratorSpecificConnectionDetails] + */ + orchestratorSpecificConnectionDetails?: OrchestratorSpecificConnectionDetailsUnion; +} + +/** + * @interface + * An interface representing ControllerConnectionDetailsList. + */ +export interface ControllerConnectionDetailsList { + /** + * @member {ControllerConnectionDetails[]} [connectionDetailsList] List of + * Azure Dev Spaces Controller connection details. + */ + connectionDetailsList?: ControllerConnectionDetails[]; +} + +/** + * @interface + * An interface representing KubernetesConnectionDetails. + * Contains information used to connect to a Kubernetes cluster + * + */ +export interface KubernetesConnectionDetails { + /** + * @member {string} instanceType Polymorphic Discriminator + */ + instanceType: "Kubernetes"; + /** + * @member {string} [kubeConfig] Gets the kubeconfig for the cluster. + */ + kubeConfig?: string; +} + +/** + * @interface + * An interface representing ErrorDetails. + */ +export interface ErrorDetails { + /** + * @member {string} [code] Status code for the error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly code?: string; + /** + * @member {string} [message] Error message describing the error in detail. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; + /** + * @member {string} [target] The target of the particular error. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly target?: string; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + * + */ +export interface ErrorResponse { + /** + * @member {ErrorDetails} [error] The details of the error. + */ + error?: ErrorDetails; +} + +/** + * @interface + * An interface representing DevSpacesManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface DevSpacesManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the ResourceProviderOperationList. + * @extends Array + */ +export interface ResourceProviderOperationList extends Array { + /** + * @member {string} [nextLink] The URI that can be used to request the next + * page for list of Azure operations. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * @interface + * An interface representing the ControllerList. + * @extends Array + */ +export interface ControllerList extends Array { + /** + * @member {string} [nextLink] The URI that can be used to request the next + * page for list of Azure Dev Spaces Controllers. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating', 'Deleting', + * 'Deleted' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Succeeded' | 'Failed' | 'Canceled' | 'Updating' | 'Creating' | 'Deleting' | 'Deleted'; + +/** + * Defines values for SkuTier. + * Possible values include: 'Standard' + * @readonly + * @enum {string} + */ +export type SkuTier = 'Standard'; + +/** + * Contains response data for the getContainerHostMapping operation. + */ +export type ContainerHostMappingsGetContainerHostMappingResponse = ContainerHostMapping & { + /** + * 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: ContainerHostMapping; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = ResourceProviderOperationList & { + /** + * 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: ResourceProviderOperationList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = ResourceProviderOperationList & { + /** + * 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: ResourceProviderOperationList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ControllersGetResponse = Controller & { + /** + * 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: Controller; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ControllersCreateResponse = Controller & { + /** + * 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: Controller; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ControllersUpdateResponse = Controller & { + /** + * 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: Controller; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type ControllersListByResourceGroupResponse = ControllerList & { + /** + * 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: ControllerList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ControllersListResponse = ControllerList & { + /** + * 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: ControllerList; + }; +}; + +/** + * Contains response data for the listConnectionDetails operation. + */ +export type ControllersListConnectionDetailsResponse = ControllerConnectionDetailsList & { + /** + * 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: ControllerConnectionDetailsList; + }; +}; + +/** + * Contains response data for the beginCreate operation. + */ +export type ControllersBeginCreateResponse = Controller & { + /** + * 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: Controller; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type ControllersListByResourceGroupNextResponse = ControllerList & { + /** + * 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: ControllerList; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ControllersListNextResponse = ControllerList & { + /** + * 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: ControllerList; + }; +}; diff --git a/sdk/devspaces/arm-devspaces/lib/models/mappers.ts b/sdk/devspaces/arm-devspaces/lib/models/mappers.ts new file mode 100644 index 000000000000..aa4acf9a198c --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/mappers.ts @@ -0,0 +1,463 @@ +/* + * 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 ContainerHostMapping: msRest.CompositeMapper = { + serializedName: "ContainerHostMapping", + type: { + name: "Composite", + className: "ContainerHostMapping", + modelProperties: { + containerHostResourceId: { + serializedName: "containerHostResourceId", + type: { + name: "String" + } + }, + mappedControllerResourceId: { + readOnly: true, + serializedName: "mappedControllerResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceProviderOperationDisplay: msRest.CompositeMapper = { + serializedName: "ResourceProviderOperationDisplay", + type: { + name: "Composite", + className: "ResourceProviderOperationDisplay", + 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 ResourceProviderOperationDefinition: msRest.CompositeMapper = { + serializedName: "ResourceProviderOperationDefinition", + type: { + name: "Composite", + className: "ResourceProviderOperationDefinition", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "ResourceProviderOperationDisplay" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + isConstant: true, + serializedName: "name", + defaultValue: 'S1', + type: { + name: "String" + } + }, + tier: { + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + +export const Controller: msRest.CompositeMapper = { + serializedName: "Controller", + type: { + name: "Composite", + className: "Controller", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + hostSuffix: { + readOnly: true, + serializedName: "properties.hostSuffix", + type: { + name: "String" + } + }, + dataPlaneFqdn: { + readOnly: true, + serializedName: "properties.dataPlaneFqdn", + type: { + name: "String" + } + }, + targetContainerHostResourceId: { + required: true, + serializedName: "properties.targetContainerHostResourceId", + type: { + name: "String" + } + }, + targetContainerHostCredentialsBase64: { + required: true, + serializedName: "properties.targetContainerHostCredentialsBase64", + type: { + name: "String" + } + }, + sku: { + required: true, + serializedName: "sku", + defaultValue: {}, + type: { + name: "Composite", + className: "Sku" + } + } + } + } +}; + +export const ControllerUpdateParameters: msRest.CompositeMapper = { + serializedName: "ControllerUpdateParameters", + type: { + name: "Composite", + className: "ControllerUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ListConnectionDetailsParameters: msRest.CompositeMapper = { + serializedName: "ListConnectionDetailsParameters", + type: { + name: "Composite", + className: "ListConnectionDetailsParameters", + modelProperties: { + targetContainerHostResourceId: { + required: true, + serializedName: "targetContainerHostResourceId", + type: { + name: "String" + } + } + } + } +}; + +export const OrchestratorSpecificConnectionDetails: msRest.CompositeMapper = { + serializedName: "OrchestratorSpecificConnectionDetails", + type: { + name: "Composite", + polymorphicDiscriminator: { + serializedName: "instanceType", + clientName: "instanceType" + }, + uberParent: "OrchestratorSpecificConnectionDetails", + className: "OrchestratorSpecificConnectionDetails", + modelProperties: { + instanceType: { + required: true, + serializedName: "instanceType", + type: { + name: "String" + } + } + } + } +}; + +export const ControllerConnectionDetails: msRest.CompositeMapper = { + serializedName: "ControllerConnectionDetails", + type: { + name: "Composite", + className: "ControllerConnectionDetails", + modelProperties: { + orchestratorSpecificConnectionDetails: { + serializedName: "orchestratorSpecificConnectionDetails", + type: { + name: "Composite", + className: "OrchestratorSpecificConnectionDetails" + } + } + } + } +}; + +export const ControllerConnectionDetailsList: msRest.CompositeMapper = { + serializedName: "ControllerConnectionDetailsList", + type: { + name: "Composite", + className: "ControllerConnectionDetailsList", + modelProperties: { + connectionDetailsList: { + serializedName: "connectionDetailsList", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ControllerConnectionDetails" + } + } + } + } + } + } +}; + +export const KubernetesConnectionDetails: msRest.CompositeMapper = { + serializedName: "Kubernetes", + type: { + name: "Composite", + polymorphicDiscriminator: OrchestratorSpecificConnectionDetails.type.polymorphicDiscriminator, + uberParent: "OrchestratorSpecificConnectionDetails", + className: "KubernetesConnectionDetails", + modelProperties: { + ...OrchestratorSpecificConnectionDetails.type.modelProperties, + kubeConfig: { + serializedName: "kubeConfig", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorDetails: msRest.CompositeMapper = { + serializedName: "ErrorDetails", + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + code: { + readOnly: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + readOnly: true, + serializedName: "target", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetails" + } + } + } + } +}; + +export const ResourceProviderOperationList: msRest.CompositeMapper = { + serializedName: "ResourceProviderOperationList", + type: { + name: "Composite", + className: "ResourceProviderOperationList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceProviderOperationDefinition" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ControllerList: msRest.CompositeMapper = { + serializedName: "ControllerList", + type: { + name: "Composite", + className: "ControllerList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Controller" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const discriminators = { + 'OrchestratorSpecificConnectionDetails' : OrchestratorSpecificConnectionDetails, + 'OrchestratorSpecificConnectionDetails.Kubernetes' : KubernetesConnectionDetails +}; diff --git a/sdk/devspaces/arm-devspaces/lib/models/operationsMappers.ts b/sdk/devspaces/arm-devspaces/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..6cfbbc1c921b --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/operationsMappers.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 { + discriminators, + ResourceProviderOperationList, + ResourceProviderOperationDefinition, + ResourceProviderOperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/sdk/devspaces/arm-devspaces/lib/models/parameters.ts b/sdk/devspaces/arm-devspaces/lib/models/parameters.ts new file mode 100644 index 000000000000..3ccc2a31c110 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/models/parameters.ts @@ -0,0 +1,92 @@ +/* + * 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 location: msRest.OperationURLParameter = { + parameterPath: "location", + mapper: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } +}; +export const name: msRest.OperationURLParameter = { + parameterPath: "name", + mapper: { + required: true, + serializedName: "name", + constraints: { + MaxLength: 31, + MinLength: 3, + Pattern: /^[a-zA-Z0-9](-?[a-zA-Z0-9])*$/ + }, + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1 + }, + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/devspaces/arm-devspaces/lib/operations/containerHostMappings.ts b/sdk/devspaces/arm-devspaces/lib/operations/containerHostMappings.ts new file mode 100644 index 000000000000..541af4f66617 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/operations/containerHostMappings.ts @@ -0,0 +1,100 @@ +/* + * 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/containerHostMappingsMappers"; +import * as Parameters from "../models/parameters"; +import { DevSpacesManagementClientContext } from "../devSpacesManagementClientContext"; + +/** Class representing a ContainerHostMappings. */ +export class ContainerHostMappings { + private readonly client: DevSpacesManagementClientContext; + + /** + * Create a ContainerHostMappings. + * @param {DevSpacesManagementClientContext} client Reference to the service client. + */ + constructor(client: DevSpacesManagementClientContext) { + this.client = client; + } + + /** + * @summary Returns container host mapping object for a container host resource ID if an associated + * controller exists. + * @param containerHostMapping + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param [options] The optional parameters + * @returns Promise + */ + getContainerHostMapping(containerHostMapping: Models.ContainerHostMapping, resourceGroupName: string, location: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param containerHostMapping + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param callback The callback + */ + getContainerHostMapping(containerHostMapping: Models.ContainerHostMapping, resourceGroupName: string, location: string, callback: msRest.ServiceCallback): void; + /** + * @param containerHostMapping + * @param resourceGroupName Resource group to which the resource belongs. + * @param location Location of the container host. + * @param options The optional parameters + * @param callback The callback + */ + getContainerHostMapping(containerHostMapping: Models.ContainerHostMapping, resourceGroupName: string, location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getContainerHostMapping(containerHostMapping: Models.ContainerHostMapping, resourceGroupName: string, location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + containerHostMapping, + resourceGroupName, + location, + options + }, + getContainerHostMappingOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getContainerHostMappingOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.location + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "containerHostMapping", + mapper: { + ...Mappers.ContainerHostMapping, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ContainerHostMapping + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/devspaces/arm-devspaces/lib/operations/controllers.ts b/sdk/devspaces/arm-devspaces/lib/operations/controllers.ts new file mode 100644 index 000000000000..acaa02102a29 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/operations/controllers.ts @@ -0,0 +1,562 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/controllersMappers"; +import * as Parameters from "../models/parameters"; +import { DevSpacesManagementClientContext } from "../devSpacesManagementClientContext"; + +/** Class representing a Controllers. */ +export class Controllers { + private readonly client: DevSpacesManagementClientContext; + + /** + * Create a Controllers. + * @param {DevSpacesManagementClientContext} client Reference to the service client. + */ + constructor(client: DevSpacesManagementClientContext) { + this.client = client; + } + + /** + * Gets the properties for an Azure Dev Spaces Controller. + * @summary Gets an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param callback The callback + */ + get(resourceGroupName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * @summary Creates an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, name: string, controller: Models.Controller, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,name,controller,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes an existing Azure Dev Spaces Controller. + * @summary Deletes an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,name,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Updates the properties of an existing Azure Dev Spaces Controller with the specified update + * parameters. + * @summary Updates an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, name: string, controllerUpdateParameters: Models.ControllerUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @param callback The callback + */ + update(resourceGroupName: string, name: string, controllerUpdateParameters: Models.ControllerUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controllerUpdateParameters Parameters for updating the Azure Dev Spaces Controller. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, name: string, controllerUpdateParameters: Models.ControllerUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, name: string, controllerUpdateParameters: Models.ControllerUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + controllerUpdateParameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group + * and subscription. + * @summary Lists the Azure Dev Spaces Controllers in a resource group. + * @param resourceGroupName Resource group to which the resource belongs. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @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 the Azure Dev Spaces Controllers with their properties in the subscription. + * @summary Lists the Azure Dev Spaces Controllers in a subscription. + * @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 connection details for the underlying container resources of an Azure Dev Spaces + * Controller. + * @summary Lists connection details for an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param listConnectionDetailsParameters Parameters for listing connection details of Azure Dev + * Spaces Controller. + * @param [options] The optional parameters + * @returns Promise + */ + listConnectionDetails(resourceGroupName: string, name: string, listConnectionDetailsParameters: Models.ListConnectionDetailsParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param listConnectionDetailsParameters Parameters for listing connection details of Azure Dev + * Spaces Controller. + * @param callback The callback + */ + listConnectionDetails(resourceGroupName: string, name: string, listConnectionDetailsParameters: Models.ListConnectionDetailsParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param listConnectionDetailsParameters Parameters for listing connection details of Azure Dev + * Spaces Controller. + * @param options The optional parameters + * @param callback The callback + */ + listConnectionDetails(resourceGroupName: string, name: string, listConnectionDetailsParameters: Models.ListConnectionDetailsParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listConnectionDetails(resourceGroupName: string, name: string, listConnectionDetailsParameters: Models.ListConnectionDetailsParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + name, + listConnectionDetailsParameters, + options + }, + listConnectionDetailsOperationSpec, + callback) as Promise; + } + + /** + * Creates an Azure Dev Spaces Controller with the specified create parameters. + * @summary Creates an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param controller Controller create parameters. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, name: string, controller: Models.Controller, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + controller, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes an existing Azure Dev Spaces Controller. + * @summary Deletes an Azure Dev Spaces Controller. + * @param resourceGroupName Resource group to which the resource belongs. + * @param name Name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, name: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + name, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all the Azure Dev Spaces Controllers with their properties in the specified resource group + * and subscription. + * @summary Lists the Azure Dev Spaces Controllers in a 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 the Azure Dev Spaces Controllers with their properties in the subscription. + * @summary Lists the Azure Dev Spaces Controllers in a subscription. + * @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 getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Controller + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "controllerUpdateParameters", + mapper: { + ...Mappers.ControllerUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Controller + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ControllerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ControllerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listConnectionDetailsOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "listConnectionDetailsParameters", + mapper: { + ...Mappers.ListConnectionDetailsParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ControllerConnectionDetailsList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "controller", + mapper: { + ...Mappers.Controller, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Controller + }, + 201: { + bodyMapper: Mappers.Controller + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.name + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ControllerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ControllerList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/devspaces/arm-devspaces/lib/operations/index.ts b/sdk/devspaces/arm-devspaces/lib/operations/index.ts new file mode 100644 index 000000000000..4c7b0e9f92a1 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/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 "./containerHostMappings"; +export * from "./operations"; +export * from "./controllers"; diff --git a/sdk/devspaces/arm-devspaces/lib/operations/operations.ts b/sdk/devspaces/arm-devspaces/lib/operations/operations.ts new file mode 100644 index 000000000000..768c9cb0ead3 --- /dev/null +++ b/sdk/devspaces/arm-devspaces/lib/operations/operations.ts @@ -0,0 +1,127 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { DevSpacesManagementClientContext } from "../devSpacesManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: DevSpacesManagementClientContext; + + /** + * Create a Operations. + * @param {DevSpacesManagementClientContext} client Reference to the service client. + */ + constructor(client: DevSpacesManagementClientContext) { + this.client = client; + } + + /** + * Lists all the supported operations by the Microsoft.DevSpaces resource provider along with their + * description. + * @summary Lists operations for the 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 supported operations by the Microsoft.DevSpaces resource provider along with their + * description. + * @summary Lists operations for the 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.DevSpaces/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceProviderOperationList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ResourceProviderOperationList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/devspaces/arm-devspaces/package.json b/sdk/devspaces/arm-devspaces/package.json index 8d5d724734f0..6ade1953d4ec 100644 --- a/sdk/devspaces/arm-devspaces/package.json +++ b/sdk/devspaces/arm-devspaces/package.json @@ -4,8 +4,8 @@ "description": "DevSpacesManagementClient 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/devspaces/arm-devspaces", + "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-devspaces.js.map'\" -o ./dist/arm-devspaces.min.js ./dist/arm-devspaces.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/devspaces/arm-devspaces/rollup.config.js b/sdk/devspaces/arm-devspaces/rollup.config.js index 895e39184316..ae431bd6c705 100644 --- a/sdk/devspaces/arm-devspaces/rollup.config.js +++ b/sdk/devspaces/arm-devspaces/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/devSpacesManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/devSpacesManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-devspaces.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/devspaces/arm-devspaces/tsconfig.json b/sdk/devspaces/arm-devspaces/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/devspaces/arm-devspaces/tsconfig.json +++ b/sdk/devspaces/arm-devspaces/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }