From e28c72c28de107e292d7c476d16a53fafabbfc6e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 13 Oct 2022 05:00:01 +0000 Subject: [PATCH] CodeGen from PR 21094 in Azure/azure-rest-api-specs Merge 462a415dad3e0e36e7441c4e1931e4262c603df5 into c71a66dab813061f1d09982c2748a09317fe0860 --- ...re.ResourceManager.Redis.netstandard2.0.cs | 10 ++++- .../Models/ExportRdbContent.Serialization.cs | 5 +++ .../src/Generated/Models/ExportRdbContent.cs | 2 + .../Models/ImportRdbContent.Serialization.cs | 5 +++ .../src/Generated/Models/ImportRdbContent.cs | 2 + .../Models/RedisCreateOrUpdateContent.cs | 2 +- ...ServerWithPropertyCreateOrUpdateContent.cs | 4 ++ ...kedServerWithPropertyData.Serialization.cs | 14 ++++++- .../src/Generated/Models/RedisPatch.cs | 2 +- .../src/Generated/RedisData.cs | 4 +- .../RedisLinkedServerWithPropertyData.cs | 10 ++++- .../RedisLinkedServerWithPropertyResource.cs | 4 +- .../src/Generated/RedisResource.cs | 40 +++++++++++-------- .../AsyncOperationStatusRestOperations.cs | 2 +- .../FirewallRulesRestOperations.cs | 2 +- .../LinkedServerRestOperations.cs | 6 +-- .../PatchSchedulesRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 4 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../RestOperations/RedisRestOperations.cs | 22 ++++------ .../src/autorest.md | 2 +- 21 files changed, 96 insertions(+), 50 deletions(-) diff --git a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs index 7eb11da16e96..f91e7d165cda 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/api/Azure.ResourceManager.Redis.netstandard2.0.cs @@ -111,8 +111,10 @@ protected RedisLinkedServerWithPropertyCollection() { } public partial class RedisLinkedServerWithPropertyData : Azure.ResourceManager.Models.ResourceData { public RedisLinkedServerWithPropertyData() { } + public string GeoReplicatedPrimaryHostName { get { throw null; } } public Azure.Core.ResourceIdentifier LinkedRedisCacheId { get { throw null; } set { } } public Azure.Core.AzureLocation? LinkedRedisCacheLocation { get { throw null; } set { } } + public string PrimaryHostName { get { throw null; } } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.Redis.Models.RedisLinkedServerRole? ServerRole { get { throw null; } set { } } } @@ -244,8 +246,8 @@ protected RedisResource() { } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.Redis.Models.RedisPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Redis.Models.RedisPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.Models.RedisPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.Models.RedisPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Redis.Models @@ -255,6 +257,7 @@ public partial class ExportRdbContent public ExportRdbContent(string prefix, string container) { } public string Container { get { throw null; } } public string Format { get { throw null; } set { } } + public string PreferredDataArchiveAuthMethod { get { throw null; } set { } } public string Prefix { get { throw null; } } } public partial class ImportRdbContent @@ -262,6 +265,7 @@ public partial class ImportRdbContent public ImportRdbContent(System.Collections.Generic.IEnumerable files) { } public System.Collections.Generic.IList Files { get { throw null; } } public string Format { get { throw null; } set { } } + public string PreferredDataArchiveAuthMethod { get { throw null; } set { } } } public partial class RedisAccessKeys { @@ -345,8 +349,10 @@ public enum RedisLinkedServerRole public partial class RedisLinkedServerWithPropertyCreateOrUpdateContent { public RedisLinkedServerWithPropertyCreateOrUpdateContent(Azure.Core.ResourceIdentifier linkedRedisCacheId, Azure.Core.AzureLocation linkedRedisCacheLocation, Azure.ResourceManager.Redis.Models.RedisLinkedServerRole serverRole) { } + public string GeoReplicatedPrimaryHostName { get { throw null; } } public Azure.Core.ResourceIdentifier LinkedRedisCacheId { get { throw null; } } public Azure.Core.AzureLocation LinkedRedisCacheLocation { get { throw null; } } + public string PrimaryHostName { get { throw null; } } public Azure.ResourceManager.Redis.Models.RedisLinkedServerRole ServerRole { get { throw null; } } } public partial class RedisNameAvailabilityContent diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.Serialization.cs index c3765a3a4238..f6bc6f109a34 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.Serialization.cs @@ -24,6 +24,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Prefix); writer.WritePropertyName("container"); writer.WriteStringValue(Container); + if (Optional.IsDefined(PreferredDataArchiveAuthMethod)) + { + writer.WritePropertyName("preferred-data-archive-auth-method"); + writer.WriteStringValue(PreferredDataArchiveAuthMethod); + } writer.WriteEndObject(); } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.cs index dc76c67f59c9..84ab8edf472c 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ExportRdbContent.cs @@ -37,5 +37,7 @@ public ExportRdbContent(string prefix, string container) public string Prefix { get; } /// Container name to export to. public string Container { get; } + /// Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS. + public string PreferredDataArchiveAuthMethod { get; set; } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.Serialization.cs index 6900eefda5f0..45cdb2b2799d 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.Serialization.cs @@ -27,6 +27,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(item); } writer.WriteEndArray(); + if (Optional.IsDefined(PreferredDataArchiveAuthMethod)) + { + writer.WritePropertyName("preferred-data-archive-auth-method"); + writer.WriteStringValue(PreferredDataArchiveAuthMethod); + } writer.WriteEndObject(); } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.cs index b132ba43a5f6..2d1b41539c2e 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/ImportRdbContent.cs @@ -31,5 +31,7 @@ public ImportRdbContent(IEnumerable files) public string Format { get; set; } /// files to import. public IList Files { get; } + /// Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS. + public string PreferredDataArchiveAuthMethod { get; set; } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs index eaccce9f0f32..a5c3d5d5d690 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCreateOrUpdateContent.cs @@ -44,7 +44,7 @@ public RedisCreateOrUpdateContent(AzureLocation location, RedisSku sku) public ManagedServiceIdentity Identity { get; set; } /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. public RedisCommonConfiguration RedisConfiguration { get; set; } - /// Redis version. Only major version will be used in PUT/PATCH request with current valid values: (4, 6). + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. public string RedisVersion { get; set; } /// Specifies whether the non-ssl Redis server port (6379) is enabled. public bool? EnableNonSslPort { get; set; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyCreateOrUpdateContent.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyCreateOrUpdateContent.cs index 86566950e0f6..1ed6df308298 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyCreateOrUpdateContent.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyCreateOrUpdateContent.cs @@ -36,5 +36,9 @@ public RedisLinkedServerWithPropertyCreateOrUpdateContent(ResourceIdentifier lin public AzureLocation LinkedRedisCacheLocation { get; } /// Role of the linked server. public RedisLinkedServerRole ServerRole { get; } + /// The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + public string GeoReplicatedPrimaryHostName { get; } + /// The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + public string PrimaryHostName { get; } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyData.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyData.Serialization.cs index 89b0fbad8ba6..a8feee21753e 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyData.Serialization.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisLinkedServerWithPropertyData.Serialization.cs @@ -47,6 +47,8 @@ internal static RedisLinkedServerWithPropertyData DeserializeRedisLinkedServerWi Optional linkedRedisCacheId = default; Optional linkedRedisCacheLocation = default; Optional serverRole = default; + Optional geoReplicatedPrimaryHostName = default; + Optional primaryHostName = default; Optional provisioningState = default; foreach (var property in element.EnumerateObject()) { @@ -114,6 +116,16 @@ internal static RedisLinkedServerWithPropertyData DeserializeRedisLinkedServerWi serverRole = property0.Value.GetString().ToRedisLinkedServerRole(); continue; } + if (property0.NameEquals("geoReplicatedPrimaryHostName")) + { + geoReplicatedPrimaryHostName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("primaryHostName")) + { + primaryHostName = property0.Value.GetString(); + continue; + } if (property0.NameEquals("provisioningState")) { provisioningState = property0.Value.GetString(); @@ -123,7 +135,7 @@ internal static RedisLinkedServerWithPropertyData DeserializeRedisLinkedServerWi continue; } } - return new RedisLinkedServerWithPropertyData(id, name, type, systemData.Value, linkedRedisCacheId.Value, Optional.ToNullable(linkedRedisCacheLocation), Optional.ToNullable(serverRole), provisioningState.Value); + return new RedisLinkedServerWithPropertyData(id, name, type, systemData.Value, linkedRedisCacheId.Value, Optional.ToNullable(linkedRedisCacheLocation), Optional.ToNullable(serverRole), geoReplicatedPrimaryHostName.Value, primaryHostName.Value, provisioningState.Value); } } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs index f21dbe96769b..626bb41e6789 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisPatch.cs @@ -27,7 +27,7 @@ public RedisPatch() public ManagedServiceIdentity Identity { get; set; } /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. public RedisCommonConfiguration RedisConfiguration { get; set; } - /// Redis version. Only major version will be used in PUT/PATCH request with current valid values: (4, 6). + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. public string RedisVersion { get; set; } /// Specifies whether the non-ssl Redis server port (6379) is enabled. public bool? EnableNonSslPort { get; set; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs index 361adf110f84..804bf9e9bcb6 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisData.cs @@ -47,7 +47,7 @@ public RedisData(AzureLocation location, RedisSku sku) : base(location) /// A list of availability zones denoting where the resource needs to come from. /// The identity of the resource. /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. - /// Redis version. Only major version will be used in PUT/PATCH request with current valid values: (4, 6). + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. /// Specifies whether the non-ssl Redis server port (6379) is enabled. /// The number of replicas to be created per primary. /// The number of replicas to be created per primary. @@ -98,7 +98,7 @@ internal RedisData(ResourceIdentifier id, string name, ResourceType resourceType public ManagedServiceIdentity Identity { get; set; } /// All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc. public RedisCommonConfiguration RedisConfiguration { get; set; } - /// Redis version. Only major version will be used in PUT/PATCH request with current valid values: (4, 6). + /// Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. public string RedisVersion { get; set; } /// Specifies whether the non-ssl Redis server port (6379) is enabled. public bool? EnableNonSslPort { get; set; } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyData.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyData.cs index 4b1015eb32de..debf83c0b06c 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyData.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyData.cs @@ -27,12 +27,16 @@ public RedisLinkedServerWithPropertyData() /// Fully qualified resourceId of the linked redis cache. /// Location of the linked redis cache. /// Role of the linked server. + /// The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + /// The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. /// Terminal state of the link between primary and secondary redis cache. - internal RedisLinkedServerWithPropertyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier linkedRedisCacheId, AzureLocation? linkedRedisCacheLocation, RedisLinkedServerRole? serverRole, string provisioningState) : base(id, name, resourceType, systemData) + internal RedisLinkedServerWithPropertyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier linkedRedisCacheId, AzureLocation? linkedRedisCacheLocation, RedisLinkedServerRole? serverRole, string geoReplicatedPrimaryHostName, string primaryHostName, string provisioningState) : base(id, name, resourceType, systemData) { LinkedRedisCacheId = linkedRedisCacheId; LinkedRedisCacheLocation = linkedRedisCacheLocation; ServerRole = serverRole; + GeoReplicatedPrimaryHostName = geoReplicatedPrimaryHostName; + PrimaryHostName = primaryHostName; ProvisioningState = provisioningState; } @@ -42,6 +46,10 @@ internal RedisLinkedServerWithPropertyData(ResourceIdentifier id, string name, R public AzureLocation? LinkedRedisCacheLocation { get; set; } /// Role of the linked server. public RedisLinkedServerRole? ServerRole { get; set; } + /// The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. + public string GeoReplicatedPrimaryHostName { get; } + /// The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. + public string PrimaryHostName { get; } /// Terminal state of the link between primary and secondary redis cache. public string ProvisioningState { get; } } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs index 8c654f8ac0e3..1090001bdc91 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisLinkedServerWithPropertyResource.cs @@ -149,7 +149,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _redisLinkedServerWithPropertyLinkedServerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new RedisArmOperation(response); + var operation = new RedisArmOperation(_redisLinkedServerWithPropertyLinkedServerClientDiagnostics, Pipeline, _redisLinkedServerWithPropertyLinkedServerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -175,7 +175,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _redisLinkedServerWithPropertyLinkedServerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new RedisArmOperation(response); + var operation = new RedisArmOperation(_redisLinkedServerWithPropertyLinkedServerClientDiagnostics, Pipeline, _redisLinkedServerWithPropertyLinkedServerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs index 4d58466e427a..4afe3fdeebd8 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs @@ -342,10 +342,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name} /// Operation Id: Redis_Update /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Parameters supplied to the Update Redis operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(RedisPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RedisPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -354,7 +355,10 @@ public virtual async Task> UpdateAsync(RedisPatch patch, try { var response = await _redisRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new RedisResource(Client, response.Value), response.GetRawResponse()); + var operation = new RedisArmOperation(new RedisOperationSource(Client), _redisClientDiagnostics, Pipeline, _redisRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -368,10 +372,11 @@ public virtual async Task> UpdateAsync(RedisPatch patch, /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name} /// Operation Id: Redis_Update /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// Parameters supplied to the Update Redis operation. /// The cancellation token to use. /// is null. - public virtual Response Update(RedisPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, RedisPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -380,7 +385,10 @@ public virtual Response Update(RedisPatch patch, CancellationToke try { var response = _redisRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new RedisResource(Client, response.Value), response.GetRawResponse()); + var operation = new RedisArmOperation(new RedisOperationSource(Client), _redisClientDiagnostics, Pipeline, _redisRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { @@ -832,8 +840,8 @@ public virtual async Task> AddTagAsync(string key, strin patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -878,8 +886,8 @@ public virtual Response AddTag(string key, string value, Cancella patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -919,8 +927,8 @@ public virtual async Task> SetTagsAsync(IDictionary SetTags(IDictionary tags, var current = Get(cancellationToken: cancellationToken).Value.Data; var patch = new RedisPatch(); patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1004,8 +1012,8 @@ public virtual async Task> RemoveTagAsync(string key, Ca patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -1048,8 +1056,8 @@ public virtual Response RemoveTag(string key, CancellationToken c patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs index 30edfffb3811..7f458e51384c 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AsyncOperationStatusRestOperations.cs @@ -33,7 +33,7 @@ public AsyncOperationStatusRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs index 347f19e90132..ba1fe934effb 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -33,7 +33,7 @@ public FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs index 6e52e03bb4ab..655dc54a8093 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/LinkedServerRestOperations.cs @@ -33,7 +33,7 @@ public LinkedServerRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -163,7 +163,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 204: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); @@ -190,7 +190,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string n switch (message.Response.Status) { case 200: - case 204: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs index da621d795431..88211c1d86e3 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PatchSchedulesRestOperations.cs @@ -33,7 +33,7 @@ public PatchSchedulesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 6c578fa64a89..c8cfee2cbede 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -251,6 +251,7 @@ public async Task PutAsync(string subscriptionId, string resourceGroup await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 201: return message.Response; default: @@ -279,6 +280,7 @@ public Response Put(string subscriptionId, string resourceGroupName, string cach _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 201: return message.Response; default: diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index ba4746fb3692..d1dfa9df1355 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs index 49a95d01afd3..783a28cf6bb6 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/RedisRestOperations.cs @@ -33,7 +33,7 @@ public RedisRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -294,7 +294,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string name, RedisPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string name, RedisPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -306,12 +306,8 @@ public async Task> UpdateAsync(string subscriptionId, string switch (message.Response.Status) { case 200: - { - RedisData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RedisData.DeserializeRedisData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -325,7 +321,7 @@ public async Task> UpdateAsync(string subscriptionId, string /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string name, RedisPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string name, RedisPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -337,12 +333,8 @@ public Response Update(string subscriptionId, string resourceGroupNam switch (message.Response.Status) { case 200: - { - RedisData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RedisData.DeserializeRedisData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md index 2edac747fa2d..490304b4cd33 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md +++ b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Redis namespace: Azure.ResourceManager.Redis -require: https://github.com/Azure/azure-rest-api-specs/blob/5419bfc41fe7a45955df3f342c4d5d81ea785a35/specification/redis/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/redis/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true