diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b5afb9526bb5..39c60c12f8d7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3,6 +3,7 @@ dependencies: '@azure/amqp-common': 1.0.0-preview.6_rhea-promise@0.1.15 '@azure/arm-servicebus': 3.2.0 '@azure/core-asynciterator-polyfill': 1.0.0-preview.1 + '@azure/core-auth': 1.0.0-preview.1 '@azure/core-paging': 1.0.0-preview.1 '@azure/event-hubs': 2.1.1 '@azure/logger-js': 1.3.2 @@ -227,6 +228,12 @@ packages: dev: false resolution: integrity: sha512-hMp0y+j/odkAyTa5TYewn4hUlFdEe3sR9uTd2Oq+se61RtuDsqM7UWrNNlyylPyjIENSZHJVWN7jte/jvvMN2Q== + /@azure/core-auth/1.0.0-preview.1: + dependencies: + tslib: 1.10.0 + dev: false + resolution: + integrity: sha512-47pHpL+9g4m/cwi1+SplZ0eZfIevwt4F6peD7/t3kK4wa8Q8fOMKcQX967vZ3gpRPvon7/ox8EM+tm1l4UiXbg== /@azure/core-paging/1.0.0-preview.1: dependencies: '@azure/core-asynciterator-polyfill': 1.0.0-preview.1 @@ -9719,12 +9726,13 @@ packages: dev: false name: '@rush-temp/abort-controller' resolution: - integrity: sha512-+6kIsx32k7nlN6uAwPS4JOrdVH8CuciXwOqL6DFCDjBdaJhMZ85z/WxMlAtLl/rNxgXlU41Ev3roYTR6U4g+Sw== + integrity: sha512-2+IDAPkc8w6F7v+Qtv+0QlKup7BbSj9/FJRqus2Fv6lv4Qwfhhl1dII2Ttv0Y3D1jF0IlqOecuzEef9zxLc/jA== tarball: 'file:projects/abort-controller.tgz' version: 0.0.0 'file:projects/core-amqp.tgz': dependencies: '@azure/abort-controller': 1.0.0-preview.1 + '@azure/core-auth': 1.0.0-preview.1 '@types/async-lock': 1.1.1 '@types/chai': 4.1.7 '@types/chai-as-promised': 7.1.0 @@ -9789,7 +9797,7 @@ packages: dev: false name: '@rush-temp/core-amqp' resolution: - integrity: sha512-VsY0rKG2P16oVijIPCijrhFz7hYGkc7lL/CEXM6RTJ3ls/LGs/E5b8wJuiGiWl1daDPGtc4SPQYBCh9m9VMbPg== + integrity: sha512-3d4t4tY50JEufJCuo2xyd4O/T+QoOJARDeDshU+BtuYOwt7z5BTLEk5Oply8pTspZadGEIs+qqhGE/HkQ2ZFxw== tarball: 'file:projects/core-amqp.tgz' version: 0.0.0 'file:projects/core-arm.tgz': @@ -9827,7 +9835,7 @@ packages: dev: false name: '@rush-temp/core-arm' resolution: - integrity: sha512-9YUKGvAJqpqJ1OBnZ80TGWf2k5LwlQAWgBpcaxHxAIJ+z3Bb1ZoZFZOMqon7EIRsVNpdAt4M1KVqZSnRv6N2SQ== + integrity: sha512-ydCkKGPwdsqk3cZtb5s+PlhnUJNHifGymT1Rh6PjJCVoOOXGTXqZYc4k/EI9DMk/sgI4Vo9cQknrmjG5hRz5dw== tarball: 'file:projects/core-arm.tgz' version: 0.0.0 'file:projects/core-asynciterator-polyfill.tgz': @@ -9846,7 +9854,7 @@ packages: dev: false name: '@rush-temp/core-asynciterator-polyfill' resolution: - integrity: sha512-v2OkkGp4BscubKnr7qikdSqLJttDTy5skuwpX+KeQv9H5aMDtfGU4CKUmqdwGsI/+vnXlPU57ZBVJ0BtucQBng== + integrity: sha512-oJErNaXrpCzEEVyYVvv8gcBRnv36c76LBxalfW/l4wlABmUh9u+EuvwI46ig0V3m1bmIluW4S/9O08nO18uyGw== tarball: 'file:projects/core-asynciterator-polyfill.tgz' version: 0.0.0 'file:projects/core-auth.tgz': @@ -9886,11 +9894,12 @@ packages: dev: false name: '@rush-temp/core-auth' resolution: - integrity: sha512-oIG+pWtdToJ12ubczgGEAYEOBnE88rHXfw4CpDaPYV1DOhdRQ95ZCvcZ1LXAU0ov2OsyOTUrzXq7cl06hmCWUg== + integrity: sha512-D6tMjROHeCf7ijXZIPhewnP5sPK7Aj+k5Na5O5OU629HF7qLBczazjTCnpnnex4X8yvi4X3b82rX/LD2OxZ0dQ== tarball: 'file:projects/core-auth.tgz' version: 0.0.0 'file:projects/core-http.tgz': dependencies: + '@azure/core-auth': 1.0.0-preview.1 '@azure/logger-js': 1.3.2 '@types/chai': 4.1.7 '@types/express': 4.17.0 @@ -9968,7 +9977,7 @@ packages: dev: false name: '@rush-temp/core-http' resolution: - integrity: sha512-Fycn4IMExj6fHlcivPijmzjgNVpZb3IYFrAHGgrIHOCKi+4Z36IQaI2YsakxKwFmMqFvb2iHX7H2m3gSsp/xcQ== + integrity: sha512-pYmI7WimQIGJwIiiOP0xeyV1gSAJfCzUEhrCOVNmG8jvYFqXYUuqHAlGq/N02i+oRh/c+wM07H3Mv/kyCScomQ== tarball: 'file:projects/core-http.tgz' version: 0.0.0 'file:projects/core-paging.tgz': @@ -9988,7 +9997,7 @@ packages: dev: false name: '@rush-temp/core-paging' resolution: - integrity: sha512-2u4fno6260w1XLYISrBU+SlPSNrMlY9/Au3oQxjk4EzkWkZXOuDrC9WKNu5w0EHEktYtOi8eX9lAU9+JtZR3Hg== + integrity: sha512-MTsl2eG0FXkUyouQVkSEpgLuG6tNUKE8ckhH8y4B3VUevh/MOS/ghpCqXFRKEAMF7jVfB1s2BSSorGYFuWlcDg== tarball: 'file:projects/core-paging.tgz' version: 0.0.0 'file:projects/cosmos.tgz': @@ -10030,7 +10039,7 @@ packages: dev: false name: '@rush-temp/cosmos' resolution: - integrity: sha512-f7IyBbSYkZZ+guO7QopSGUb/7d5QYQiotA3hWoIvC0iUo4XhGa+DqlnQ/yn5zx+p8ogWU8pvIixA8GQU4nMUfA== + integrity: sha512-rLhtUCCGnwzY3OigHd+TEJ4U0lyBKc2RpjKGMl9koha/aSUchKfm8qHWS+4XO/J2+WldP7yQx6gZY5C+t3cBvQ== tarball: 'file:projects/cosmos.tgz' version: 0.0.0 'file:projects/event-hubs.tgz': @@ -10106,7 +10115,7 @@ packages: dev: false name: '@rush-temp/event-hubs' resolution: - integrity: sha512-EZIDJEYo9XVXr67t/WXgRq5lTzd3MTHb9QWJh4W1gSs00mYjvECsUBLR1gaLFUKKgUbxD5LhHCF3RncAnSmwAA== + integrity: sha512-0mjQEMP/AVz7oC1IAlNLQ33iz4Nr5+qBaXXYl61l8Xk/jIAgIMhQPZBy1vRj9MzG1dW71rmAVVsK2RSIH7k3uA== tarball: 'file:projects/event-hubs.tgz' version: 0.0.0 'file:projects/event-processor-host.tgz': @@ -10164,7 +10173,7 @@ packages: dev: false name: '@rush-temp/event-processor-host' resolution: - integrity: sha512-61Ultc6G27j08ScxQ+P74F49NcOdbgfBBYDyohrr50iQ8TxGI6GX661E6ryHllObZB0NM+r96aChe2W9P/WyCg== + integrity: sha512-ArbUM9DPleTcwpTC+4K/0fPHmaYl4POCPoGdwyFmHWq6Jci/i2QUwzKVsRt/g1x/N2QmpX9b1ptBbQbCFo5w4A== tarball: 'file:projects/event-processor-host.tgz' version: 0.0.0 'file:projects/identity.tgz': @@ -10215,7 +10224,7 @@ packages: dev: false name: '@rush-temp/identity' resolution: - integrity: sha512-Jo3h3GHu1DGCFEz+zAYytqJfH+CqJGOQJETkQS3KfQeT1zFLHEPA5XEMnczQ4WAqsfYI2d7aJiis57NkuiZUFA== + integrity: sha512-aLe+RHGk7M6wqCmNrblNMYMUtng49pfjo7pctPvnPORnPMD3acKp1+Ld3wQaAjImwPxlq60O1eulxRKAGM/fag== tarball: 'file:projects/identity.tgz' version: 0.0.0 'file:projects/keyvault-certificates.tgz': @@ -10244,7 +10253,7 @@ packages: dev: false name: '@rush-temp/keyvault-certificates' resolution: - integrity: sha512-0Rr3TCScxlCMTaQ42DE3wAzan3NPSnborTqYIH8v/tJnxaFbjfD15Z0x2qGdmpn6Rs+45kG26uwKeG14AxtNPA== + integrity: sha512-QXnSrcEl4SWcc1wYPRy2BeupDtio52G/miaEJAgse04u88EeU5YoZpQNtZ9l2rzpd/wuJmB2GMkVgUXRnB6zgg== tarball: 'file:projects/keyvault-certificates.tgz' version: 0.0.0 'file:projects/keyvault-keys.tgz': @@ -10313,7 +10322,7 @@ packages: dev: false name: '@rush-temp/keyvault-keys' resolution: - integrity: sha512-1LG76xEV+Au4m4UWojUPbVrOzIRQwUCIFKCat3SnhecAKaclpisUV9jZi0QtMWrdldxyKrpLXv1NoGEO0gKR0A== + integrity: sha512-kv1LOiu2pl432/WjarVRLropOwyQrGkOU4tdlA6MiTR9aeysnBosJzkOlScA6HdnBA1rUaoZoILYXQg7x6eS+g== tarball: 'file:projects/keyvault-keys.tgz' version: 0.0.0 'file:projects/keyvault-secrets.tgz': @@ -10382,7 +10391,7 @@ packages: dev: false name: '@rush-temp/keyvault-secrets' resolution: - integrity: sha512-2BkoWHCHM7mwug++tnAJT11TU1o5itq5prJqfjeLOrhrUWieS6GPpwveClcV6CHXGIiZjJ5O0XITdt0/hOPDwA== + integrity: sha512-x5m+5BJfn2ssYVl2jzY4YVgvVpgOHP8IQdoFzVG5NlUhYld2DHz4KsEzgYUGdQx5SNud9KLLimjIb4f9FPzSjQ== tarball: 'file:projects/keyvault-secrets.tgz' version: 0.0.0 'file:projects/service-bus.tgz': @@ -10460,7 +10469,7 @@ packages: dev: false name: '@rush-temp/service-bus' resolution: - integrity: sha512-CXD8nf7msxREoaGxjqroFnPJ2h685ONI1KTzp3NLawORv7wJy6OD/KtoAlRSW9gvc0njwaRgiM/HihWLsBzivg== + integrity: sha512-IckVg8CV310wLgunRCl2OAi+Nvn+GWQsHf3IDe2BoFOc/JzXKqC7/ETh98lua+jyePPL7ycdGhxxzzRCLieFIA== tarball: 'file:projects/service-bus.tgz' version: 0.0.0 'file:projects/storage-blob.tgz': @@ -10531,7 +10540,7 @@ packages: dev: false name: '@rush-temp/storage-blob' resolution: - integrity: sha512-rAKd6l+SZnmTB90UeFJ9QuyO+qEENo84HxkI3WDh7jkJoPl4GrKCGqIN4Wa1e6yZTvacXA+0FkXPKPAMoudz7g== + integrity: sha512-tGWJWCTrj3/4my2Pij9nPgBj0I9PQSm9p0eCnZ2VRn+LapRqILrmNu5wr51bFfBHeUH9zuqHr1pCP2vunHgf3Q== tarball: 'file:projects/storage-blob.tgz' version: 0.0.0 'file:projects/storage-file.tgz': @@ -10602,7 +10611,7 @@ packages: dev: false name: '@rush-temp/storage-file' resolution: - integrity: sha512-KuevB5Q7BkW92XIGBpLmUnLQTFSDLlOdlDHeDQD3Miz7rp+R5xIAypxbzX0g02SoEx6Sn924hUmYy7uEZTc5kQ== + integrity: sha512-GjGI/eUKKhovQodQwcjXxpNHSD7J1FK9ewbS0RR5qPFbtlgCxNZuzZqc35tL90gFYb8O+nOc+kS90L6XZ+7mQw== tarball: 'file:projects/storage-file.tgz' version: 0.0.0 'file:projects/storage-queue.tgz': @@ -10672,7 +10681,7 @@ packages: dev: false name: '@rush-temp/storage-queue' resolution: - integrity: sha512-RR3iZUa7RTVgQ1nLR61smd8m7nFDZfTXtghHKlJZ+lf/Szae5++8Tpm4edrABKCCNhkzBGzVPZB7xBxklHl7Lw== + integrity: sha512-iZiHy2U1uaFwWgPnYPzB68BWV7cFjb3N0jrnWKG39/QVu3JMdlLQzwZ6iyJwBNq3+3qzi+eKQu0TUK0vv+GdUQ== tarball: 'file:projects/storage-queue.tgz' version: 0.0.0 'file:projects/template.tgz': @@ -10724,7 +10733,7 @@ packages: dev: false name: '@rush-temp/template' resolution: - integrity: sha512-bkijVcpP7T7f+wl0fsgoWt23POw1yTKtlxF9Zua6ZmN64A80PK2eYV5i3NQ6O8W8GcQ9wEmZembE90TbegjEZQ== + integrity: sha512-sI0jpLfbroFiHzPvYDjMrrIveRCsLhD5kuNJoAlJi7dBmdUF9t1x9UraEYF6Br45IIWvH2H0OdwXkQBE+L5Tgw== tarball: 'file:projects/template.tgz' version: 0.0.0 'file:projects/testhub.tgz': @@ -10749,14 +10758,16 @@ packages: dev: false name: '@rush-temp/testhub' resolution: - integrity: sha512-uQ91pvb6TuE26BO2DT8IQHUmfgKFtLZ8jywOUsTLTjCFHboNdq5uXcd7+RBY+CSGrnr/CwTs3d262Jt11jj7LA== + integrity: sha512-rdhMvXi7mvg+wP0vVdqhouZr17v9a3n4KDMSyuUPU9qhOvY6bMfqoeIXrzgWkCXtR9yjL15gwJHKWsBlByGE4A== tarball: 'file:projects/testhub.tgz' version: 0.0.0 +registry: '' specifiers: '@azure/abort-controller': 1.0.0-preview.1 '@azure/amqp-common': 1.0.0-preview.6 '@azure/arm-servicebus': ^3.2.0 '@azure/core-asynciterator-polyfill': 1.0.0-preview.1 + '@azure/core-auth': 1.0.0-preview.1 '@azure/core-paging': 1.0.0-preview.1 '@azure/event-hubs': ^2.1.1 '@azure/logger-js': ^1.0.2 diff --git a/sdk/core/core-auth/package.json b/sdk/core/core-auth/package.json index af877825d617..426efaa823e8 100644 --- a/sdk/core/core-auth/package.json +++ b/sdk/core/core-auth/package.json @@ -1,6 +1,6 @@ { "name": "@azure/core-auth", - "version": "1.0.0-preview.1", + "version": "1.0.0-preview.2", "description": "Provides low-level interfaces and helper methods for authentication in Azure SDK", "sdk-type": "client", "main": "dist/index.js", diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 93debc7b855f..cbca4c130707 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -2,7 +2,7 @@ "name": "@azure/arm-policy", "author": "Microsoft Corporation", "description": "PolicyClient Library with typescript type definitions for node.js and browser.", - "version": "1.0.2", + "version": "2.0.0", "dependencies": { "@azure/ms-rest-azure-js": "^1.3.2", "@azure/ms-rest-js": "^1.8.1", diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 427a4211ddee..b6689df20b24 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -135,10 +135,9 @@ export interface PolicyDefinition extends BaseResource { */ policyType?: PolicyType; /** - * The policy definition mode. Possible values are NotSpecified, Indexed, and All. Possible - * values include: 'NotSpecified', 'Indexed', 'All' + * The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. */ - mode?: PolicyMode; + mode?: string; /** * The display name of the policy definition. */ @@ -328,14 +327,6 @@ export type ResourceIdentityType = 'SystemAssigned' | 'None'; */ export type PolicyType = 'NotSpecified' | 'BuiltIn' | 'Custom'; -/** - * Defines values for PolicyMode. - * Possible values include: 'NotSpecified', 'Indexed', 'All' - * @readonly - * @enum {string} - */ -export type PolicyMode = 'NotSpecified' | 'Indexed' | 'All'; - /** * Contains response data for the deleteMethod operation. */ diff --git a/sdk/policy/arm-policy/src/operations/policyAssignments.ts b/sdk/policy/arm-policy/src/operations/policyAssignments.ts index d3423fcd6259..b39b2d92c6f8 100644 --- a/sdk/policy/arm-policy/src/operations/policyAssignments.ts +++ b/sdk/policy/arm-policy/src/operations/policyAssignments.ts @@ -179,9 +179,8 @@ export class PolicyAssignments { * contained within the resource group. If $filter=atScope() is provided, the returned list * includes all policy assignments that apply to the resource group, which is everything in the * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the resource group and assign the policy definition whose id is - * {value}. + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param resourceGroupName The name of the resource group that contains policy assignments. * @param [options] The optional parameters @@ -218,11 +217,11 @@ export class PolicyAssignments { * resources contained within the resource. If $filter=atScope() is provided, the returned list * includes all policy assignments that apply to the resource, which is everything in the * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the resource and assign the policy definition whose id is {value}. - * Three parameters plus the resource name are used to identify a specific resource. If the - * resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value} that apply to the resource. Three + * parameters plus the resource name are used to identify a specific resource. If the resource is + * not part of a parent resource (the more common case), the parent resource path should not be + * provided (or provided as ''). For example a web app could be specified as * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all * parameters should be provided. For example a virtual machine DNS name could be specified as @@ -290,8 +289,8 @@ export class PolicyAssignments { * contained within the subscription. If $filter=atScope() is provided, the returned list includes * all policy assignments that apply to the subscription, which is everything in the unfiltered * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the subscription and assign the policy definition whose id is {value}. + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. * @param [options] The optional parameters * @returns Promise @@ -445,9 +444,8 @@ export class PolicyAssignments { * contained within the resource group. If $filter=atScope() is provided, the returned list * includes all policy assignments that apply to the resource group, which is everything in the * unfiltered list except those applied to resources contained within the resource group. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the resource group and assign the policy definition whose id is - * {value}. + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value} that apply to the resource group. * @summary Retrieves all policy assignments that apply to a resource group. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters @@ -484,11 +482,11 @@ export class PolicyAssignments { * resources contained within the resource. If $filter=atScope() is provided, the returned list * includes all policy assignments that apply to the resource, which is everything in the * unfiltered list except those applied to resources contained within the resource. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the resource and assign the policy definition whose id is {value}. - * Three parameters plus the resource name are used to identify a specific resource. If the - * resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value} that apply to the resource. Three + * parameters plus the resource name are used to identify a specific resource. If the resource is + * not part of a parent resource (the more common case), the parent resource path should not be + * provided (or provided as ''). For example a web app could be specified as * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == * 'sites', {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all * parameters should be provided. For example a virtual machine DNS name could be specified as @@ -534,8 +532,8 @@ export class PolicyAssignments { * contained within the subscription. If $filter=atScope() is provided, the returned list includes * all policy assignments that apply to the subscription, which is everything in the unfiltered * list except those applied to objects contained within the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes only policy - * assignments that apply to the subscription and assign the policy definition whose id is {value}. + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy + * assignments of the policy definition whose id is {value}. * @summary Retrieves all policy assignments that apply to a subscription. * @param nextPageLink The NextLink from the previous successful call to List operation. * @param [options] The optional parameters diff --git a/sdk/policy/arm-policy/src/policyClientContext.ts b/sdk/policy/arm-policy/src/policyClientContext.ts index 5333b15ad59a..3c2285df3670 100644 --- a/sdk/policy/arm-policy/src/policyClientContext.ts +++ b/sdk/policy/arm-policy/src/policyClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-policy"; -const packageVersion = "1.0.2"; +const packageVersion = "2.0.0"; export class PolicyClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; @@ -44,7 +44,7 @@ export class PolicyClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2018-05-01'; + this.apiVersion = '2019-01-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/subscription/arm-subscriptions/LICENSE.txt b/sdk/subscription/arm-subscriptions/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/subscription/arm-subscriptions/LICENSE.txt +++ b/sdk/subscription/arm-subscriptions/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/subscription/arm-subscriptions/README.md b/sdk/subscription/arm-subscriptions/README.md index cf12bd35b66a..8ca2bd0e1df0 100644 --- a/sdk/subscription/arm-subscriptions/README.md +++ b/sdk/subscription/arm-subscriptions/README.md @@ -9,23 +9,23 @@ This package contains an isomorphic SDK for SubscriptionClient. ### How to Install -``` +```bash npm install @azure/arm-subscriptions ``` ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - Authentication, client creation and listLocations subscriptions 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,7 +34,8 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new SubscriptionClient(creds, subscriptionId); - client.operations.list().then((result) => { + const subscriptionId = "testsubscriptionId"; + client.subscriptions.listLocations(subscriptionId).then((result) => { console.log("The result is:"); console.log(result); }); @@ -43,11 +44,11 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and list operations as an example written in JavaScript. +#### browser - Authentication, client creation and listLocations subscriptions as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -77,7 +78,8 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.ArmSubscriptions.SubscriptionClient(res.creds, subscriptionId); - client.operations.list().then((result) => { + const subscriptionId = "testsubscriptionId"; + client.subscriptions.listLocations(subscriptionId).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -95,5 +97,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [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/subscription/arm-subscriptions/README.png) diff --git a/sdk/subscription/arm-subscriptions/package.json b/sdk/subscription/arm-subscriptions/package.json index 3509dca1c114..f46df244f920 100644 --- a/sdk/subscription/arm-subscriptions/package.json +++ b/sdk/subscription/arm-subscriptions/package.json @@ -4,9 +4,9 @@ "description": "SubscriptionClient Library with typescript type definitions for node.js and browser.", "version": "1.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.0", + "@azure/ms-rest-js": "^2.0.3", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -23,15 +23,16 @@ "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/subscription/arm-subscriptions", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/subscription/arm-subscriptions", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], @@ -52,5 +54,5 @@ "prepack": "npm install && npm run build" }, "sideEffects": false, - "authPublish": true + "autoPublish": true } diff --git a/sdk/subscription/arm-subscriptions/rollup.config.js b/sdk/subscription/arm-subscriptions/rollup.config.js index a828255f7f53..f4ae2d19454d 100644 --- a/sdk/subscription/arm-subscriptions/rollup.config.js +++ b/sdk/subscription/arm-subscriptions/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/subscriptionClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/subscriptionClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-subscriptions.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/subscription/arm-subscriptions/src/models/index.ts b/sdk/subscription/arm-subscriptions/src/models/index.ts index 58329f3a0f52..e9e48d5fa42b 100644 --- a/sdk/subscription/arm-subscriptions/src/models/index.ts +++ b/sdk/subscription/arm-subscriptions/src/models/index.ts @@ -1,11 +1,9 @@ /* * 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. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,365 +11,384 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * Describes the format of Error response. + */ +export interface ErrorResponse { + /** + * Error code + */ + code?: string; + /** + * Error message indicating why the operation failed. + */ + message?: string; +} /** - * @interface - * An interface representing SubscriptionCreationResult. - * The created subscription object. - * + * Canceled Subscription Id */ -export interface SubscriptionCreationResult { +export interface CanceledSubscriptionId { /** - * @member {string} [subscriptionLink] The link to the new subscription. + * Canceled Subscription Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - subscriptionLink?: string; + readonly value?: string; } /** - * @interface - * An interface representing AdPrincipal. - * Active Directory Principal for subscription creation delegated permission - * + * Renamed Subscription Id */ -export interface AdPrincipal { +export interface RenamedSubscriptionId { /** - * @member {string} objectId Object id of the Principal + * Renamed Subscription Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - objectId: string; + readonly value?: string; } /** - * @interface - * An interface representing SubscriptionCreationParameters. - * Subscription Creation Parameters required to create a new Azure - * subscription. - * + * Enabled Subscription Id */ -export interface SubscriptionCreationParameters { +export interface EnabledSubscriptionId { /** - * @member {string} [displayName] The display name of the subscription. + * Enabled Subscription Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - displayName?: string; + readonly value?: string; +} + +/** + * New name of the subscription. + */ +export interface SubscriptionName { /** - * @member {AdPrincipal[]} [owners] The list of principals that should be - * granted Owner access on the subscription. Principals should be of type - * User, Service Principal or Security Group. + * New subscription name */ - owners?: AdPrincipal[]; + subscriptionName?: string; +} + +/** + * The object that represents the operation. + */ +export interface OperationDisplay { /** - * @member {OfferType} [offerType] The offer type of the subscription. For - * example, MS-AZR-0017P (EnterpriseAgreement) and MS-AZR-0148P - * (EnterpriseAgreement devTest) are available. Only valid when creating a - * subscription in a enrollment account scope. Possible values include: - * 'MS-AZR-0017P', 'MS-AZR-0148P' + * Service provider: Microsoft.Subscription */ - offerType?: OfferType; + provider?: string; /** - * @member {{ [propertyName: string]: any }} [additionalParameters] - * Additional, untyped parameters to support custom subscription creation - * scenarios. + * Resource on which the operation is performed: Profile, endpoint, etc. */ - additionalParameters?: { [propertyName: string]: any }; + resource?: string; + /** + * Operation type: Read, write, delete, etc. + */ + operation?: string; } /** - * @interface - * An interface representing ErrorResponse. - * Describes the format of Error response. - * + * REST API operation */ -export interface ErrorResponse { +export interface Operation { /** - * @member {string} [code] Error code + * Operation name: {provider}/{resource}/{operation} */ - code?: string; + name?: string; /** - * @member {string} [message] Error message indicating why the operation - * failed. + * The object that represents the operation. */ - message?: string; + display?: OperationDisplay; } /** - * @interface - * An interface representing SubscriptionOperation. - * status of the subscription POST operation. - * + * Result of the request to list operations. It contains a list of operations and a URL link to get + * the next set of results. */ -export interface SubscriptionOperation { +export interface OperationListResult { /** - * @member {string} [id] The operation Id. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * List of operations. */ - readonly id?: string; + value?: Operation[]; /** - * @member {string} [status] Status of the pending subscription + * URL to get the next set of operation list results if there are any. */ - status?: string; + nextLink?: string; +} + +/** + * The created subscription object. + */ +export interface SubscriptionCreationResult { /** - * @member {string} [statusDetail] Status Detail of the pending subscription + * The link to the new subscription. */ - statusDetail?: string; + subscriptionLink?: string; } /** - * @interface - * An interface representing SubscriptionOperationListResult. - * A list of pending subscription operations. - * + * Active Directory Principal for subscription creation delegated permission */ -export interface SubscriptionOperationListResult { +export interface AdPrincipal { /** - * @member {SubscriptionOperation[]} [value] A list of pending - * SubscriptionOperations + * Object id of the Principal */ - value?: SubscriptionOperation[]; + objectId: string; } /** - * @interface - * An interface representing OperationDisplay. - * The object that represents the operation. - * + * Subscription Creation Parameters required to create a new Azure subscription. */ -export interface OperationDisplay { +export interface ModernSubscriptionCreationParameters { /** - * @member {string} [provider] Service provider: Microsoft.Subscription + * The display name of the subscription. */ - provider?: string; + displayName?: string; /** - * @member {string} [resource] Resource on which the operation is performed: - * Profile, endpoint, etc. + * The ARM id of the billing profile. */ - resource?: string; + billingProfileId?: string; /** - * @member {string} [operation] Operation type: Read, write, delete, etc. + * The commerce id of the sku. */ - operation?: string; + skuId?: string; + /** + * optional customer cost center + */ + costCenter?: string; + /** + * rbac owner of the subscription + */ + owner?: AdPrincipal; + /** + * Additional, untyped parameters to support custom subscription creation scenarios. + */ + additionalParameters?: { [propertyName: string]: any }; } /** - * @interface - * An interface representing Operation. - * REST API operation - * + * status of the subscription POST operation. */ -export interface Operation { +export interface SubscriptionOperation { /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * The operation Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - name?: string; + readonly id?: string; /** - * @member {OperationDisplay} [display] The object that represents the - * operation. + * Status of the pending subscription */ - display?: OperationDisplay; + status?: string; + /** + * Status Detail of the pending subscription + */ + statusDetail?: string; } /** - * @interface - * An interface representing OperationListResult. - * Result of the request to list operations. It contains a list of operations - * and a URL link to get the next set of results. - * + * A list of pending subscription operations. */ -export interface OperationListResult { +export interface SubscriptionOperationListResult { /** - * @member {Operation[]} [value] List of operations. + * A list of pending SubscriptionOperations */ - value?: Operation[]; + value?: SubscriptionOperation[]; +} + +/** + * Subscription Creation Parameters required to create a new Azure subscription. + */ +export interface SubscriptionCreationParameters { /** - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. + * The display name of the subscription. */ - nextLink?: string; + displayName?: string; + /** + * The list of principals that should be granted Owner access on the subscription. Principals + * should be of type User, Service Principal or Security Group. + */ + owners?: AdPrincipal[]; + /** + * The offer type of the subscription. For example, MS-AZR-0017P (EnterpriseAgreement) and + * MS-AZR-0148P (EnterpriseAgreement devTest) are available. Only valid when creating a + * subscription in a enrollment account scope. Possible values include: 'MS-AZR-0017P', + * 'MS-AZR-0148P' + */ + offerType?: OfferType; + /** + * Additional, untyped parameters to support custom subscription creation scenarios. + */ + additionalParameters?: { [propertyName: string]: any }; } /** - * @interface - * An interface representing Location. * Location information. - * */ export interface Location { /** - * @member {string} [id] The fully qualified ID of the location. For example, + * The fully qualified ID of the location. For example, * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [subscriptionId] The subscription ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly subscriptionId?: string; /** - * @member {string} [name] The location name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The location name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly name?: string; /** - * @member {string} [displayName] The display name of the location. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The display name of the location. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly displayName?: string; /** - * @member {string} [latitude] The latitude of the location. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The latitude of the location. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly latitude?: string; /** - * @member {string} [longitude] The longitude of the location. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The longitude of the location. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly longitude?: string; } /** - * @interface - * An interface representing SubscriptionPolicies. * Subscription policies. - * */ export interface SubscriptionPolicies { /** - * @member {string} [locationPlacementId] The subscription location placement - * ID. The ID indicates which regions are visible for a subscription. For - * example, a subscription with a location placement Id of Public_2014-09-01 + * The subscription location placement ID. The ID indicates which regions are visible for a + * subscription. For example, a subscription with a location placement Id of Public_2014-09-01 * has access to Azure public regions. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly locationPlacementId?: string; /** - * @member {string} [quotaId] The subscription quota ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription quota ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly quotaId?: string; /** - * @member {SpendingLimit} [spendingLimit] The subscription spending limit. - * Possible values include: 'On', 'Off', 'CurrentPeriodOff' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly spendingLimit?: SpendingLimit; } /** - * @interface - * An interface representing Subscription. * Subscription information. - * */ export interface Subscription { /** - * @member {string} [id] The fully qualified ID for the subscription. For - * example, /subscriptions/00000000-0000-0000-0000-000000000000. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The fully qualified ID for the subscription. For example, + * /subscriptions/00000000-0000-0000-0000-000000000000. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [subscriptionId] The subscription ID. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly subscriptionId?: string; /** - * @member {string} [displayName] The subscription display name. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly displayName?: string; /** - * @member {SubscriptionState} [state] The subscription state. Possible - * values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible - * values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. + * Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly state?: SubscriptionState; /** - * @member {SubscriptionPolicies} [subscriptionPolicies] The subscription - * policies. + * The subscription policies. */ subscriptionPolicies?: SubscriptionPolicies; /** - * @member {string} [authorizationSource] The authorization source of the - * request. Valid values are one or more combinations of Legacy, RoleBased, - * Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. + * The authorization source of the request. Valid values are one or more combinations of Legacy, + * RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. */ authorizationSource?: string; } /** - * @interface - * An interface representing TenantIdDescription. * Tenant Id information. - * */ export interface TenantIdDescription { /** - * @member {string} [id] The fully qualified ID of the tenant. For example, + * The fully qualified ID of the tenant. For example, * /tenants/00000000-0000-0000-0000-000000000000. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly id?: string; /** - * @member {string} [tenantId] The tenant ID. For example, - * 00000000-0000-0000-0000-000000000000. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly tenantId?: string; } /** - * @interface * An interface representing SubscriptionClientOptions. - * @extends AzureServiceClientOptions */ export interface SubscriptionClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} + +/** + * Defines headers for Get operation. + */ +export interface SubscriptionOperationGetHeaders { /** - * @member {string} [baseUri] + * The URL where the status of the asynchronous operation can be checked. */ - baseUri?: string; + location: string; + /** + * The amount of delay to use while the status of the operation is checked. The value is + * expressed in seconds. + */ + retryAfter: number; +} + +/** + * Defines headers for CreateSubscription operation. + */ +export interface SubscriptionFactoryCreateSubscriptionHeaders { + /** + * GET this URL to retrieve the status of the asynchronous operation. + */ + location: string; + /** + * The amount of delay to use while the status of the operation is checked. The value is + * expressed in seconds. + */ + retryAfter: number; } /** - * @interface - * An interface representing SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders. * Defines headers for CreateSubscriptionInEnrollmentAccount operation. - * */ export interface SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders { /** - * @member {string} [location] GET this URL to retrieve the status of the - * asynchronous operation. + * GET this URL to retrieve the status of the asynchronous operation. */ location: string; /** - * @member {string} [retryAfter] The amount of delay to use while the status - * of the operation is checked. The value is expressed in seconds. + * The amount of delay to use while the status of the operation is checked. The value is + * expressed in seconds. */ retryAfter: string; } - /** * @interface - * An interface representing the LocationListResult. * Location list operation response. - * * @extends Array */ export interface LocationListResult extends Array { @@ -379,41 +396,28 @@ export interface LocationListResult extends Array { /** * @interface - * An interface representing the SubscriptionListResult. * Subscription list operation response. - * * @extends Array */ export interface SubscriptionListResult extends Array { /** - * @member {string} nextLink The URL to get the next set of results. + * The URL to get the next set of results. */ nextLink: string; } /** * @interface - * An interface representing the TenantListResult. * Tenant Ids information. - * * @extends Array */ export interface TenantListResult extends Array { /** - * @member {string} nextLink The URL to use for getting the next set of - * results. + * The URL to use for getting the next set of results. */ nextLink: string; } -/** - * Defines values for OfferType. - * Possible values include: 'MS-AZR-0017P', 'MS-AZR-0148P' - * @readonly - * @enum {string} - */ -export type OfferType = 'MS-AZR-0017P' | 'MS-AZR-0148P'; - /** * Defines values for SubscriptionState. * Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' @@ -431,9 +435,9 @@ export type SubscriptionState = 'Enabled' | 'Warned' | 'PastDue' | 'Disabled' | export type SpendingLimit = 'On' | 'Off' | 'CurrentPeriodOff'; /** - * Contains response data for the list operation. + * Contains response data for the cancel operation. */ -export type OperationsListResponse = OperationListResult & { +export type SubscriptionsCancelResponse = CanceledSubscriptionId & { /** * The underlying HTTP response. */ @@ -442,17 +446,18 @@ export type OperationsListResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: OperationListResult; + parsedBody: CanceledSubscriptionId; }; }; /** - * Contains response data for the list operation. + * Contains response data for the rename operation. */ -export type SubscriptionOperationsListResponse = SubscriptionOperationListResult & { +export type SubscriptionsRenameResponse = RenamedSubscriptionId & { /** * The underlying HTTP response. */ @@ -461,33 +466,31 @@ export type SubscriptionOperationsListResponse = SubscriptionOperationListResult * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: SubscriptionOperationListResult; + parsedBody: RenamedSubscriptionId; }; }; /** - * Contains response data for the createSubscriptionInEnrollmentAccount operation. + * Contains response data for the enable operation. */ -export type SubscriptionFactoryCreateSubscriptionInEnrollmentAccountResponse = SubscriptionCreationResult & SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders & { +export type SubscriptionsEnableResponse = EnabledSubscriptionId & { /** * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The parsed HTTP response headers. - */ - parsedHeaders: SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders; /** * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ - parsedBody: SubscriptionCreationResult; + parsedBody: EnabledSubscriptionId; }; }; @@ -503,6 +506,7 @@ export type SubscriptionsListLocationsResponse = LocationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -522,6 +526,7 @@ export type SubscriptionsGetResponse = Subscription & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -541,6 +546,7 @@ export type SubscriptionsListResponse = SubscriptionListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -560,6 +566,7 @@ export type SubscriptionsListNextResponse = SubscriptionListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -567,6 +574,121 @@ export type SubscriptionsListNextResponse = SubscriptionListResult & { }; }; +/** + * Contains response data for the get operation. + */ +export type SubscriptionOperationGetResponse = SubscriptionCreationResult & SubscriptionOperationGetHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: SubscriptionOperationGetHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SubscriptionCreationResult; + }; +}; + +/** + * Contains response data for the createSubscription operation. + */ +export type SubscriptionFactoryCreateSubscriptionResponse = SubscriptionCreationResult & SubscriptionFactoryCreateSubscriptionHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: SubscriptionFactoryCreateSubscriptionHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SubscriptionCreationResult; + }; +}; + +/** + * Contains response data for the createSubscriptionInEnrollmentAccount operation. + */ +export type SubscriptionFactoryCreateSubscriptionInEnrollmentAccountResponse = SubscriptionCreationResult & SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders; + + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SubscriptionCreationResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type SubscriptionOperationsListResponse = SubscriptionOperationListResult & { + /** + * 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: SubscriptionOperationListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + /** * Contains response data for the list operation. */ @@ -579,6 +701,7 @@ export type TenantsListResponse = TenantListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -598,6 +721,7 @@ export type TenantsListNextResponse = TenantListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/subscription/arm-subscriptions/src/models/mappers.ts b/sdk/subscription/arm-subscriptions/src/models/mappers.ts index 8d029bbac602..d9a598cd2042 100644 --- a/sdk/subscription/arm-subscriptions/src/models/mappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/mappers.ts @@ -1,11 +1,9 @@ /* * 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. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -14,6 +12,174 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const CanceledSubscriptionId: msRest.CompositeMapper = { + serializedName: "CanceledSubscriptionId", + type: { + name: "Composite", + className: "CanceledSubscriptionId", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const RenamedSubscriptionId: msRest.CompositeMapper = { + serializedName: "RenamedSubscriptionId", + type: { + name: "Composite", + className: "RenamedSubscriptionId", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const EnabledSubscriptionId: msRest.CompositeMapper = { + serializedName: "EnabledSubscriptionId", + type: { + name: "Composite", + className: "EnabledSubscriptionId", + modelProperties: { + value: { + readOnly: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const SubscriptionName: msRest.CompositeMapper = { + serializedName: "SubscriptionName", + type: { + name: "Composite", + className: "SubscriptionName", + modelProperties: { + subscriptionName: { + serializedName: "subscriptionName", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + subscriptionName: { + serializedName: "subscriptionName", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const SubscriptionCreationResult: msRest.CompositeMapper = { serializedName: "SubscriptionCreationResult", type: { @@ -47,11 +213,11 @@ export const AdPrincipal: msRest.CompositeMapper = { } }; -export const SubscriptionCreationParameters: msRest.CompositeMapper = { - serializedName: "SubscriptionCreationParameters", +export const ModernSubscriptionCreationParameters: msRest.CompositeMapper = { + serializedName: "ModernSubscriptionCreationParameters", type: { name: "Composite", - className: "SubscriptionCreationParameters", + className: "ModernSubscriptionCreationParameters", modelProperties: { displayName: { serializedName: "displayName", @@ -59,24 +225,31 @@ export const SubscriptionCreationParameters: msRest.CompositeMapper = { name: "String" } }, - owners: { - serializedName: "owners", + billingProfileId: { + serializedName: "billingProfileId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdPrincipal" - } - } + name: "String" } }, - offerType: { - serializedName: "offerType", + skuId: { + serializedName: "skuId", + type: { + name: "String" + } + }, + costCenter: { + serializedName: "costCenter", type: { name: "String" } }, + owner: { + serializedName: "owner", + type: { + name: "Composite", + className: "AdPrincipal" + } + }, additionalParameters: { serializedName: "additionalParameters", type: { @@ -92,28 +265,6 @@ export const SubscriptionCreationParameters: msRest.CompositeMapper = { } }; -export const ErrorResponse: msRest.CompositeMapper = { - serializedName: "ErrorResponse", - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", - type: { - name: "String" - } - } - } - } -}; - export const SubscriptionOperation: msRest.CompositeMapper = { serializedName: "SubscriptionOperation", type: { @@ -165,80 +316,46 @@ export const SubscriptionOperationListResult: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", +export const SubscriptionCreationParameters: msRest.CompositeMapper = { + serializedName: "SubscriptionCreationParameters", type: { name: "Composite", - className: "Operation", + className: "SubscriptionCreationParameters", modelProperties: { - name: { - serializedName: "name", + displayName: { + serializedName: "displayName", type: { name: "String" } }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } -}; - -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", + owners: { + serializedName: "owners", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Operation" + className: "AdPrincipal" } } } }, - nextLink: { - serializedName: "nextLink", + offerType: { + serializedName: "offerType", type: { name: "String" } + }, + additionalParameters: { + serializedName: "additionalParameters", + type: { + name: "Dictionary", + value: { + type: { + name: "Object" + } + } + } } } } @@ -414,6 +531,50 @@ export const TenantIdDescription: msRest.CompositeMapper = { } }; +export const SubscriptionOperationGetHeaders: msRest.CompositeMapper = { + serializedName: "subscriptionoperation-get-headers", + type: { + name: "Composite", + className: "SubscriptionOperationGetHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const SubscriptionFactoryCreateSubscriptionHeaders: msRest.CompositeMapper = { + serializedName: "subscriptionfactory-createsubscription-headers", + type: { + name: "Composite", + className: "SubscriptionFactoryCreateSubscriptionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + export const SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders: msRest.CompositeMapper = { serializedName: "subscriptionfactory-createsubscriptioninenrollmentaccount-headers", type: { diff --git a/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts index 715467ec9522..b8de8606cf9d 100644 --- a/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts @@ -1,17 +1,14 @@ /* * 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. */ export { - OperationListResult, + ErrorResponse, Operation, OperationDisplay, - ErrorResponse + OperationListResult } from "../models/mappers"; - diff --git a/sdk/subscription/arm-subscriptions/src/models/parameters.ts b/sdk/subscription/arm-subscriptions/src/models/parameters.ts index 136f82600bfa..0e5e2164d620 100644 --- a/sdk/subscription/arm-subscriptions/src/models/parameters.ts +++ b/sdk/subscription/arm-subscriptions/src/models/parameters.ts @@ -26,7 +26,7 @@ export const apiVersion0: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2018-03-01-preview', + defaultValue: '2019-03-01-preview', type: { name: "String" } @@ -44,6 +44,40 @@ export const apiVersion1: msRest.OperationQueryParameter = { } } }; +export const apiVersion2: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2018-11-01-preview', + type: { + name: "String" + } + } +}; +export const apiVersion3: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + isConstant: true, + serializedName: "api-version", + defaultValue: '2018-03-01-preview', + type: { + name: "String" + } + } +}; +export const billingAccountName: msRest.OperationURLParameter = { + parameterPath: "billingAccountName", + mapper: { + required: true, + serializedName: "billingAccountName", + type: { + name: "String" + } + } +}; export const enrollmentAccountName: msRest.OperationURLParameter = { parameterPath: "enrollmentAccountName", mapper: { @@ -54,6 +88,16 @@ export const enrollmentAccountName: msRest.OperationURLParameter = { } } }; +export const invoiceSectionName: msRest.OperationURLParameter = { + parameterPath: "invoiceSectionName", + mapper: { + required: true, + serializedName: "invoiceSectionName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { @@ -65,6 +109,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const operationId: msRest.OperationURLParameter = { + parameterPath: "operationId", + mapper: { + required: true, + serializedName: "operationId", + type: { + name: "String" + } + } +}; export const subscriptionId: msRest.OperationURLParameter = { parameterPath: "subscriptionId", mapper: { diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionFactoryMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionFactoryMappers.ts index e6c04bcb4b26..b057f11f94b3 100644 --- a/sdk/subscription/arm-subscriptions/src/models/subscriptionFactoryMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionFactoryMappers.ts @@ -1,18 +1,17 @@ /* * 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. */ export { - SubscriptionCreationParameters, AdPrincipal, + ErrorResponse, + ModernSubscriptionCreationParameters, + SubscriptionCreationParameters, SubscriptionCreationResult, - SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders, - ErrorResponse + SubscriptionFactoryCreateSubscriptionHeaders, + SubscriptionFactoryCreateSubscriptionInEnrollmentAccountHeaders } from "../models/mappers"; - diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationOperationsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationOperationsMappers.ts new file mode 100644 index 000000000000..26773a95671d --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationOperationsMappers.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 { + CloudError, + SubscriptionCreationResult, + SubscriptionOperationGetHeaders +} from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts index 305a221f860d..e2ed59bfb39f 100644 --- a/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts @@ -1,16 +1,13 @@ /* * 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. */ export { - SubscriptionOperationListResult, + ErrorResponse, SubscriptionOperation, - ErrorResponse + SubscriptionOperationListResult } from "../models/mappers"; - diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts index 8630883ef598..a639a03b4ba3 100644 --- a/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts @@ -1,19 +1,21 @@ /* * 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. */ export { - LocationListResult, - Location, + CanceledSubscriptionId, CloudError, + EnabledSubscriptionId, + ErrorResponse, + Location, + LocationListResult, + RenamedSubscriptionId, Subscription, - SubscriptionPolicies, - SubscriptionListResult + SubscriptionListResult, + SubscriptionName, + SubscriptionPolicies } from "../models/mappers"; - diff --git a/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts index cc13f90c8b50..3bb2cb4ae153 100644 --- a/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts @@ -1,16 +1,13 @@ /* * 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. */ export { - TenantListResult, + CloudError, TenantIdDescription, - CloudError + TenantListResult } from "../models/mappers"; - diff --git a/sdk/subscription/arm-subscriptions/src/operations/index.ts b/sdk/subscription/arm-subscriptions/src/operations/index.ts index eafce4f8f867..6774c4b687f8 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/index.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/index.ts @@ -8,8 +8,9 @@ * regenerated. */ -export * from "./operations"; -export * from "./subscriptionOperations"; -export * from "./subscriptionFactory"; export * from "./subscriptions"; +export * from "./subscriptionOperationOperations"; +export * from "./subscriptionFactory"; +export * from "./subscriptionOperations"; +export * from "./operations"; export * from "./tenants"; diff --git a/sdk/subscription/arm-subscriptions/src/operations/operations.ts b/sdk/subscription/arm-subscriptions/src/operations/operations.ts index 923fecd89ed7..5720ebfc56a0 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/operations.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/operations.ts @@ -57,7 +57,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Subscription/operations", queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion3 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptionFactory.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptionFactory.ts index ccfa425796be..bd89fd82e908 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/subscriptionFactory.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/subscriptionFactory.ts @@ -27,6 +27,19 @@ export class SubscriptionFactory { this.client = client; } + /** + * Creates an Azure subscription + * @param billingAccountName The name of the commerce root billing account. + * @param invoiceSectionName The name of the invoice section. + * @param body The subscription creation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + createSubscription(billingAccountName: string, invoiceSectionName: string, body: Models.ModernSubscriptionCreationParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateSubscription(billingAccountName,invoiceSectionName,body,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** * Creates an Azure subscription * @param enrollmentAccountName The name of the enrollment account to which the subscription will @@ -40,6 +53,26 @@ export class SubscriptionFactory { .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } + /** + * Creates an Azure subscription + * @param billingAccountName The name of the commerce root billing account. + * @param invoiceSectionName The name of the invoice section. + * @param body The subscription creation parameters. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateSubscription(billingAccountName: string, invoiceSectionName: string, body: Models.ModernSubscriptionCreationParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + billingAccountName, + invoiceSectionName, + body, + options + }, + beginCreateSubscriptionOperationSpec, + options); + } + /** * Creates an Azure subscription * @param enrollmentAccountName The name of the enrollment account to which the subscription will @@ -62,6 +95,41 @@ export class SubscriptionFactory { // Operation Specifications const serializer = new msRest.Serializer(Mappers); +const beginCreateSubscriptionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Subscription/createSubscription", + urlParameters: [ + Parameters.billingAccountName, + Parameters.invoiceSectionName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.ModernSubscriptionCreationParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.SubscriptionCreationResult, + headersMapper: Mappers.SubscriptionFactoryCreateSubscriptionHeaders + }, + 202: { + headersMapper: Mappers.SubscriptionFactoryCreateSubscriptionHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const beginCreateSubscriptionInEnrollmentAccountOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription", @@ -69,7 +137,7 @@ const beginCreateSubscriptionInEnrollmentAccountOperationSpec: msRest.OperationS Parameters.enrollmentAccountName ], queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion3 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperationOperations.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperationOperations.ts new file mode 100644 index 000000000000..4dd1d8d3e0e3 --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperationOperations.ts @@ -0,0 +1,88 @@ +/* + * 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/subscriptionOperationOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { SubscriptionClientContext } from "../subscriptionClientContext"; + +/** Class representing a SubscriptionOperationOperations. */ +export class SubscriptionOperationOperations { + private readonly client: SubscriptionClientContext; + + /** + * Create a SubscriptionOperationOperations. + * @param {SubscriptionClientContext} client Reference to the service client. + */ + constructor(client: SubscriptionClientContext) { + this.client = client; + } + + /** + * Get the status of the pending Microsoft.Subscription API operations. + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param [options] The optional parameters + * @returns Promise + */ + get(operationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param callback The callback + */ + get(operationId: string, callback: msRest.ServiceCallback): void; + /** + * @param operationId The operation ID, which can be found from the Location field in the generate + * recommendation response header. + * @param options The optional parameters + * @param callback The callback + */ + get(operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + operationId, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Subscription/subscriptionOperations/{operationId}", + urlParameters: [ + Parameters.operationId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SubscriptionCreationResult, + headersMapper: Mappers.SubscriptionOperationGetHeaders + }, + 202: { + headersMapper: Mappers.SubscriptionOperationGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts index 16d04fafe5f3..e898453ec339 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts @@ -57,7 +57,7 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Subscription/subscriptionOperations", queryParameters: [ - Parameters.apiVersion0 + Parameters.apiVersion3 ], headerParameters: [ Parameters.acceptLanguage diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts index 3e978cba8f83..752ed114f6f9 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts @@ -26,6 +26,94 @@ export class Subscriptions { this.client = client; } + /** + * Cancels the subscription + * @param subscriptionId Subscription Id. + * @param [options] The optional parameters + * @returns Promise + */ + cancel(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Subscription Id. + * @param callback The callback + */ + cancel(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Subscription Id. + * @param options The optional parameters + * @param callback The callback + */ + cancel(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancel(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + cancelOperationSpec, + callback) as Promise; + } + + /** + * Renames the subscription + * @param subscriptionId Subscription Id. + * @param body Subscription Name + * @param [options] The optional parameters + * @returns Promise + */ + rename(subscriptionId: string, body: Models.SubscriptionName, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Subscription Id. + * @param body Subscription Name + * @param callback The callback + */ + rename(subscriptionId: string, body: Models.SubscriptionName, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Subscription Id. + * @param body Subscription Name + * @param options The optional parameters + * @param callback The callback + */ + rename(subscriptionId: string, body: Models.SubscriptionName, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + rename(subscriptionId: string, body: Models.SubscriptionName, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + body, + options + }, + renameOperationSpec, + callback) as Promise; + } + + /** + * Enables the subscription + * @param subscriptionId Subscription Id. + * @param [options] The optional parameters + * @returns Promise + */ + enable(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Subscription Id. + * @param callback The callback + */ + enable(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Subscription Id. + * @param options The optional parameters + * @param callback The callback + */ + enable(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + enable(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + enableOperationSpec, + callback) as Promise; + } + /** * This operation provides all the locations that are available for resource providers; however, * each resource provider may support a subset of this list. @@ -139,6 +227,82 @@ export class Subscriptions { // Operation Specifications const serializer = new msRest.Serializer(Mappers); +const cancelOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.CanceledSubscriptionId + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const renameOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.SubscriptionName, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.RenamedSubscriptionId + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const enableOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.EnabledSubscriptionId + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + const listLocationsOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/locations", diff --git a/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts b/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts index 6a060c07fcca..cb4d83071574 100644 --- a/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts +++ b/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts @@ -17,10 +17,11 @@ import { SubscriptionClientContext } from "./subscriptionClientContext"; class SubscriptionClient extends SubscriptionClientContext { // Operation groups - operations: operations.Operations; - subscriptionOperations: operations.SubscriptionOperations; - subscriptionFactory: operations.SubscriptionFactory; subscriptions: operations.Subscriptions; + subscriptionOperation: operations.SubscriptionOperationOperations; + subscriptionFactory: operations.SubscriptionFactory; + subscriptionOperations: operations.SubscriptionOperations; + operations: operations.Operations; tenants: operations.Tenants; /** @@ -30,10 +31,11 @@ class SubscriptionClient extends SubscriptionClientContext { */ constructor(credentials: msRest.ServiceClientCredentials, options?: Models.SubscriptionClientOptions) { super(credentials, options); - this.operations = new operations.Operations(this); - this.subscriptionOperations = new operations.SubscriptionOperations(this); - this.subscriptionFactory = new operations.SubscriptionFactory(this); this.subscriptions = new operations.Subscriptions(this); + this.subscriptionOperation = new operations.SubscriptionOperationOperations(this); + this.subscriptionFactory = new operations.SubscriptionFactory(this); + this.subscriptionOperations = new operations.SubscriptionOperations(this); + this.operations = new operations.Operations(this); this.tenants = new operations.Tenants(this); } } diff --git a/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts b/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts index bc27f46c00cb..f1f805ba1d10 100644 --- a/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts +++ b/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-subscriptions"; -const packageVersion = "0.1.0"; +const packageVersion = "1.0.0"; export class SubscriptionClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; diff --git a/sdk/subscription/arm-subscriptions/tsconfig.json b/sdk/subscription/arm-subscriptions/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/subscription/arm-subscriptions/tsconfig.json +++ b/sdk/subscription/arm-subscriptions/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true