From be9c45f90ea419e8a66f6d2a1a8d2fd92830bfc2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 9 Nov 2021 22:52:04 +0000 Subject: [PATCH] CodeGen from PR 16687 in Azure/azure-rest-api-specs Merge 2c1d6754d57fa8ce2a1d07b8ceb2c463884e9102 into f2e08ab373eb0e96b54920e89f9fc96d683355ca --- .../arm-subscriptions/LICENSE.txt | 2 +- sdk/subscription/arm-subscriptions/README.md | 22 +- .../arm-subscriptions/package.json | 2 +- .../arm-subscriptions/rollup.config.js | 4 +- .../src/models/aliasMappers.ts | 17 +- .../src/models/billingAccountMappers.ts | 21 + .../arm-subscriptions/src/models/index.ts | 616 ++++++++++----- .../arm-subscriptions/src/models/mappers.ts | 732 +++++++++++++----- .../src/models/operationsMappers.ts | 5 +- .../src/models/parameters.ts | 17 +- ...tionsMappers.ts => subscriptionMappers.ts} | 9 +- .../src/models/subscriptionPolicyMappers.ts | 23 + .../src/models/subscriptionsMappers.ts | 16 - .../src/models/tenantsMappers.ts | 13 - .../arm-subscriptions/src/operations/alias.ts | 67 +- .../src/operations/billingAccount.ts | 80 ++ .../arm-subscriptions/src/operations/index.ts | 11 +- .../src/operations/operations.ts | 61 +- ...scriptionOperations.ts => subscription.ts} | 138 +++- .../src/operations/subscriptionPolicy.ts | 224 ++++++ .../src/operations/subscriptions.ts | 227 ------ .../src/operations/tenants.ts | 123 --- .../src/subscriptionClient.ts | 17 +- .../src/subscriptionClientContext.ts | 9 +- 24 files changed, 1563 insertions(+), 893 deletions(-) create mode 100644 sdk/subscription/arm-subscriptions/src/models/billingAccountMappers.ts rename sdk/subscription/arm-subscriptions/src/models/{subscriptionOperationsMappers.ts => subscriptionMappers.ts} (57%) create mode 100644 sdk/subscription/arm-subscriptions/src/models/subscriptionPolicyMappers.ts delete mode 100644 sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts delete mode 100644 sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts create mode 100644 sdk/subscription/arm-subscriptions/src/operations/billingAccount.ts rename sdk/subscription/arm-subscriptions/src/operations/{subscriptionOperations.ts => subscription.ts} (58%) create mode 100644 sdk/subscription/arm-subscriptions/src/operations/subscriptionPolicy.ts delete mode 100644 sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts delete mode 100644 sdk/subscription/arm-subscriptions/src/operations/tenants.ts diff --git a/sdk/subscription/arm-subscriptions/LICENSE.txt b/sdk/subscription/arm-subscriptions/LICENSE.txt index ea8fb1516028..2d3163745319 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) 2020 Microsoft +Copyright (c) 2021 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 6bde2f62ca34..5fc4051415de 100644 --- a/sdk/subscription/arm-subscriptions/README.md +++ b/sdk/subscription/arm-subscriptions/README.md @@ -1,11 +1,11 @@ ## Azure SubscriptionClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for SubscriptionClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for SubscriptionClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-subscriptions @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,8 +36,7 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - -#### nodejs - Authentication, client creation, and listLocations subscriptions as an example written in JavaScript. +#### nodejs - Authentication, client creation, and acceptOwnershipStatus subscription as an example written in JavaScript. ##### Sample code @@ -50,8 +48,9 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); -const client = new SubscriptionClient(creds); -client.subscriptions.listLocations(subscriptionId).then((result) => { +const client = new SubscriptionClient(creds, subscriptionId); +const subscriptionId = "testsubscriptionId"; +client.subscription.acceptOwnershipStatus(subscriptionId).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -60,7 +59,7 @@ client.subscriptions.listLocations(subscriptionId).then((result) => { }); ``` -#### browser - Authentication, client creation, and listLocations subscriptions as an example written in JavaScript. +#### browser - Authentication, client creation, and acceptOwnershipStatus subscription as an example written in JavaScript. In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. @@ -85,10 +84,11 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); - const client = new Azure.ArmSubscriptions.SubscriptionClient(creds); - client.subscriptions.listLocations(subscriptionId).then((result) => { + const client = new Azure.ArmSubscriptions.SubscriptionClient(creds, subscriptionId); + const subscriptionId = "testsubscriptionId"; + client.subscription.acceptOwnershipStatus(subscriptionId).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { diff --git a/sdk/subscription/arm-subscriptions/package.json b/sdk/subscription/arm-subscriptions/package.json index f6a261972902..f4dfc2cda135 100644 --- a/sdk/subscription/arm-subscriptions/package.json +++ b/sdk/subscription/arm-subscriptions/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/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" diff --git a/sdk/subscription/arm-subscriptions/rollup.config.js b/sdk/subscription/arm-subscriptions/rollup.config.js index 31cf8990d22c..62ae6eada406 100644 --- a/sdk/subscription/arm-subscriptions/rollup.config.js +++ b/sdk/subscription/arm-subscriptions/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. diff --git a/sdk/subscription/arm-subscriptions/src/models/aliasMappers.ts b/sdk/subscription/arm-subscriptions/src/models/aliasMappers.ts index ecda8fcc7595..1fba7444cc8b 100644 --- a/sdk/subscription/arm-subscriptions/src/models/aliasMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/aliasMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -8,11 +8,18 @@ export { BaseResource, + BillingAccountPoliciesResponse, + BillingAccountPoliciesResponseProperties, ErrorResponse, ErrorResponseBody, - PutAliasListResult, + GetTenantPolicyResponse, PutAliasRequest, + PutAliasRequestAdditionalProperties, PutAliasRequestProperties, - PutAliasResponse, - PutAliasResponseProperties + ServiceTenantResponse, + SubscriptionAliasListResult, + SubscriptionAliasResponse, + SubscriptionAliasResponseProperties, + SystemData, + TenantPolicy } from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/billingAccountMappers.ts b/sdk/subscription/arm-subscriptions/src/models/billingAccountMappers.ts new file mode 100644 index 000000000000..9ee7eff11ce4 --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/models/billingAccountMappers.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BillingAccountPoliciesResponse, + BillingAccountPoliciesResponseProperties, + ErrorResponse, + ErrorResponseBody, + GetTenantPolicyResponse, + ServiceTenantResponse, + SubscriptionAliasResponse, + SubscriptionAliasResponseProperties, + SystemData, + TenantPolicy +} from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/index.ts b/sdk/subscription/arm-subscriptions/src/models/index.ts index 91d12eedaaf2..0c33e48d94d1 100644 --- a/sdk/subscription/arm-subscriptions/src/models/index.ts +++ b/sdk/subscription/arm-subscriptions/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -11,120 +11,6 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; -/** - * Location information. - */ -export interface Location { - /** - * 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.** - */ - readonly id?: string; - /** - * The subscription ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subscriptionId?: string; - /** - * The location name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * The display name of the location. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly displayName?: string; - /** - * The latitude of the location. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly latitude?: string; - /** - * The longitude of the location. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly longitude?: string; -} - -/** - * Subscription policies. - */ -export interface SubscriptionPolicies { - /** - * 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.** - */ - readonly locationPlacementId?: string; - /** - * The subscription quota ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly quotaId?: string; - /** - * 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; -} - -/** - * Subscription information. - */ -export interface Subscription { - /** - * 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; - /** - * The subscription ID. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly subscriptionId?: string; - /** - * The subscription display name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly displayName?: string; - /** - * 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; - /** - * The subscription policies. - */ - subscriptionPolicies?: SubscriptionPolicies; - /** - * 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; -} - -/** - * Tenant Id information. - */ -export interface TenantIdDescription { - /** - * 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.** - */ - readonly id?: string; - /** - * 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; -} - /** * Describes the format of Error response. */ @@ -148,6 +34,14 @@ export interface ErrorResponseBody { * The details of the error. */ error?: ErrorResponse; + /** + * Error code + */ + code?: string; + /** + * Error message indicating why the operation failed. + */ + message?: string; } /** @@ -209,6 +103,10 @@ export interface OperationDisplay { * Operation type: Read, write, delete, etc. */ operation?: string; + /** + * Localized friendly description for the operation + */ + description?: string; } /** @@ -219,6 +117,10 @@ export interface Operation { * Operation name: {provider}/{resource}/{operation} */ name?: string; + /** + * Indicates whether the operation is a data action + */ + isDataAction?: boolean; /** * The object that represents the operation. */ @@ -226,18 +128,25 @@ export interface 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. + * Put subscription additional properties. */ -export interface OperationListResult { +export interface PutAliasRequestAdditionalProperties { /** - * List of operations. + * Management group Id for the subscription. */ - value?: Operation[]; + managementGroupId?: string; /** - * URL to get the next set of operation list results if there are any. + * Tenant Id of the subscription */ - nextLink?: string; + subscriptionTenantId?: string; + /** + * Owner Id of the subscription + */ + subscriptionOwnerId?: string; + /** + * Tags for the subscription + */ + tags?: { [propertyName: string]: string }; } /** @@ -249,22 +158,22 @@ export interface PutAliasRequestProperties { */ displayName?: string; /** - * The workload type of the subscription. It can be either Production or DevTest. Possible values - * include: 'Production', 'DevTest' + * Possible values include: 'Production', 'DevTest' */ workload?: Workload; - /** - * Determines whether subscription is fieldLed, partnerLed or LegacyEA - */ billingScope?: string; /** * This parameter can be used to create alias for existing subscription Id */ subscriptionId?: string; /** - * Reseller ID, basically MPN Id + * Reseller Id */ resellerId?: string; + /** + * Put alias request additional properties. + */ + additionalProperties?: PutAliasRequestAdditionalProperties; } /** @@ -274,29 +183,95 @@ export interface PutAliasRequest { /** * Put alias request properties. */ - properties: PutAliasRequestProperties; + properties?: PutAliasRequestProperties; } /** * Put subscription creation result properties. */ -export interface PutAliasResponseProperties { +export interface SubscriptionAliasResponseProperties { /** * Newly created subscription Id. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly subscriptionId?: string; + /** + * The display name of the subscription. + */ + displayName?: string; /** * The provisioning state of the resource. Possible values include: 'Accepted', 'Succeeded', * 'Failed' */ provisioningState?: ProvisioningState; + /** + * Url to accept ownership of the subscription. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly acceptOwnershipUrl?: string; + /** + * Possible values include: 'Pending', 'Completed', 'Expired' + */ + acceptOwnershipState?: AcceptOwnership; + billingScope?: string; + /** + * Possible values include: 'Production', 'DevTest' + */ + workload?: Workload; + /** + * Reseller Id + */ + resellerId?: string; + /** + * Owner Id of the subscription + */ + subscriptionOwnerId?: string; + /** + * The Management Group Id. + */ + managementGroupId?: string; + /** + * Tags for the subscription + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +export interface SystemData { + /** + * The identity that created the resource. + */ + createdBy?: string; + /** + * The type of identity that created the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + createdByType?: CreatedByType; + /** + * The timestamp of resource creation (UTC). + */ + createdAt?: Date; + /** + * The identity that last modified the resource. + */ + lastModifiedBy?: string; + /** + * The type of identity that last modified the resource. Possible values include: 'User', + * 'Application', 'ManagedIdentity', 'Key' + */ + lastModifiedByType?: CreatedByType; + /** + * The timestamp of resource last modification (UTC) + */ + lastModifiedAt?: Date; } /** * Subscription Information with the alias. */ -export interface PutAliasResponse extends BaseResource { +export interface SubscriptionAliasResponse extends BaseResource { /** * Fully qualified ID for the alias resource. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -313,20 +288,24 @@ export interface PutAliasResponse extends BaseResource { */ readonly type?: string; /** - * Put Alias response properties. + * Subscription Alias response properties. + */ + properties?: SubscriptionAliasResponseProperties; + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - properties?: PutAliasResponseProperties; + readonly systemData?: SystemData; } /** * The list of aliases. */ -export interface PutAliasListResult { +export interface SubscriptionAliasListResult { /** * The list of alias. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly value?: PutAliasResponse[]; + readonly value?: SubscriptionAliasResponse[]; /** * The link (url) to the next page of results. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -334,6 +313,195 @@ export interface PutAliasListResult { readonly nextLink?: string; } +/** + * Accept subscription ownership request properties. + */ +export interface AcceptOwnershipRequestProperties { + /** + * The friendly name of the subscription. + */ + displayName: string; + /** + * Management group Id for the subscription. + */ + managementGroupId?: string; + /** + * Tags for the subscription + */ + tags?: { [propertyName: string]: string }; +} + +/** + * The parameters required to accept subscription ownership. + */ +export interface AcceptOwnershipRequest { + /** + * Accept subscription ownership request properties. + */ + properties?: AcceptOwnershipRequestProperties; +} + +/** + * Subscription Accept Ownership Response + */ +export interface AcceptOwnershipStatusResponse { + /** + * Newly created subscription Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly subscriptionId?: string; + /** + * Possible values include: 'Pending', 'Completed', 'Expired' + */ + acceptOwnershipState?: AcceptOwnership; + /** + * UPN of the billing owner + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly billingOwner?: string; + /** + * Tenant Id of the subscription + */ + subscriptionTenantId?: string; + /** + * The display name of the subscription. + */ + displayName?: string; + /** + * Tags for the subscription + */ + tags?: { [propertyName: string]: string }; +} + +/** + * Put tenant policy request properties. + */ +export interface PutTenantPolicyRequestProperties { + /** + * Blocks the leaving of subscriptions from user's tenant. + */ + blockSubscriptionsLeavingTenant?: boolean; + /** + * Blocks the entering of subscriptions into user's tenant. + */ + blockSubscriptionsIntoTenant?: boolean; + /** + * List of user objectIds that are exempted from the set subscription tenant policies for the + * user's tenant. + */ + exemptedPrincipals?: string[]; +} + +/** + * Tenant policy. + */ +export interface TenantPolicy { + /** + * Policy Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly policyId?: string; + /** + * Blocks the leaving of subscriptions from user's tenant. + */ + blockSubscriptionsLeavingTenant?: boolean; + /** + * Blocks the entering of subscriptions into user's tenant. + */ + blockSubscriptionsIntoTenant?: boolean; + /** + * List of user objectIds that are exempted from the set subscription tenant policies for the + * user's tenant. + */ + exemptedPrincipals?: string[]; +} + +/** + * Tenant policy Information. + */ +export interface GetTenantPolicyResponse extends BaseResource { + /** + * Policy Id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Policy name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Tenant policy properties. + */ + properties?: TenantPolicy; + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + +/** + * Billing account service tenant. + */ +export interface ServiceTenantResponse { + /** + * Service tenant id. + */ + tenantId?: string; + /** + * Service tenant name. + */ + tenantName?: string; +} + +/** + * Put billing account policies response properties. + */ +export interface BillingAccountPoliciesResponseProperties { + /** + * Service tenant for the billing account. + */ + serviceTenants?: ServiceTenantResponse[]; + /** + * Determine if the transfers are allowed for the billing account + */ + allowTransfers?: boolean; +} + +/** + * Billing account policies information. + */ +export interface BillingAccountPoliciesResponse extends BaseResource { + /** + * Fully qualified ID for the policy. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * Policy name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * Billing account policies response properties. + */ + properties?: BillingAccountPoliciesResponseProperties; + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly systemData?: SystemData; +} + /** * An interface representing SubscriptionClientOptions. */ @@ -342,73 +510,82 @@ export interface SubscriptionClientOptions extends AzureServiceClientOptions { } /** - * @interface - * Location list operation response. - * @extends Array + * Defines headers for AcceptOwnership operation. */ -export interface LocationListResult extends Array { +export interface SubscriptionAcceptOwnershipHeaders { + /** + * 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 - * Subscription list operation response. - * @extends Array + * Result of the request to list operations. It contains a list of operations and a URL link to get + * the next set of results. + * @extends Array */ -export interface SubscriptionListResult extends Array { +export interface OperationListResult extends Array { /** - * The URL to get the next set of results. + * URL to get the next set of operation list results if there are any. */ - nextLink: string; + nextLink?: string; } /** * @interface - * Tenant Ids information. - * @extends Array + * Tenant policy information list. + * @extends Array */ -export interface TenantListResult extends Array { +export interface GetTenantPolicyListResponse extends Array { /** - * The URL to use for getting the next set of results. + * The link (url) to the next page of results. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - nextLink: string; + readonly nextLink?: string; } /** - * Defines values for SubscriptionState. - * Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted' + * Defines values for Workload. + * Possible values include: 'Production', 'DevTest' * @readonly * @enum {string} */ -export type SubscriptionState = 'Enabled' | 'Warned' | 'PastDue' | 'Disabled' | 'Deleted'; +export type Workload = 'Production' | 'DevTest'; /** - * Defines values for SpendingLimit. - * Possible values include: 'On', 'Off', 'CurrentPeriodOff' + * Defines values for ProvisioningState. + * Possible values include: 'Accepted', 'Succeeded', 'Failed' * @readonly * @enum {string} */ -export type SpendingLimit = 'On' | 'Off' | 'CurrentPeriodOff'; +export type ProvisioningState = 'Accepted' | 'Succeeded' | 'Failed'; /** - * Defines values for Workload. - * Possible values include: 'Production', 'DevTest' + * Defines values for AcceptOwnership. + * Possible values include: 'Pending', 'Completed', 'Expired' * @readonly * @enum {string} */ -export type Workload = 'Production' | 'DevTest'; +export type AcceptOwnership = 'Pending' | 'Completed' | 'Expired'; /** - * Defines values for ProvisioningState. - * Possible values include: 'Accepted', 'Succeeded', 'Failed' + * Defines values for CreatedByType. + * Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' * @readonly * @enum {string} */ -export type ProvisioningState = 'Accepted' | 'Succeeded' | 'Failed'; +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; /** - * Contains response data for the listLocations operation. + * Contains response data for the cancel operation. */ -export type SubscriptionsListLocationsResponse = LocationListResult & { +export type SubscriptionCancelResponse = CanceledSubscriptionId & { /** * The underlying HTTP response. */ @@ -421,14 +598,14 @@ export type SubscriptionsListLocationsResponse = LocationListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: LocationListResult; + parsedBody: CanceledSubscriptionId; }; }; /** - * Contains response data for the get operation. + * Contains response data for the rename operation. */ -export type SubscriptionsGetResponse = Subscription & { +export type SubscriptionRenameResponse = RenamedSubscriptionId & { /** * The underlying HTTP response. */ @@ -441,14 +618,14 @@ export type SubscriptionsGetResponse = Subscription & { /** * The response body as parsed JSON or XML */ - parsedBody: Subscription; + parsedBody: RenamedSubscriptionId; }; }; /** - * Contains response data for the list operation. + * Contains response data for the enable operation. */ -export type SubscriptionsListResponse = SubscriptionListResult & { +export type SubscriptionEnableResponse = EnabledSubscriptionId & { /** * The underlying HTTP response. */ @@ -461,14 +638,29 @@ export type SubscriptionsListResponse = SubscriptionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: SubscriptionListResult; + parsedBody: EnabledSubscriptionId; }; }; /** - * Contains response data for the listNext operation. + * Contains response data for the acceptOwnership operation. */ -export type SubscriptionsListNextResponse = SubscriptionListResult & { +export type SubscriptionAcceptOwnershipResponse = SubscriptionAcceptOwnershipHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: SubscriptionAcceptOwnershipHeaders; + }; +}; + +/** + * Contains response data for the acceptOwnershipStatus operation. + */ +export type SubscriptionAcceptOwnershipStatusResponse = AcceptOwnershipStatusResponse & { /** * The underlying HTTP response. */ @@ -481,14 +673,14 @@ export type SubscriptionsListNextResponse = SubscriptionListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: SubscriptionListResult; + parsedBody: AcceptOwnershipStatusResponse; }; }; /** * Contains response data for the list operation. */ -export type TenantsListResponse = TenantListResult & { +export type OperationsListResponse = OperationListResult & { /** * The underlying HTTP response. */ @@ -501,14 +693,14 @@ export type TenantsListResponse = TenantListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: TenantListResult; + parsedBody: OperationListResult; }; }; /** * Contains response data for the listNext operation. */ -export type TenantsListNextResponse = TenantListResult & { +export type OperationsListNextResponse = OperationListResult & { /** * The underlying HTTP response. */ @@ -521,14 +713,14 @@ export type TenantsListNextResponse = TenantListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: TenantListResult; + parsedBody: OperationListResult; }; }; /** - * Contains response data for the cancel operation. + * Contains response data for the create operation. */ -export type SubscriptionCancelResponse = CanceledSubscriptionId & { +export type AliasCreateResponse = SubscriptionAliasResponse & { /** * The underlying HTTP response. */ @@ -541,14 +733,14 @@ export type SubscriptionCancelResponse = CanceledSubscriptionId & { /** * The response body as parsed JSON or XML */ - parsedBody: CanceledSubscriptionId; + parsedBody: SubscriptionAliasResponse; }; }; /** - * Contains response data for the rename operation. + * Contains response data for the get operation. */ -export type SubscriptionRenameResponse = RenamedSubscriptionId & { +export type AliasGetResponse = SubscriptionAliasResponse & { /** * The underlying HTTP response. */ @@ -561,14 +753,14 @@ export type SubscriptionRenameResponse = RenamedSubscriptionId & { /** * The response body as parsed JSON or XML */ - parsedBody: RenamedSubscriptionId; + parsedBody: SubscriptionAliasResponse; }; }; /** - * Contains response data for the enable operation. + * Contains response data for the list operation. */ -export type SubscriptionEnableResponse = EnabledSubscriptionId & { +export type AliasListResponse = SubscriptionAliasListResult & { /** * The underlying HTTP response. */ @@ -581,14 +773,14 @@ export type SubscriptionEnableResponse = EnabledSubscriptionId & { /** * The response body as parsed JSON or XML */ - parsedBody: EnabledSubscriptionId; + parsedBody: SubscriptionAliasListResult; }; }; /** - * Contains response data for the list operation. + * Contains response data for the beginCreate operation. */ -export type OperationsListResponse = OperationListResult & { +export type AliasBeginCreateResponse = SubscriptionAliasResponse & { /** * The underlying HTTP response. */ @@ -601,14 +793,14 @@ export type OperationsListResponse = OperationListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: OperationListResult; + parsedBody: SubscriptionAliasResponse; }; }; /** - * Contains response data for the create operation. + * Contains response data for the addUpdatePolicyForTenant operation. */ -export type AliasCreateResponse = PutAliasResponse & { +export type SubscriptionPolicyAddUpdatePolicyForTenantResponse = GetTenantPolicyResponse & { /** * The underlying HTTP response. */ @@ -621,14 +813,14 @@ export type AliasCreateResponse = PutAliasResponse & { /** * The response body as parsed JSON or XML */ - parsedBody: PutAliasResponse; + parsedBody: GetTenantPolicyResponse; }; }; /** - * Contains response data for the get operation. + * Contains response data for the getPolicyForTenant operation. */ -export type AliasGetResponse = PutAliasResponse & { +export type SubscriptionPolicyGetPolicyForTenantResponse = GetTenantPolicyResponse & { /** * The underlying HTTP response. */ @@ -641,14 +833,14 @@ export type AliasGetResponse = PutAliasResponse & { /** * The response body as parsed JSON or XML */ - parsedBody: PutAliasResponse; + parsedBody: GetTenantPolicyResponse; }; }; /** - * Contains response data for the list operation. + * Contains response data for the listPolicyForTenant operation. */ -export type AliasListResponse = PutAliasListResult & { +export type SubscriptionPolicyListPolicyForTenantResponse = GetTenantPolicyListResponse & { /** * The underlying HTTP response. */ @@ -661,14 +853,34 @@ export type AliasListResponse = PutAliasListResult & { /** * The response body as parsed JSON or XML */ - parsedBody: PutAliasListResult; + parsedBody: GetTenantPolicyListResponse; }; }; /** - * Contains response data for the beginCreate operation. + * Contains response data for the listPolicyForTenantNext operation. + */ +export type SubscriptionPolicyListPolicyForTenantNextResponse = GetTenantPolicyListResponse & { + /** + * 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: GetTenantPolicyListResponse; + }; +}; + +/** + * Contains response data for the getPolicy operation. */ -export type AliasBeginCreateResponse = PutAliasResponse & { +export type BillingAccountGetPolicyResponse = BillingAccountPoliciesResponse & { /** * The underlying HTTP response. */ @@ -681,6 +893,6 @@ export type AliasBeginCreateResponse = PutAliasResponse & { /** * The response body as parsed JSON or XML */ - parsedBody: PutAliasResponse; + parsedBody: BillingAccountPoliciesResponse; }; }; diff --git a/sdk/subscription/arm-subscriptions/src/models/mappers.ts b/sdk/subscription/arm-subscriptions/src/models/mappers.ts index cbf65acfac67..2776932728bc 100644 --- a/sdk/subscription/arm-subscriptions/src/models/mappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -12,176 +12,6 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; -export const Location: msRest.CompositeMapper = { - serializedName: "Location", - type: { - name: "Composite", - className: "Location", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - subscriptionId: { - readOnly: true, - serializedName: "subscriptionId", - type: { - name: "String" - } - }, - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - displayName: { - readOnly: true, - serializedName: "displayName", - type: { - name: "String" - } - }, - latitude: { - readOnly: true, - serializedName: "latitude", - type: { - name: "String" - } - }, - longitude: { - readOnly: true, - serializedName: "longitude", - type: { - name: "String" - } - } - } - } -}; - -export const SubscriptionPolicies: msRest.CompositeMapper = { - serializedName: "SubscriptionPolicies", - type: { - name: "Composite", - className: "SubscriptionPolicies", - modelProperties: { - locationPlacementId: { - readOnly: true, - serializedName: "locationPlacementId", - type: { - name: "String" - } - }, - quotaId: { - readOnly: true, - serializedName: "quotaId", - type: { - name: "String" - } - }, - spendingLimit: { - readOnly: true, - serializedName: "spendingLimit", - type: { - name: "Enum", - allowedValues: [ - "On", - "Off", - "CurrentPeriodOff" - ] - } - } - } - } -}; - -export const Subscription: msRest.CompositeMapper = { - serializedName: "Subscription", - type: { - name: "Composite", - className: "Subscription", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - subscriptionId: { - readOnly: true, - serializedName: "subscriptionId", - type: { - name: "String" - } - }, - displayName: { - readOnly: true, - serializedName: "displayName", - type: { - name: "String" - } - }, - state: { - readOnly: true, - serializedName: "state", - type: { - name: "Enum", - allowedValues: [ - "Enabled", - "Warned", - "PastDue", - "Disabled", - "Deleted" - ] - } - }, - subscriptionPolicies: { - serializedName: "subscriptionPolicies", - type: { - name: "Composite", - className: "SubscriptionPolicies" - } - }, - authorizationSource: { - serializedName: "authorizationSource", - type: { - name: "String" - } - } - } - } -}; - -export const TenantIdDescription: msRest.CompositeMapper = { - serializedName: "TenantIdDescription", - type: { - name: "Composite", - className: "TenantIdDescription", - modelProperties: { - id: { - readOnly: true, - serializedName: "id", - type: { - name: "String" - } - }, - tenantId: { - readOnly: true, - serializedName: "tenantId", - type: { - name: "String" - } - } - } - } -}; - export const ErrorResponse: msRest.CompositeMapper = { serializedName: "ErrorResponse", type: { @@ -216,6 +46,18 @@ export const ErrorResponseBody: msRest.CompositeMapper = { name: "Composite", className: "ErrorResponse" } + }, + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } } } } @@ -311,6 +153,12 @@ export const OperationDisplay: msRest.CompositeMapper = { type: { name: "String" } + }, + description: { + serializedName: "description", + type: { + name: "String" + } } } } @@ -328,6 +176,12 @@ export const Operation: msRest.CompositeMapper = { name: "String" } }, + isDataAction: { + serializedName: "isDataAction", + type: { + name: "Boolean" + } + }, display: { serializedName: "display", type: { @@ -339,29 +193,40 @@ export const Operation: msRest.CompositeMapper = { } }; -export const OperationListResult: msRest.CompositeMapper = { - serializedName: "OperationListResult", +export const PutAliasRequestAdditionalProperties: msRest.CompositeMapper = { + serializedName: "PutAliasRequestAdditionalProperties", type: { name: "Composite", - className: "OperationListResult", + className: "PutAliasRequestAdditionalProperties", modelProperties: { - value: { - serializedName: "value", + managementGroupId: { + serializedName: "managementGroupId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", + subscriptionTenantId: { + serializedName: "subscriptionTenantId", + type: { + name: "String" + } + }, + subscriptionOwnerId: { + serializedName: "subscriptionOwnerId", type: { name: "String" } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -402,6 +267,13 @@ export const PutAliasRequestProperties: msRest.CompositeMapper = { type: { name: "String" } + }, + additionalProperties: { + serializedName: "additionalProperties", + type: { + name: "Composite", + className: "PutAliasRequestAdditionalProperties" + } } } } @@ -414,7 +286,6 @@ export const PutAliasRequest: msRest.CompositeMapper = { className: "PutAliasRequest", modelProperties: { properties: { - required: true, serializedName: "properties", type: { name: "Composite", @@ -425,11 +296,11 @@ export const PutAliasRequest: msRest.CompositeMapper = { } }; -export const PutAliasResponseProperties: msRest.CompositeMapper = { - serializedName: "PutAliasResponseProperties", +export const SubscriptionAliasResponseProperties: msRest.CompositeMapper = { + serializedName: "SubscriptionAliasResponseProperties", type: { name: "Composite", - className: "PutAliasResponseProperties", + className: "SubscriptionAliasResponseProperties", modelProperties: { subscriptionId: { readOnly: true, @@ -438,21 +309,127 @@ export const PutAliasResponseProperties: msRest.CompositeMapper = { name: "String" } }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, provisioningState: { serializedName: "provisioningState", type: { name: "String" } + }, + acceptOwnershipUrl: { + readOnly: true, + serializedName: "acceptOwnershipUrl", + type: { + name: "String" + } + }, + acceptOwnershipState: { + serializedName: "acceptOwnershipState", + type: { + name: "String" + } + }, + billingScope: { + serializedName: "billingScope", + type: { + name: "String" + } + }, + workload: { + serializedName: "workload", + type: { + name: "String" + } + }, + resellerId: { + serializedName: "resellerId", + type: { + name: "String" + } + }, + subscriptionOwnerId: { + serializedName: "subscriptionOwnerId", + type: { + name: "String" + } + }, + managementGroupId: { + serializedName: "managementGroupId", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const SystemData: msRest.CompositeMapper = { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } } } } }; -export const PutAliasResponse: msRest.CompositeMapper = { - serializedName: "PutAliasResponse", +export const SubscriptionAliasResponse: msRest.CompositeMapper = { + serializedName: "SubscriptionAliasResponse", type: { name: "Composite", - className: "PutAliasResponse", + className: "SubscriptionAliasResponse", modelProperties: { id: { readOnly: true, @@ -479,18 +456,26 @@ export const PutAliasResponse: msRest.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "PutAliasResponseProperties" + className: "SubscriptionAliasResponseProperties" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" } } } } }; -export const PutAliasListResult: msRest.CompositeMapper = { - serializedName: "PutAliasListResult", +export const SubscriptionAliasListResult: msRest.CompositeMapper = { + serializedName: "SubscriptionAliasListResult", type: { name: "Composite", - className: "PutAliasListResult", + className: "SubscriptionAliasListResult", modelProperties: { value: { readOnly: true, @@ -500,7 +485,7 @@ export const PutAliasListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "PutAliasResponse" + className: "SubscriptionAliasResponse" } } } @@ -516,33 +501,352 @@ export const PutAliasListResult: msRest.CompositeMapper = { } }; -export const LocationListResult: msRest.CompositeMapper = { - serializedName: "LocationListResult", +export const AcceptOwnershipRequestProperties: msRest.CompositeMapper = { + serializedName: "AcceptOwnershipRequestProperties", type: { name: "Composite", - className: "LocationListResult", + className: "AcceptOwnershipRequestProperties", modelProperties: { - value: { - serializedName: "", + displayName: { + required: true, + serializedName: "displayName", + type: { + name: "String" + } + }, + managementGroupId: { + serializedName: "managementGroupId", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AcceptOwnershipRequest: msRest.CompositeMapper = { + serializedName: "AcceptOwnershipRequest", + type: { + name: "Composite", + className: "AcceptOwnershipRequest", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AcceptOwnershipRequestProperties" + } + } + } + } +}; + +export const AcceptOwnershipStatusResponse: msRest.CompositeMapper = { + serializedName: "AcceptOwnershipStatusResponse", + type: { + name: "Composite", + className: "AcceptOwnershipStatusResponse", + modelProperties: { + subscriptionId: { + readOnly: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + acceptOwnershipState: { + serializedName: "acceptOwnershipState", + type: { + name: "String" + } + }, + billingOwner: { + readOnly: true, + serializedName: "billingOwner", + type: { + name: "String" + } + }, + subscriptionTenantId: { + serializedName: "subscriptionTenantId", + type: { + name: "String" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PutTenantPolicyRequestProperties: msRest.CompositeMapper = { + serializedName: "PutTenantPolicyRequestProperties", + type: { + name: "Composite", + className: "PutTenantPolicyRequestProperties", + modelProperties: { + blockSubscriptionsLeavingTenant: { + serializedName: "blockSubscriptionsLeavingTenant", + type: { + name: "Boolean" + } + }, + blockSubscriptionsIntoTenant: { + serializedName: "blockSubscriptionsIntoTenant", + type: { + name: "Boolean" + } + }, + exemptedPrincipals: { + serializedName: "exemptedPrincipals", + type: { + name: "Sequence", + element: { + type: { + name: "Uuid" + } + } + } + } + } + } +}; + +export const TenantPolicy: msRest.CompositeMapper = { + serializedName: "TenantPolicy", + type: { + name: "Composite", + className: "TenantPolicy", + modelProperties: { + policyId: { + readOnly: true, + serializedName: "policyId", + type: { + name: "String" + } + }, + blockSubscriptionsLeavingTenant: { + serializedName: "blockSubscriptionsLeavingTenant", + type: { + name: "Boolean" + } + }, + blockSubscriptionsIntoTenant: { + serializedName: "blockSubscriptionsIntoTenant", + type: { + name: "Boolean" + } + }, + exemptedPrincipals: { + serializedName: "exemptedPrincipals", + type: { + name: "Sequence", + element: { + type: { + name: "Uuid" + } + } + } + } + } + } +}; + +export const GetTenantPolicyResponse: msRest.CompositeMapper = { + serializedName: "GetTenantPolicyResponse", + type: { + name: "Composite", + className: "GetTenantPolicyResponse", + 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" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "TenantPolicy" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const ServiceTenantResponse: msRest.CompositeMapper = { + serializedName: "ServiceTenantResponse", + type: { + name: "Composite", + className: "ServiceTenantResponse", + modelProperties: { + tenantId: { + serializedName: "tenantId", + type: { + name: "String" + } + }, + tenantName: { + serializedName: "tenantName", + type: { + name: "String" + } + } + } + } +}; + +export const BillingAccountPoliciesResponseProperties: msRest.CompositeMapper = { + serializedName: "BillingAccountPoliciesResponseProperties", + type: { + name: "Composite", + className: "BillingAccountPoliciesResponseProperties", + modelProperties: { + serviceTenants: { + serializedName: "serviceTenants", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Location" + className: "ServiceTenantResponse" } } } + }, + allowTransfers: { + serializedName: "allowTransfers", + type: { + name: "Boolean" + } + } + } + } +}; + +export const BillingAccountPoliciesResponse: msRest.CompositeMapper = { + serializedName: "BillingAccountPoliciesResponse", + type: { + name: "Composite", + className: "BillingAccountPoliciesResponse", + 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" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "BillingAccountPoliciesResponseProperties" + } + }, + systemData: { + readOnly: true, + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } } } } }; -export const SubscriptionListResult: msRest.CompositeMapper = { - serializedName: "SubscriptionListResult", +export const SubscriptionAcceptOwnershipHeaders: msRest.CompositeMapper = { + serializedName: "subscription-acceptownership-headers", type: { name: "Composite", - className: "SubscriptionListResult", + className: "SubscriptionAcceptOwnershipHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", modelProperties: { value: { serializedName: "", @@ -551,13 +855,12 @@ export const SubscriptionListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", - className: "Subscription" + className: "Operation" } } } }, nextLink: { - required: true, serializedName: "nextLink", type: { name: "String" @@ -567,26 +870,27 @@ export const SubscriptionListResult: msRest.CompositeMapper = { } }; -export const TenantListResult: msRest.CompositeMapper = { - serializedName: "TenantListResult", +export const GetTenantPolicyListResponse: msRest.CompositeMapper = { + serializedName: "GetTenantPolicyListResponse", type: { name: "Composite", - className: "TenantListResult", + className: "GetTenantPolicyListResponse", modelProperties: { value: { + readOnly: true, serializedName: "", type: { name: "Sequence", element: { type: { name: "Composite", - className: "TenantIdDescription" + className: "GetTenantPolicyResponse" } } } }, nextLink: { - required: true, + readOnly: true, serializedName: "nextLink", type: { name: "String" diff --git a/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts index b8de8606cf9d..53fc76a5554f 100644 --- a/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. @@ -8,6 +8,7 @@ export { ErrorResponse, + ErrorResponseBody, Operation, OperationDisplay, OperationListResult diff --git a/sdk/subscription/arm-subscriptions/src/models/parameters.ts b/sdk/subscription/arm-subscriptions/src/models/parameters.ts index eb9a9a83971a..4ff5b787e47a 100644 --- a/sdk/subscription/arm-subscriptions/src/models/parameters.ts +++ b/sdk/subscription/arm-subscriptions/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -30,25 +29,21 @@ export const aliasName: msRest.OperationURLParameter = { } } }; -export const apiVersion0: msRest.OperationQueryParameter = { +export const apiVersion: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { required: true, - isConstant: true, serializedName: "api-version", - defaultValue: '2016-06-01', type: { name: "String" } } }; -export const apiVersion1: msRest.OperationQueryParameter = { - parameterPath: "apiVersion", +export const billingAccountId: msRest.OperationURLParameter = { + parameterPath: "billingAccountId", mapper: { required: true, - isConstant: true, - serializedName: "api-version", - defaultValue: '2020-09-01', + serializedName: "billingAccountId", type: { name: "String" } diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionMappers.ts similarity index 57% rename from sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts rename to sdk/subscription/arm-subscriptions/src/models/subscriptionMappers.ts index 3e331654cb51..1e96096a0b6c 100644 --- a/sdk/subscription/arm-subscriptions/src/models/subscriptionOperationsMappers.ts +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionMappers.ts @@ -1,15 +1,20 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { + AcceptOwnershipRequest, + AcceptOwnershipRequestProperties, + AcceptOwnershipStatusResponse, CanceledSubscriptionId, EnabledSubscriptionId, ErrorResponse, + ErrorResponseBody, RenamedSubscriptionId, + SubscriptionAcceptOwnershipHeaders, SubscriptionName } from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionPolicyMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionPolicyMappers.ts new file mode 100644 index 000000000000..ad0ade47c629 --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/models/subscriptionPolicyMappers.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + BillingAccountPoliciesResponse, + BillingAccountPoliciesResponseProperties, + ErrorResponse, + ErrorResponseBody, + GetTenantPolicyListResponse, + GetTenantPolicyResponse, + PutTenantPolicyRequestProperties, + ServiceTenantResponse, + SubscriptionAliasResponse, + SubscriptionAliasResponseProperties, + SystemData, + TenantPolicy +} from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts deleted file mode 100644 index 496058988f35..000000000000 --- a/sdk/subscription/arm-subscriptions/src/models/subscriptionsMappers.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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, - Location, - LocationListResult, - Subscription, - SubscriptionListResult, - SubscriptionPolicies -} from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts b/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts deleted file mode 100644 index 3bb2cb4ae153..000000000000 --- a/sdk/subscription/arm-subscriptions/src/models/tenantsMappers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 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, - TenantIdDescription, - TenantListResult -} from "../models/mappers"; diff --git a/sdk/subscription/arm-subscriptions/src/operations/alias.ts b/sdk/subscription/arm-subscriptions/src/operations/alias.ts index d05c98805c1f..d56d08ee6592 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/alias.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/alias.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -29,7 +28,9 @@ export class Alias { /** * Create Alias Subscription. - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param body * @param [options] The optional parameters * @returns Promise @@ -41,23 +42,29 @@ export class Alias { /** * Get Alias Subscription. - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param [options] The optional parameters * @returns Promise */ get(aliasName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param callback The callback */ - get(aliasName: string, callback: msRest.ServiceCallback): void; + get(aliasName: string, callback: msRest.ServiceCallback): void; /** - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param options The optional parameters * @param callback The callback */ - get(aliasName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(aliasName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + get(aliasName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(aliasName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { aliasName, @@ -69,18 +76,24 @@ export class Alias { /** * Delete Alias. - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param [options] The optional parameters * @returns Promise */ deleteMethod(aliasName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param callback The callback */ deleteMethod(aliasName: string, callback: msRest.ServiceCallback): void; /** - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param options The optional parameters * @param callback The callback */ @@ -96,7 +109,7 @@ export class Alias { } /** - * Get Alias Subscription. + * List Alias Subscription. * @param [options] The optional parameters * @returns Promise */ @@ -104,13 +117,13 @@ export class Alias { /** * @param callback The callback */ - list(callback: msRest.ServiceCallback): void; + 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 { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -121,7 +134,9 @@ export class Alias { /** * Create Alias Subscription. - * @param aliasName Alias Name + * @param aliasName AliasName is the name for the subscription creation request. Note that this is + * not the same as subscription name and this doesn’t have any other lifecycle need beyond the + * request for subscription creation. * @param body * @param [options] The optional parameters * @returns Promise @@ -147,14 +162,14 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.aliasName ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { - bodyMapper: Mappers.PutAliasResponse + bodyMapper: Mappers.SubscriptionAliasResponse }, default: { bodyMapper: Mappers.ErrorResponseBody @@ -170,7 +185,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { Parameters.aliasName ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -189,14 +204,14 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Subscription/aliases", queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage ], responses: { 200: { - bodyMapper: Mappers.PutAliasListResult + bodyMapper: Mappers.SubscriptionAliasListResult }, default: { bodyMapper: Mappers.ErrorResponseBody @@ -212,7 +227,7 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.aliasName ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -226,10 +241,10 @@ const beginCreateOperationSpec: msRest.OperationSpec = { }, responses: { 200: { - bodyMapper: Mappers.PutAliasResponse + bodyMapper: Mappers.SubscriptionAliasResponse }, 201: { - bodyMapper: Mappers.PutAliasResponse + bodyMapper: Mappers.SubscriptionAliasResponse }, default: { bodyMapper: Mappers.ErrorResponseBody diff --git a/sdk/subscription/arm-subscriptions/src/operations/billingAccount.ts b/sdk/subscription/arm-subscriptions/src/operations/billingAccount.ts new file mode 100644 index 000000000000..e2f3b230668d --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/operations/billingAccount.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/billingAccountMappers"; +import * as Parameters from "../models/parameters"; +import { SubscriptionClientContext } from "../subscriptionClientContext"; + +/** Class representing a BillingAccount. */ +export class BillingAccount { + private readonly client: SubscriptionClientContext; + + /** + * Create a BillingAccount. + * @param {SubscriptionClientContext} client Reference to the service client. + */ + constructor(client: SubscriptionClientContext) { + this.client = client; + } + + /** + * Get Billing Account Policy. + * @param billingAccountId Billing Account Id. + * @param [options] The optional parameters + * @returns Promise + */ + getPolicy(billingAccountId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param billingAccountId Billing Account Id. + * @param callback The callback + */ + getPolicy(billingAccountId: string, callback: msRest.ServiceCallback): void; + /** + * @param billingAccountId Billing Account Id. + * @param options The optional parameters + * @param callback The callback + */ + getPolicy(billingAccountId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPolicy(billingAccountId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + billingAccountId, + options + }, + getPolicyOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getPolicyOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default", + urlParameters: [ + Parameters.billingAccountId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BillingAccountPoliciesResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; diff --git a/sdk/subscription/arm-subscriptions/src/operations/index.ts b/sdk/subscription/arm-subscriptions/src/operations/index.ts index c08f9c29d393..ce942174d6dc 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/index.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/index.ts @@ -1,15 +1,14 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ -export * from "./subscriptions"; -export * from "./tenants"; -export * from "./subscriptionOperations"; +export * from "./subscription"; export * from "./operations"; export * from "./alias"; +export * from "./subscriptionPolicy"; +export * from "./billingAccount"; diff --git a/sdk/subscription/arm-subscriptions/src/operations/operations.ts b/sdk/subscription/arm-subscriptions/src/operations/operations.ts index a3eb16df3104..c42a48d8264a 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/operations.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -49,6 +48,34 @@ export class Operations { listOperationSpec, callback) as Promise; } + + /** + * Lists all of the available Microsoft.Subscription API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -57,7 +84,31 @@ const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.Subscription/operations", queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -67,7 +118,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseBody } }, serializer diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts b/sdk/subscription/arm-subscriptions/src/operations/subscription.ts similarity index 58% rename from sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts rename to sdk/subscription/arm-subscriptions/src/operations/subscription.ts index 324515769845..5985d15764a7 100644 --- a/sdk/subscription/arm-subscriptions/src/operations/subscriptionOperations.ts +++ b/sdk/subscription/arm-subscriptions/src/operations/subscription.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -9,17 +8,18 @@ */ 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/subscriptionOperationsMappers"; +import * as Mappers from "../models/subscriptionMappers"; import * as Parameters from "../models/parameters"; import { SubscriptionClientContext } from "../subscriptionClientContext"; -/** Class representing a SubscriptionOperations. */ -export class SubscriptionOperations { +/** Class representing a Subscription. */ +export class Subscription { private readonly client: SubscriptionClientContext; /** - * Create a SubscriptionOperations. + * Create a Subscription. * @param {SubscriptionClientContext} client Reference to the service client. */ constructor(client: SubscriptionClientContext) { @@ -113,6 +113,64 @@ export class SubscriptionOperations { enableOperationSpec, callback) as Promise; } + + /** + * Accept subscription ownership. + * @param subscriptionId Subscription Id. + * @param body + * @param [options] The optional parameters + * @returns Promise + */ + acceptOwnership(subscriptionId: string, body: Models.AcceptOwnershipRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginAcceptOwnership(subscriptionId,body,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Accept subscription ownership status. + * @param subscriptionId Subscription Id. + * @param [options] The optional parameters + * @returns Promise + */ + acceptOwnershipStatus(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param subscriptionId Subscription Id. + * @param callback The callback + */ + acceptOwnershipStatus(subscriptionId: string, callback: msRest.ServiceCallback): void; + /** + * @param subscriptionId Subscription Id. + * @param options The optional parameters + * @param callback The callback + */ + acceptOwnershipStatus(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + acceptOwnershipStatus(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + subscriptionId, + options + }, + acceptOwnershipStatusOperationSpec, + callback) as Promise; + } + + /** + * Accept subscription ownership. + * @param subscriptionId Subscription Id. + * @param body + * @param [options] The optional parameters + * @returns Promise + */ + beginAcceptOwnership(subscriptionId: string, body: Models.AcceptOwnershipRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + subscriptionId, + body, + options + }, + beginAcceptOwnershipOperationSpec, + options); + } } // Operation Specifications @@ -124,7 +182,7 @@ const cancelOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -134,7 +192,7 @@ const cancelOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.CanceledSubscriptionId }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseBody } }, serializer @@ -147,7 +205,7 @@ const renameOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -164,7 +222,7 @@ const renameOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.RenamedSubscriptionId }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseBody } }, serializer @@ -177,7 +235,7 @@ const enableOperationSpec: msRest.OperationSpec = { Parameters.subscriptionId ], queryParameters: [ - Parameters.apiVersion1 + Parameters.apiVersion ], headerParameters: [ Parameters.acceptLanguage @@ -187,7 +245,61 @@ const enableOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.EnabledSubscriptionId }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const acceptOwnershipStatusOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Subscription/{subscriptionId}/acceptOwnershipStatus", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AcceptOwnershipStatusResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const beginAcceptOwnershipOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "providers/Microsoft.Subscription/{subscriptionId}/acceptOwnership", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.AcceptOwnershipRequest, + required: true + } + }, + responses: { + 202: { + headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponseBody, + headersMapper: Mappers.SubscriptionAcceptOwnershipHeaders } }, serializer diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptionPolicy.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptionPolicy.ts new file mode 100644 index 000000000000..2f86de66c760 --- /dev/null +++ b/sdk/subscription/arm-subscriptions/src/operations/subscriptionPolicy.ts @@ -0,0 +1,224 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/subscriptionPolicyMappers"; +import * as Parameters from "../models/parameters"; +import { SubscriptionClientContext } from "../subscriptionClientContext"; + +/** Class representing a SubscriptionPolicy. */ +export class SubscriptionPolicy { + private readonly client: SubscriptionClientContext; + + /** + * Create a SubscriptionPolicy. + * @param {SubscriptionClientContext} client Reference to the service client. + */ + constructor(client: SubscriptionClientContext) { + this.client = client; + } + + /** + * Create or Update Subscription tenant policy for user's tenant. + * @param body + * @param [options] The optional parameters + * @returns Promise + */ + addUpdatePolicyForTenant(body: Models.PutTenantPolicyRequestProperties, options?: msRest.RequestOptionsBase): Promise; + /** + * @param body + * @param callback The callback + */ + addUpdatePolicyForTenant(body: Models.PutTenantPolicyRequestProperties, callback: msRest.ServiceCallback): void; + /** + * @param body + * @param options The optional parameters + * @param callback The callback + */ + addUpdatePolicyForTenant(body: Models.PutTenantPolicyRequestProperties, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + addUpdatePolicyForTenant(body: Models.PutTenantPolicyRequestProperties, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + body, + options + }, + addUpdatePolicyForTenantOperationSpec, + callback) as Promise; + } + + /** + * Get the subscription tenant policy for the user's tenant. + * @param [options] The optional parameters + * @returns Promise + */ + getPolicyForTenant(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + getPolicyForTenant(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + getPolicyForTenant(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getPolicyForTenant(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + getPolicyForTenantOperationSpec, + callback) as Promise; + } + + /** + * Get the subscription tenant policy for the user's tenant. + * @param [options] The optional parameters + * @returns Promise + */ + listPolicyForTenant(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + listPolicyForTenant(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + listPolicyForTenant(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPolicyForTenant(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listPolicyForTenantOperationSpec, + callback) as Promise; + } + + /** + * Get the subscription tenant policy for the user's tenant. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listPolicyForTenantNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listPolicyForTenantNext(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 + */ + listPolicyForTenantNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listPolicyForTenantNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listPolicyForTenantNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const addUpdatePolicyForTenantOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "providers/Microsoft.Subscription/policies/default", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.PutTenantPolicyRequestProperties, + required: true + } + }, + responses: { + 201: { + bodyMapper: Mappers.GetTenantPolicyResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const getPolicyForTenantOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Subscription/policies/default", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GetTenantPolicyResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const listPolicyForTenantOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Subscription/policies", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GetTenantPolicyListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; + +const listPolicyForTenantNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GetTenantPolicyListResponse + }, + default: { + bodyMapper: Mappers.ErrorResponseBody + } + }, + serializer +}; diff --git a/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts b/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts deleted file mode 100644 index bc8b22a21b5d..000000000000 --- a/sdk/subscription/arm-subscriptions/src/operations/subscriptions.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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/subscriptionsMappers"; -import * as Parameters from "../models/parameters"; -import { SubscriptionClientContext } from "../subscriptionClientContext"; - -/** Class representing a Subscriptions. */ -export class Subscriptions { - private readonly client: SubscriptionClientContext; - - /** - * Create a Subscriptions. - * @param {SubscriptionClientContext} client Reference to the service client. - */ - constructor(client: SubscriptionClientContext) { - this.client = client; - } - - /** - * This operation provides all the locations that are available for resource providers; however, - * each resource provider may support a subset of this list. - * @summary Gets all available geo-locations. - * @param subscriptionId The ID of the target subscription. - * @param [options] The optional parameters - * @returns Promise - */ - listLocations(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param subscriptionId The ID of the target subscription. - * @param callback The callback - */ - listLocations(subscriptionId: string, callback: msRest.ServiceCallback): void; - /** - * @param subscriptionId The ID of the target subscription. - * @param options The optional parameters - * @param callback The callback - */ - listLocations(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listLocations(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - subscriptionId, - options - }, - listLocationsOperationSpec, - callback) as Promise; - } - - /** - * Gets details about a specified subscription. - * @param subscriptionId The ID of the target subscription. - * @param [options] The optional parameters - * @returns Promise - */ - get(subscriptionId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param subscriptionId The ID of the target subscription. - * @param callback The callback - */ - get(subscriptionId: string, callback: msRest.ServiceCallback): void; - /** - * @param subscriptionId The ID of the target subscription. - * @param options The optional parameters - * @param callback The callback - */ - get(subscriptionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(subscriptionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - subscriptionId, - options - }, - getOperationSpec, - callback) as Promise; - } - - /** - * Gets all subscriptions for a tenant. - * @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; - } - - /** - * Gets all subscriptions for a tenant. - * @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 listLocationsOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}/locations", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.LocationListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions/{subscriptionId}", - urlParameters: [ - Parameters.subscriptionId - ], - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.Subscription - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; - -const listOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "subscriptions", - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.SubscriptionListResult - }, - 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.SubscriptionListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/subscription/arm-subscriptions/src/operations/tenants.ts b/sdk/subscription/arm-subscriptions/src/operations/tenants.ts deleted file mode 100644 index 2c8fe0e433ec..000000000000 --- a/sdk/subscription/arm-subscriptions/src/operations/tenants.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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/tenantsMappers"; -import * as Parameters from "../models/parameters"; -import { SubscriptionClientContext } from "../subscriptionClientContext"; - -/** Class representing a Tenants. */ -export class Tenants { - private readonly client: SubscriptionClientContext; - - /** - * Create a Tenants. - * @param {SubscriptionClientContext} client Reference to the service client. - */ - constructor(client: SubscriptionClientContext) { - this.client = client; - } - - /** - * Gets the tenants for your account. - * @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; - } - - /** - * Gets the tenants for your account. - * @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: "tenants", - queryParameters: [ - Parameters.apiVersion0 - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.TenantListResult - }, - 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.TenantListResult - }, - default: { - bodyMapper: Mappers.CloudError - } - }, - serializer -}; diff --git a/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts b/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts index 1422cd860dec..cd74fd3858bb 100644 --- a/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts +++ b/sdk/subscription/arm-subscriptions/src/subscriptionClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -18,11 +17,11 @@ import { SubscriptionClientContext } from "./subscriptionClientContext"; class SubscriptionClient extends SubscriptionClientContext { // Operation groups - subscriptions: operations.Subscriptions; - tenants: operations.Tenants; - subscription: operations.SubscriptionOperations; + subscription: operations.Subscription; operations: operations.Operations; alias: operations.Alias; + subscriptionPolicy: operations.SubscriptionPolicy; + billingAccount: operations.BillingAccount; /** * Initializes a new instance of the SubscriptionClient class. @@ -36,11 +35,11 @@ class SubscriptionClient extends SubscriptionClientContext { */ constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.SubscriptionClientOptions) { super(credentials, options); - this.subscriptions = new operations.Subscriptions(this); - this.tenants = new operations.Tenants(this); - this.subscription = new operations.SubscriptionOperations(this); + this.subscription = new operations.Subscription(this); this.operations = new operations.Operations(this); this.alias = new operations.Alias(this); + this.subscriptionPolicy = new operations.SubscriptionPolicy(this); + this.billingAccount = new operations.BillingAccount(this); } } diff --git a/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts b/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts index 8b8cf37027c5..06687f999ba3 100644 --- a/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts +++ b/sdk/subscription/arm-subscriptions/src/subscriptionClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -10,14 +9,15 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-subscriptions"; const packageVersion = "3.1.2"; export class SubscriptionClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials | TokenCredential; + apiVersion?: string; /** * Initializes a new instance of the SubscriptionClient class. @@ -44,6 +44,7 @@ export class SubscriptionClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); + this.apiVersion = '2021-10-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";