From a4f7646ea0274e9d7513c508d1feec85fdede2af Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 14 Jan 2020 04:41:21 +0000 Subject: [PATCH] Generated from ee4887ccc72028d2430ca2204bc957f7a755df47 Update common.json --- .../src/Generated/IMixedRealityClient.cs | 7 +- .../IRemoteRenderingAccountsOperations.cs | 268 +++ .../ISpatialAnchorsAccountsOperations.cs | 38 +- .../src/Generated/MixedRealityClient.cs | 10 +- .../Generated/MixedRealityClientExtensions.cs | 4 +- ...uest.cs => AccountKeyRegenerateRequest.cs} | 16 +- ...alAnchorsAccountKeys.cs => AccountKeys.cs} | 12 +- .../Models/RemoteRenderingAccount.cs | 85 + .../Generated/Models/SpatialAnchorsAccount.cs | 5 +- .../RemoteRenderingAccountsOperations.cs | 2130 +++++++++++++++++ ...teRenderingAccountsOperationsExtensions.cs | 410 ++++ .../Generated/SdkInfo_MixedRealityClient.cs | 18 +- .../SpatialAnchorsAccountsOperations.cs | 200 +- ...tialAnchorsAccountsOperationsExtensions.cs | 100 +- 14 files changed, 3098 insertions(+), 205 deletions(-) create mode 100644 sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IRemoteRenderingAccountsOperations.cs rename sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/{SpatialAnchorsAccountKeyRegenerateRequest.cs => AccountKeyRegenerateRequest.cs} (71%) rename sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/{SpatialAnchorsAccountKeys.cs => AccountKeys.cs} (78%) create mode 100644 sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/RemoteRenderingAccount.cs create mode 100644 sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperations.cs create mode 100644 sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperationsExtensions.cs diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IMixedRealityClient.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IMixedRealityClient.cs index 6b0ea968d3a4..d59eeb5bd609 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IMixedRealityClient.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IMixedRealityClient.cs @@ -78,13 +78,18 @@ public partial interface IMixedRealityClient : System.IDisposable /// IOperations Operations { get; } + /// + /// Gets the IRemoteRenderingAccountsOperations. + /// + IRemoteRenderingAccountsOperations RemoteRenderingAccounts { get; } + /// /// Gets the ISpatialAnchorsAccountsOperations. /// ISpatialAnchorsAccountsOperations SpatialAnchorsAccounts { get; } /// - /// Check Name Availability for global uniqueness + /// Check Name Availability for local uniqueness /// /// /// The location in which uniqueness will be verified. diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IRemoteRenderingAccountsOperations.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IRemoteRenderingAccountsOperations.cs new file mode 100644 index 000000000000..572ac5d35ef2 --- /dev/null +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/IRemoteRenderingAccountsOperations.cs @@ -0,0 +1,268 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.MixedReality +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RemoteRenderingAccountsOperations operations. + /// + public partial interface IRemoteRenderingAccountsOperations + { + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Resources by Resource Group + /// + /// + /// Name of an Azure resource group. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updating a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creating or Updating a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get Both of the 2 Keys of a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerate specified Key of a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// serial of key to be regenerated + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List Resources by Resource Group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/ISpatialAnchorsAccountsOperations.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/ISpatialAnchorsAccountsOperations.cs index 9154c962357f..660e746b08d7 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/ISpatialAnchorsAccountsOperations.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/ISpatialAnchorsAccountsOperations.cs @@ -70,8 +70,8 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The headers that will be added to request. @@ -85,15 +85,15 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieve a Spatial Anchors Account. /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The headers that will be added to request. @@ -110,15 +110,15 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updating a Spatial Anchors Account /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -138,15 +138,15 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creating or Updating a Spatial Anchors Account. /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -166,15 +166,15 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get Both of the 2 Keys of a Spatial Anchors Account /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The headers that will be added to request. @@ -191,15 +191,15 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerate 1 Key of a Spatial Anchors Account + /// Regenerate specified Key of a Spatial Anchors Account /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// serial of key to be regenerated @@ -219,7 +219,7 @@ public partial interface ISpatialAnchorsAccountsOperations /// /// Thrown when a required parameter is null /// - Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List Spatial Anchors Accounts by Subscription /// diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClient.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClient.cs index 09341992ef12..289b40e9b681 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClient.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClient.cs @@ -81,6 +81,11 @@ public partial class MixedRealityClient : ServiceClient, IMi /// public virtual IOperations Operations { get; private set; } + /// + /// Gets the IRemoteRenderingAccountsOperations. + /// + public virtual IRemoteRenderingAccountsOperations RemoteRenderingAccounts { get; private set; } + /// /// Gets the ISpatialAnchorsAccountsOperations. /// @@ -328,9 +333,10 @@ public MixedRealityClient(System.Uri baseUri, ServiceClientCredentials credentia private void Initialize() { Operations = new Operations(this); + RemoteRenderingAccounts = new RemoteRenderingAccountsOperations(this); SpatialAnchorsAccounts = new SpatialAnchorsAccountsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-02-28-preview"; + ApiVersion = "2019-12-02-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -365,7 +371,7 @@ private void Initialize() DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } /// - /// Check Name Availability for global uniqueness + /// Check Name Availability for local uniqueness /// /// /// The location in which uniqueness will be verified. diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClientExtensions.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClientExtensions.cs index 1378b6111271..bfa97ad36e93 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClientExtensions.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/MixedRealityClientExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.MixedReality public static partial class MixedRealityClientExtensions { /// - /// Check Name Availability for global uniqueness + /// Check Name Availability for local uniqueness /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static CheckNameAvailabilityResponse CheckNameAvailabilityLocal(this IMix } /// - /// Check Name Availability for global uniqueness + /// Check Name Availability for local uniqueness /// /// /// The operations group for this extension method. diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeyRegenerateRequest.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeyRegenerateRequest.cs similarity index 71% rename from sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeyRegenerateRequest.cs rename to sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeyRegenerateRequest.cs index 8371efe986cc..53d73879c40a 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeyRegenerateRequest.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeyRegenerateRequest.cs @@ -14,25 +14,25 @@ namespace Microsoft.Azure.Management.MixedReality.Models using System.Linq; /// - /// Spatial Anchors Account Regenerate Key + /// Request for account key regeneration /// - public partial class SpatialAnchorsAccountKeyRegenerateRequest + public partial class AccountKeyRegenerateRequest { /// - /// Initializes a new instance of the - /// SpatialAnchorsAccountKeyRegenerateRequest class. + /// Initializes a new instance of the AccountKeyRegenerateRequest + /// class. /// - public SpatialAnchorsAccountKeyRegenerateRequest() + public AccountKeyRegenerateRequest() { CustomInit(); } /// - /// Initializes a new instance of the - /// SpatialAnchorsAccountKeyRegenerateRequest class. + /// Initializes a new instance of the AccountKeyRegenerateRequest + /// class. /// /// serial of key to be regenerated - public SpatialAnchorsAccountKeyRegenerateRequest(int? serial = default(int?)) + public AccountKeyRegenerateRequest(int? serial = default(int?)) { Serial = serial; CustomInit(); diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeys.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeys.cs similarity index 78% rename from sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeys.cs rename to sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeys.cs index 476896aded66..1cadee620a46 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccountKeys.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/AccountKeys.cs @@ -14,24 +14,24 @@ namespace Microsoft.Azure.Management.MixedReality.Models using System.Linq; /// - /// Spatial Anchors Account Keys + /// Developer Keys of account /// - public partial class SpatialAnchorsAccountKeys + public partial class AccountKeys { /// - /// Initializes a new instance of the SpatialAnchorsAccountKeys class. + /// Initializes a new instance of the AccountKeys class. /// - public SpatialAnchorsAccountKeys() + public AccountKeys() { CustomInit(); } /// - /// Initializes a new instance of the SpatialAnchorsAccountKeys class. + /// Initializes a new instance of the AccountKeys class. /// /// value of primary key. /// value of secondary key. - public SpatialAnchorsAccountKeys(string primaryKey = default(string), string secondaryKey = default(string)) + public AccountKeys(string primaryKey = default(string), string secondaryKey = default(string)) { PrimaryKey = primaryKey; SecondaryKey = secondaryKey; diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/RemoteRenderingAccount.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/RemoteRenderingAccount.cs new file mode 100644 index 000000000000..e0bc6ca57b32 --- /dev/null +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/RemoteRenderingAccount.cs @@ -0,0 +1,85 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.MixedReality.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// RemoteRenderingAccount Response. + /// + [Rest.Serialization.JsonTransformation] + public partial class RemoteRenderingAccount : TrackedResource + { + /// + /// Initializes a new instance of the RemoteRenderingAccount class. + /// + public RemoteRenderingAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RemoteRenderingAccount class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource Id for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. Ex- + /// Microsoft.Compute/virtualMachines or + /// Microsoft.Storage/storageAccounts. + /// Resource tags. + /// unique id of certain account. + /// Correspond domain name of certain + /// Spatial Anchors Account + public RemoteRenderingAccount(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string accountId = default(string), string accountDomain = default(string)) + : base(location, id, name, type, tags) + { + AccountId = accountId; + AccountDomain = accountDomain; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets unique id of certain account. + /// + [JsonProperty(PropertyName = "properties.accountId")] + public string AccountId { get; private set; } + + /// + /// Gets correspond domain name of certain Spatial Anchors Account + /// + [JsonProperty(PropertyName = "properties.accountDomain")] + public string AccountDomain { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccount.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccount.cs index 12c9dae04e30..5a29a4bbbb5c 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccount.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/Models/SpatialAnchorsAccount.cs @@ -43,8 +43,7 @@ public SpatialAnchorsAccount() /// Microsoft.Compute/virtualMachines or /// Microsoft.Storage/storageAccounts. /// Resource tags. - /// unique id of certain Spatial Anchors - /// Account data contract. + /// unique id of certain account. /// Correspond domain name of certain /// Spatial Anchors Account public SpatialAnchorsAccount(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string accountId = default(string), string accountDomain = default(string)) @@ -61,7 +60,7 @@ public SpatialAnchorsAccount() partial void CustomInit(); /// - /// Gets unique id of certain Spatial Anchors Account data contract. + /// Gets unique id of certain account. /// [JsonProperty(PropertyName = "properties.accountId")] public string AccountId { get; private set; } diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperations.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperations.cs new file mode 100644 index 000000000000..6c1594712c29 --- /dev/null +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperations.cs @@ -0,0 +1,2130 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.MixedReality +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RemoteRenderingAccountsOperations operations. + /// + internal partial class RemoteRenderingAccountsOperations : IServiceOperations, IRemoteRenderingAccountsOperations + { + /// + /// Initializes a new instance of the RemoteRenderingAccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RemoteRenderingAccountsOperations(MixedRealityClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the MixedRealityClient + /// + public MixedRealityClient Client { get; private set; } + + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Resources by Resource Group + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updating a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (remoteRenderingAccount == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "remoteRenderingAccount"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("remoteRenderingAccount", remoteRenderingAccount); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(remoteRenderingAccount != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(remoteRenderingAccount, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creating or Updating a Remote Rendering Account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (remoteRenderingAccount == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "remoteRenderingAccount"); + } + if (remoteRenderingAccount != null) + { + remoteRenderingAccount.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("remoteRenderingAccount", remoteRenderingAccount); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(remoteRenderingAccount != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(remoteRenderingAccount, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get Both of the 2 Keys of a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/keys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerate specified Key of a Remote Rendering Account + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// serial of key to be regenerated + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); + } + if (accountName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); + if (serial != null) + { + regenerate.Serial = serial; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("regenerate", regenerate); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/remoteRenderingAccounts/{accountName}/keys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(regenerate != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(regenerate, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List Resources by Resource Group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperationsExtensions.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperationsExtensions.cs new file mode 100644 index 000000000000..48ae43908d72 --- /dev/null +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/RemoteRenderingAccountsOperationsExtensions.cs @@ -0,0 +1,410 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.MixedReality +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RemoteRenderingAccountsOperations. + /// + public static partial class RemoteRenderingAccountsOperationsExtensions + { + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IRemoteRenderingAccountsOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IRemoteRenderingAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Resources by Resource Group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + public static IPage ListByResourceGroup(this IRemoteRenderingAccountsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// List Resources by Resource Group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + public static void Delete(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName) + { + operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Delete a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + public static RemoteRenderingAccount Get(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName) + { + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updating a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + public static RemoteRenderingAccount Update(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount) + { + return operations.UpdateAsync(resourceGroupName, accountName, remoteRenderingAccount).GetAwaiter().GetResult(); + } + + /// + /// Updating a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, remoteRenderingAccount, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creating or Updating a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + public static RemoteRenderingAccount Create(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount) + { + return operations.CreateAsync(resourceGroupName, accountName, remoteRenderingAccount).GetAwaiter().GetResult(); + } + + /// + /// Creating or Updating a Remote Rendering Account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// Remote Rendering Account parameter. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, RemoteRenderingAccount remoteRenderingAccount, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, remoteRenderingAccount, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get Both of the 2 Keys of a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + public static AccountKeys GetKeys(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName) + { + return operations.GetKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Get Both of the 2 Keys of a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// The cancellation token. + /// + public static async Task GetKeysAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Regenerate specified Key of a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// serial of key to be regenerated + /// + public static AccountKeys RegenerateKeys(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, int? serial = 1) + { + return operations.RegenerateKeysAsync(resourceGroupName, accountName, serial).GetAwaiter().GetResult(); + } + + /// + /// Regenerate specified Key of a Remote Rendering Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Name of an Mixed Reality Account. + /// + /// + /// serial of key to be regenerated + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateKeysAsync(this IRemoteRenderingAccountsOperations operations, string resourceGroupName, string accountName, int? serial = 1, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, accountName, serial, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IRemoteRenderingAccountsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Remote Rendering Accounts by Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IRemoteRenderingAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List Resources by Resource Group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IRemoteRenderingAccountsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Resources by Resource Group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IRemoteRenderingAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SdkInfo_MixedRealityClient.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SdkInfo_MixedRealityClient.cs index c6d01f6ffc5b..7a8524812fbc 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SdkInfo_MixedRealityClient.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SdkInfo_MixedRealityClient.cs @@ -19,22 +19,12 @@ public static IEnumerable> ApiInfo_MixedRealityCli { return new Tuple[] { - new Tuple("MixedReality", "CheckNameAvailabilityLocal", "2019-02-28-preview"), - new Tuple("MixedReality", "Operations", "2019-02-28-preview"), - new Tuple("MixedReality", "SpatialAnchorsAccounts", "2019-02-28-preview"), + new Tuple("MixedReality", "CheckNameAvailabilityLocal", "2019-12-02-preview"), + new Tuple("MixedReality", "Operations", "2019-12-02-preview"), + new Tuple("MixedReality", "RemoteRenderingAccounts", "2019-12-02-preview"), + new Tuple("MixedReality", "SpatialAnchorsAccounts", "2019-12-02-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/mixedreality/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Git\\GitHub\\my\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "547a0b3e90ecab25d6f318fa57db97b35f26f270"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperations.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperations.cs index b77475b3d298..cb6aef9b5acb 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperations.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperations.cs @@ -426,8 +426,8 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Headers that will be added to request. @@ -447,7 +447,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -472,23 +472,23 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (Client.ApiVersion == null) @@ -503,16 +503,16 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -626,8 +626,8 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Headers that will be added to request. @@ -650,7 +650,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -675,23 +675,23 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (Client.ApiVersion == null) @@ -706,16 +706,16 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -847,8 +847,8 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -874,7 +874,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -899,23 +899,23 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (spatialAnchorsAccount == null) @@ -934,17 +934,17 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("spatialAnchorsAccount", spatialAnchorsAccount); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1082,8 +1082,8 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -1109,7 +1109,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1134,23 +1134,23 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (spatialAnchorsAccount == null) @@ -1173,17 +1173,17 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("spatialAnchorsAccount", spatialAnchorsAccount); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1339,8 +1339,8 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Headers that will be added to request. @@ -1363,7 +1363,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1388,23 +1388,23 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (Client.ApiVersion == null) @@ -1419,16 +1419,16 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/keys").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1522,7 +1522,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1535,7 +1535,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1555,13 +1555,13 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) } /// - /// Regenerate 1 Key of a Spatial Anchors Account + /// Regenerate specified Key of a Spatial Anchors Account /// /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// serial of key to be regenerated @@ -1587,7 +1587,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string spatialAnchorsAccountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegenerateKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, int? serial = 1, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1612,33 +1612,33 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - if (spatialAnchorsAccountName == null) + if (accountName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "spatialAnchorsAccountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (spatialAnchorsAccountName != null) + if (accountName != null) { - if (spatialAnchorsAccountName.Length > 90) + if (accountName.Length > 90) { - throw new ValidationException(ValidationRules.MaxLength, "spatialAnchorsAccountName", 90); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 90); } - if (spatialAnchorsAccountName.Length < 1) + if (accountName.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "spatialAnchorsAccountName", 1); + throw new ValidationException(ValidationRules.MinLength, "accountName", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(spatialAnchorsAccountName, "^[-\\w\\._\\(\\)]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._\\(\\)]+$")) { - throw new ValidationException(ValidationRules.Pattern, "spatialAnchorsAccountName", "^[-\\w\\._\\(\\)]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._\\(\\)]+$"); } } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - SpatialAnchorsAccountKeyRegenerateRequest spatialAnchorsAccountKeyRegenerate = new SpatialAnchorsAccountKeyRegenerateRequest(); + AccountKeyRegenerateRequest regenerate = new AccountKeyRegenerateRequest(); if (serial != null) { - spatialAnchorsAccountKeyRegenerate.Serial = serial; + regenerate.Serial = serial; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1648,17 +1648,17 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("spatialAnchorsAccountName", spatialAnchorsAccountName); - tracingParameters.Add("spatialAnchorsAccountKeyRegenerate", spatialAnchorsAccountKeyRegenerate); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("regenerate", regenerate); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "RegenerateKeys", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}/keys").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{spatialAnchorsAccountName}", System.Uri.EscapeDataString(spatialAnchorsAccountName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1702,9 +1702,9 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) // Serialize Request string _requestContent = null; - if(spatialAnchorsAccountKeyRegenerate != null) + if(regenerate != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(spatialAnchorsAccountKeyRegenerate, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(regenerate, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -1758,7 +1758,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1771,7 +1771,7 @@ internal SpatialAnchorsAccountsOperations(MixedRealityClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperationsExtensions.cs b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperationsExtensions.cs index 30d135989500..6df0944cac54 100644 --- a/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperationsExtensions.cs +++ b/sdk/mixedreality/Microsoft.Azure.Management.MixedReality/src/Generated/SpatialAnchorsAccountsOperationsExtensions.cs @@ -92,12 +92,12 @@ public static IPage ListByResourceGroup(this ISpatialAnch /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// - public static void Delete(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName) + public static void Delete(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName) { - operations.DeleteAsync(resourceGroupName, spatialAnchorsAccountName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -109,15 +109,15 @@ public static void Delete(this ISpatialAnchorsAccountsOperations operations, str /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -129,12 +129,12 @@ public static void Delete(this ISpatialAnchorsAccountsOperations operations, str /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// - public static SpatialAnchorsAccount Get(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName) + public static SpatialAnchorsAccount Get(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName) { - return operations.GetAsync(resourceGroupName, spatialAnchorsAccountName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -146,15 +146,15 @@ public static SpatialAnchorsAccount Get(this ISpatialAnchorsAccountsOperations o /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -169,15 +169,15 @@ public static SpatialAnchorsAccount Get(this ISpatialAnchorsAccountsOperations o /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. /// - public static SpatialAnchorsAccount Update(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount) + public static SpatialAnchorsAccount Update(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount) { - return operations.UpdateAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, accountName, spatialAnchorsAccount).GetAwaiter().GetResult(); } /// @@ -189,8 +189,8 @@ public static SpatialAnchorsAccount Update(this ISpatialAnchorsAccountsOperation /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -198,9 +198,9 @@ public static SpatialAnchorsAccount Update(this ISpatialAnchorsAccountsOperation /// /// The cancellation token. /// - public static async Task UpdateAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, spatialAnchorsAccount, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -215,15 +215,15 @@ public static SpatialAnchorsAccount Update(this ISpatialAnchorsAccountsOperation /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. /// - public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount) + public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount) { - return operations.CreateAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, spatialAnchorsAccount).GetAwaiter().GetResult(); } /// @@ -235,8 +235,8 @@ public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperation /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// Spatial Anchors Account parameter. @@ -244,9 +244,9 @@ public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperation /// /// The cancellation token. /// - public static async Task CreateAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, SpatialAnchorsAccount spatialAnchorsAccount, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, SpatialAnchorsAccount spatialAnchorsAccount, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, spatialAnchorsAccount, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -261,12 +261,12 @@ public static SpatialAnchorsAccount Create(this ISpatialAnchorsAccountsOperation /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// - public static SpatialAnchorsAccountKeys GetKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName) + public static AccountKeys GetKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName) { - return operations.GetKeysAsync(resourceGroupName, spatialAnchorsAccountName).GetAwaiter().GetResult(); + return operations.GetKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -278,22 +278,22 @@ public static SpatialAnchorsAccountKeys GetKeys(this ISpatialAnchorsAccountsOper /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// The cancellation token. /// - public static async Task GetKeysAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetKeysAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetKeysWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Regenerate 1 Key of a Spatial Anchors Account + /// Regenerate specified Key of a Spatial Anchors Account /// /// /// The operations group for this extension method. @@ -301,19 +301,19 @@ public static SpatialAnchorsAccountKeys GetKeys(this ISpatialAnchorsAccountsOper /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// serial of key to be regenerated /// - public static SpatialAnchorsAccountKeys RegenerateKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, int? serial = 1) + public static AccountKeys RegenerateKeys(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, int? serial = 1) { - return operations.RegenerateKeysAsync(resourceGroupName, spatialAnchorsAccountName, serial).GetAwaiter().GetResult(); + return operations.RegenerateKeysAsync(resourceGroupName, accountName, serial).GetAwaiter().GetResult(); } /// - /// Regenerate 1 Key of a Spatial Anchors Account + /// Regenerate specified Key of a Spatial Anchors Account /// /// /// The operations group for this extension method. @@ -321,8 +321,8 @@ public static SpatialAnchorsAccountKeys RegenerateKeys(this ISpatialAnchorsAccou /// /// Name of an Azure resource group. /// - /// - /// Name of an Mixed Reality Spatial Anchors Account. + /// + /// Name of an Mixed Reality Account. /// /// /// serial of key to be regenerated @@ -330,9 +330,9 @@ public static SpatialAnchorsAccountKeys RegenerateKeys(this ISpatialAnchorsAccou /// /// The cancellation token. /// - public static async Task RegenerateKeysAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string spatialAnchorsAccountName, int? serial = 1, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RegenerateKeysAsync(this ISpatialAnchorsAccountsOperations operations, string resourceGroupName, string accountName, int? serial = 1, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, spatialAnchorsAccountName, serial, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateKeysWithHttpMessagesAsync(resourceGroupName, accountName, serial, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }