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 b653dcf46afb..fbbb92b14200 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 @@ -1,5 +1,76 @@ namespace Azure.ResourceManager.Redis { + public partial class RedisCacheAccessPolicyAssignmentSetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RedisCacheAccessPolicyAssignmentSetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accessPolicyName, Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accessPolicyName, Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RedisCacheAccessPolicyAssignmentSetData : Azure.ResourceManager.Models.ResourceData + { + public RedisCacheAccessPolicyAssignmentSetData() { } + public System.Collections.Generic.IList Assignments { get { throw null; } } + public Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState? ProvisioningState { get { throw null; } } + } + public partial class RedisCacheAccessPolicyAssignmentSetResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RedisCacheAccessPolicyAssignmentSetResource() { } + public virtual Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RedisCacheAccessPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RedisCacheAccessPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string accessPolicyName, Azure.ResourceManager.Redis.RedisCacheAccessPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string accessPolicyName, Azure.ResourceManager.Redis.RedisCacheAccessPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RedisCacheAccessPolicyData : Azure.ResourceManager.Models.ResourceData + { + public RedisCacheAccessPolicyData() { } + public string Permissions { get { throw null; } set { } } + public Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Redis.Models.AccessPolicyType? TypePropertiesType { get { throw null; } } + } + public partial class RedisCacheAccessPolicyResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RedisCacheAccessPolicyResource() { } + public virtual Azure.ResourceManager.Redis.RedisCacheAccessPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.RedisCacheAccessPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Redis.RedisCacheAccessPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class RedisCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RedisCollection() { } @@ -52,6 +123,8 @@ public static partial class RedisExtensions public static System.Threading.Tasks.Task> GetAsyncOperationStatusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetRedis(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetRedisAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetResource GetRedisCacheAccessPolicyAssignmentSetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Redis.RedisCacheAccessPolicyResource GetRedisCacheAccessPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Redis.RedisFirewallRuleResource GetRedisFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Redis.RedisLinkedServerWithPropertyResource GetRedisLinkedServerWithPropertyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Redis.RedisPatchScheduleResource GetRedisPatchScheduleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -224,6 +297,12 @@ protected RedisResource() { } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetPrivateLinkResourcesByRedisCache(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPrivateLinkResourcesByRedisCacheAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Redis.RedisCacheAccessPolicyCollection GetRedisCacheAccessPolicies() { throw null; } + public virtual Azure.Response GetRedisCacheAccessPolicy(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRedisCacheAccessPolicyAssignmentSet(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRedisCacheAccessPolicyAssignmentSetAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Redis.RedisCacheAccessPolicyAssignmentSetCollection GetRedisCacheAccessPolicyAssignmentSets() { throw null; } + public virtual System.Threading.Tasks.Task> GetRedisCacheAccessPolicyAsync(string accessPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetRedisFirewallRule(string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetRedisFirewallRuleAsync(string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Redis.RedisFirewallRuleCollection GetRedisFirewallRules() { throw null; } @@ -258,6 +337,68 @@ protected RedisResource() { } } namespace Azure.ResourceManager.Redis.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessPolicyAssignmentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessPolicyAssignmentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState left, Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState left, Azure.ResourceManager.Redis.Models.AccessPolicyAssignmentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessPolicyProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessPolicyProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState left, Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState left, Azure.ResourceManager.Redis.Models.AccessPolicyProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessPolicyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessPolicyType(string value) { throw null; } + public static Azure.ResourceManager.Redis.Models.AccessPolicyType BuiltIn { get { throw null; } } + public static Azure.ResourceManager.Redis.Models.AccessPolicyType Custom { get { throw null; } } + public bool Equals(Azure.ResourceManager.Redis.Models.AccessPolicyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Redis.Models.AccessPolicyType left, Azure.ResourceManager.Redis.Models.AccessPolicyType right) { throw null; } + public static implicit operator Azure.ResourceManager.Redis.Models.AccessPolicyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Redis.Models.AccessPolicyType left, Azure.ResourceManager.Redis.Models.AccessPolicyType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ExportRdbContent { public ExportRdbContent(string prefix, string container) { } @@ -279,6 +420,12 @@ internal RedisAccessKeys() { } public string PrimaryKey { get { throw null; } } public string SecondaryKey { get { throw null; } } } + public partial class RedisCacheAccessPolicyAssignment + { + public RedisCacheAccessPolicyAssignment(string objectId, string objectIdAlias) { } + public string ObjectId { get { throw null; } set { } } + public string ObjectIdAlias { get { throw null; } set { } } + } public partial class RedisCommonConfiguration { public RedisCommonConfiguration() { } diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs index fdc0de743d62..a55a4a72dcca 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Extensions/RedisExtensions.cs @@ -145,6 +145,44 @@ public static RedisPrivateEndpointConnectionResource GetRedisPrivateEndpointConn } #endregion + #region RedisCacheAccessPolicyResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RedisCacheAccessPolicyResource GetRedisCacheAccessPolicyResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + RedisCacheAccessPolicyResource.ValidateResourceId(id); + return new RedisCacheAccessPolicyResource(client, id); + } + ); + } + #endregion + + #region RedisCacheAccessPolicyAssignmentSetResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RedisCacheAccessPolicyAssignmentSetResource GetRedisCacheAccessPolicyAssignmentSetResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + RedisCacheAccessPolicyAssignmentSetResource.ValidateResourceId(id); + return new RedisCacheAccessPolicyAssignmentSetResource(client, id); + } + ); + } + #endregion + /// Gets a collection of RedisResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of RedisResources and their operations over a RedisResource. diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyAssignmentSetOperationSource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyAssignmentSetOperationSource.cs new file mode 100644 index 000000000000..51eea7003c43 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyAssignmentSetOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + internal class RedisCacheAccessPolicyAssignmentSetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RedisCacheAccessPolicyAssignmentSetOperationSource(ArmClient client) + { + _client = client; + } + + RedisCacheAccessPolicyAssignmentSetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(document.RootElement); + return new RedisCacheAccessPolicyAssignmentSetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(document.RootElement); + return new RedisCacheAccessPolicyAssignmentSetResource(_client, data); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyOperationSource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyOperationSource.cs new file mode 100644 index 000000000000..8521782d0799 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/LongRunningOperation/RedisCacheAccessPolicyOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + internal class RedisCacheAccessPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RedisCacheAccessPolicyOperationSource(ArmClient client) + { + _client = client; + } + + RedisCacheAccessPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(document.RootElement); + return new RedisCacheAccessPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(document.RootElement); + return new RedisCacheAccessPolicyResource(_client, data); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyAssignmentProvisioningState.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyAssignmentProvisioningState.cs new file mode 100644 index 000000000000..94f574bc743c --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyAssignmentProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Provisioning state of an access policy assignment set. + public readonly partial struct AccessPolicyAssignmentProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessPolicyAssignmentProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UpdatingValue = "Updating"; + private const string SucceededValue = "Succeeded"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string CanceledValue = "Canceled"; + private const string FailedValue = "Failed"; + + /// Updating. + public static AccessPolicyAssignmentProvisioningState Updating { get; } = new AccessPolicyAssignmentProvisioningState(UpdatingValue); + /// Succeeded. + public static AccessPolicyAssignmentProvisioningState Succeeded { get; } = new AccessPolicyAssignmentProvisioningState(SucceededValue); + /// Deleting. + public static AccessPolicyAssignmentProvisioningState Deleting { get; } = new AccessPolicyAssignmentProvisioningState(DeletingValue); + /// Deleted. + public static AccessPolicyAssignmentProvisioningState Deleted { get; } = new AccessPolicyAssignmentProvisioningState(DeletedValue); + /// Canceled. + public static AccessPolicyAssignmentProvisioningState Canceled { get; } = new AccessPolicyAssignmentProvisioningState(CanceledValue); + /// Failed. + public static AccessPolicyAssignmentProvisioningState Failed { get; } = new AccessPolicyAssignmentProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AccessPolicyAssignmentProvisioningState left, AccessPolicyAssignmentProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessPolicyAssignmentProvisioningState left, AccessPolicyAssignmentProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AccessPolicyAssignmentProvisioningState(string value) => new AccessPolicyAssignmentProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessPolicyAssignmentProvisioningState other && Equals(other); + /// + public bool Equals(AccessPolicyAssignmentProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyProvisioningState.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyProvisioningState.cs new file mode 100644 index 000000000000..e8d6c1a0516e --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Provisioning state of access policy. + public readonly partial struct AccessPolicyProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessPolicyProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UpdatingValue = "Updating"; + private const string SucceededValue = "Succeeded"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string CanceledValue = "Canceled"; + private const string FailedValue = "Failed"; + + /// Updating. + public static AccessPolicyProvisioningState Updating { get; } = new AccessPolicyProvisioningState(UpdatingValue); + /// Succeeded. + public static AccessPolicyProvisioningState Succeeded { get; } = new AccessPolicyProvisioningState(SucceededValue); + /// Deleting. + public static AccessPolicyProvisioningState Deleting { get; } = new AccessPolicyProvisioningState(DeletingValue); + /// Deleted. + public static AccessPolicyProvisioningState Deleted { get; } = new AccessPolicyProvisioningState(DeletedValue); + /// Canceled. + public static AccessPolicyProvisioningState Canceled { get; } = new AccessPolicyProvisioningState(CanceledValue); + /// Failed. + public static AccessPolicyProvisioningState Failed { get; } = new AccessPolicyProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AccessPolicyProvisioningState left, AccessPolicyProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessPolicyProvisioningState left, AccessPolicyProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AccessPolicyProvisioningState(string value) => new AccessPolicyProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessPolicyProvisioningState other && Equals(other); + /// + public bool Equals(AccessPolicyProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyType.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyType.cs new file mode 100644 index 000000000000..71f627d787b5 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/AccessPolicyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Built-In or Custom access policy. + public readonly partial struct AccessPolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CustomValue = "Custom"; + private const string BuiltInValue = "BuiltIn"; + + /// Custom. + public static AccessPolicyType Custom { get; } = new AccessPolicyType(CustomValue); + /// BuiltIn. + public static AccessPolicyType BuiltIn { get; } = new AccessPolicyType(BuiltInValue); + /// Determines if two values are the same. + public static bool operator ==(AccessPolicyType left, AccessPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessPolicyType left, AccessPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AccessPolicyType(string value) => new AccessPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessPolicyType other && Equals(other); + /// + public bool Equals(AccessPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.Serialization.cs new file mode 100644 index 000000000000..972a12ac7a35 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Redis.Models +{ + public partial class RedisCacheAccessPolicyAssignment : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + writer.WritePropertyName("objectIdAlias"u8); + writer.WriteStringValue(ObjectIdAlias); + writer.WriteEndObject(); + } + + internal static RedisCacheAccessPolicyAssignment DeserializeRedisCacheAccessPolicyAssignment(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string objectId = default; + string objectIdAlias = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectIdAlias"u8)) + { + objectIdAlias = property.Value.GetString(); + continue; + } + } + return new RedisCacheAccessPolicyAssignment(objectId, objectIdAlias); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.cs new file mode 100644 index 000000000000..e52ee8c80622 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignment.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.Redis.Models +{ + /// Properties for an access policy assignment. + public partial class RedisCacheAccessPolicyAssignment + { + /// Initializes a new instance of RedisCacheAccessPolicyAssignment. + /// Object Id to assign access policy to. + /// User friendly name for object id. Also represents username for token based authentication. + /// or is null. + public RedisCacheAccessPolicyAssignment(string objectId, string objectIdAlias) + { + Argument.AssertNotNull(objectId, nameof(objectId)); + Argument.AssertNotNull(objectIdAlias, nameof(objectIdAlias)); + + ObjectId = objectId; + ObjectIdAlias = objectIdAlias; + } + + /// Object Id to assign access policy to. + public string ObjectId { get; set; } + /// User friendly name for object id. Also represents username for token based authentication. + public string ObjectIdAlias { get; set; } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.Serialization.cs new file mode 100644 index 000000000000..f297dc683194 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Models +{ + internal partial class RedisCacheAccessPolicyAssignmentList + { + internal static RedisCacheAccessPolicyAssignmentList DeserializeRedisCacheAccessPolicyAssignmentList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new RedisCacheAccessPolicyAssignmentList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.cs new file mode 100644 index 000000000000..62ae6e12f4e5 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Models +{ + /// List of access policies assignments (with properties) of a Redis cache. + internal partial class RedisCacheAccessPolicyAssignmentList + { + /// Initializes a new instance of RedisCacheAccessPolicyAssignmentList. + internal RedisCacheAccessPolicyAssignmentList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RedisCacheAccessPolicyAssignmentList. + /// List of access policies assignments (with properties) of a Redis cache. + /// Link for next set. + internal RedisCacheAccessPolicyAssignmentList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of access policies assignments (with properties) of a Redis cache. + public IReadOnlyList Value { get; } + /// Link for next set. + public string NextLink { get; } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentSetData.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentSetData.Serialization.cs new file mode 100644 index 000000000000..b163a8ecc379 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyAssignmentSetData.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + public partial class RedisCacheAccessPolicyAssignmentSetData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Assignments)) + { + writer.WritePropertyName("assignments"u8); + writer.WriteStartArray(); + foreach (var item in Assignments) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RedisCacheAccessPolicyAssignmentSetData DeserializeRedisCacheAccessPolicyAssignmentSetData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional> assignments = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AccessPolicyAssignmentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("assignments"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(RedisCacheAccessPolicyAssignment.DeserializeRedisCacheAccessPolicyAssignment(item)); + } + assignments = array; + continue; + } + } + continue; + } + } + return new RedisCacheAccessPolicyAssignmentSetData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToList(assignments)); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyData.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyData.Serialization.cs new file mode 100644 index 000000000000..46b723c27af5 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyData.Serialization.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + public partial class RedisCacheAccessPolicyData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStringValue(Permissions); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static RedisCacheAccessPolicyData DeserializeRedisCacheAccessPolicyData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional type0 = default; + Optional permissions = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AccessPolicyProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = new AccessPolicyType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("permissions"u8)) + { + permissions = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new RedisCacheAccessPolicyData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(type0), permissions.Value); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.Serialization.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.Serialization.cs new file mode 100644 index 000000000000..6ab21b4cdc80 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Models +{ + internal partial class RedisCacheAccessPolicyList + { + internal static RedisCacheAccessPolicyList DeserializeRedisCacheAccessPolicyList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new RedisCacheAccessPolicyList(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.cs new file mode 100644 index 000000000000..be07860c7b67 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/Models/RedisCacheAccessPolicyList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Redis; + +namespace Azure.ResourceManager.Redis.Models +{ + /// List of access policies (with properties) of a Redis cache. + internal partial class RedisCacheAccessPolicyList + { + /// Initializes a new instance of RedisCacheAccessPolicyList. + internal RedisCacheAccessPolicyList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RedisCacheAccessPolicyList. + /// List of access policies (with properties) of a Redis cache. + /// Link for next set. + internal RedisCacheAccessPolicyList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// List of access policies (with properties) of a Redis cache. + public IReadOnlyList Value { get; } + /// Link for next set. + public string NextLink { get; } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetCollection.cs new file mode 100644 index 000000000000..3415afac7cb6 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetCollection.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRedisCacheAccessPolicyAssignmentSets method from an instance of . + /// + public partial class RedisCacheAccessPolicyAssignmentSetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics; + private readonly AccessPolicyAssignmentRestOperations _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient; + + /// Initializes a new instance of the class for mocking. + protected RedisCacheAccessPolicyAssignmentSetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RedisCacheAccessPolicyAssignmentSetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Redis", RedisCacheAccessPolicyAssignmentSetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RedisCacheAccessPolicyAssignmentSetResource.ResourceType, out string redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentApiVersion); + _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient = new AccessPolicyAssignmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != RedisResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RedisResource.ResourceType), nameof(id)); + } + + /// + /// Adds the access policy assignment to the specified users + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_CreateUpdate + /// + /// + /// + /// 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. + /// The name of the access policy to assign. + /// Parameters supplied to the Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string accessPolicyName, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyAssignmentSetOperationSource(Client), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds the access policy assignment to the specified users + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_CreateUpdate + /// + /// + /// + /// 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. + /// The name of the access policy to assign. + /// Parameters supplied to the Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string accessPolicyName, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data, cancellationToken); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyAssignmentSetOperationSource(Client), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.Get"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyAssignmentSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.Get"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyAssignmentSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of access policy assignments associated with this redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments + /// + /// + /// Operation Id + /// AccessPolicyAssignment_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisCacheAccessPolicyAssignmentSetResource(Client, RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(e)), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, "RedisCacheAccessPolicyAssignmentSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of access policy assignments associated with this redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments + /// + /// + /// Operation Id + /// AccessPolicyAssignment_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisCacheAccessPolicyAssignmentSetResource(Client, RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(e)), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, "RedisCacheAccessPolicyAssignmentSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.Exists"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetCollection.Exists"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetData.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetData.cs new file mode 100644 index 000000000000..162226ac62a0 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetData.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A class representing the RedisCacheAccessPolicyAssignmentSet data model. + /// Response to an operation on access policy assignment + /// + public partial class RedisCacheAccessPolicyAssignmentSetData : ResourceData + { + /// Initializes a new instance of RedisCacheAccessPolicyAssignmentSetData. + public RedisCacheAccessPolicyAssignmentSetData() + { + Assignments = new ChangeTrackingList(); + } + + /// Initializes a new instance of RedisCacheAccessPolicyAssignmentSetData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning state of an access policy assignment set. + /// + internal RedisCacheAccessPolicyAssignmentSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AccessPolicyAssignmentProvisioningState? provisioningState, IList assignments) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + Assignments = assignments; + } + + /// Provisioning state of an access policy assignment set. + public AccessPolicyAssignmentProvisioningState? ProvisioningState { get; } + /// Gets the assignments. + public IList Assignments { get; } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetResource.cs new file mode 100644 index 000000000000..45db6312fd68 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyAssignmentSetResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A Class representing a RedisCacheAccessPolicyAssignmentSet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRedisCacheAccessPolicyAssignmentSetResource method. + /// Otherwise you can get one from its parent resource using the GetRedisCacheAccessPolicyAssignmentSet method. + /// + public partial class RedisCacheAccessPolicyAssignmentSetResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics; + private readonly AccessPolicyAssignmentRestOperations _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient; + private readonly RedisCacheAccessPolicyAssignmentSetData _data; + + /// Initializes a new instance of the class for mocking. + protected RedisCacheAccessPolicyAssignmentSetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RedisCacheAccessPolicyAssignmentSetResource(ArmClient client, RedisCacheAccessPolicyAssignmentSetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RedisCacheAccessPolicyAssignmentSetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Redis", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentApiVersion); + _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient = new AccessPolicyAssignmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Cache/redis/accessPolicyAssignments"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RedisCacheAccessPolicyAssignmentSetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Get"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyAssignmentSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Get"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyAssignmentSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the access policy assignment from a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Delete"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(_redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.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; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the access policy assignment from a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Delete"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RedisArmOperation(_redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds the access policy assignment to the specified users + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_CreateUpdate + /// + /// + /// + /// 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 Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Update"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyAssignmentSetOperationSource(Client), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds the access policy assignment to the specified users + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_CreateUpdate + /// + /// + /// + /// 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 Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics.CreateScope("RedisCacheAccessPolicyAssignmentSetResource.Update"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyAssignmentSetOperationSource(Client), _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentClientDiagnostics, Pipeline, _redisCacheAccessPolicyAssignmentSetAccessPolicyAssignmentRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs new file mode 100644 index 000000000000..a4e21e76dfb1 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyCollection.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRedisCacheAccessPolicies method from an instance of . + /// + public partial class RedisCacheAccessPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _redisCacheAccessPolicyAccessPolicyClientDiagnostics; + private readonly AccessPolicyRestOperations _redisCacheAccessPolicyAccessPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected RedisCacheAccessPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RedisCacheAccessPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _redisCacheAccessPolicyAccessPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Redis", RedisCacheAccessPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RedisCacheAccessPolicyResource.ResourceType, out string redisCacheAccessPolicyAccessPolicyApiVersion); + _redisCacheAccessPolicyAccessPolicyRestClient = new AccessPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, redisCacheAccessPolicyAccessPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != RedisResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RedisResource.ResourceType), nameof(id)); + } + + /// + /// Adds an access policy to the redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_CreateUpdate + /// + /// + /// + /// 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. + /// The name of the access policy that is being added to the Redis cache. + /// Parameters supplied to the Create Update Access Policy operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string accessPolicyName, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyOperationSource(Client), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds an access policy to the redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_CreateUpdate + /// + /// + /// + /// 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. + /// The name of the access policy that is being added to the Redis cache. + /// Parameters supplied to the Create Update Access Policy operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string accessPolicyName, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data, cancellationToken); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyOperationSource(Client), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.Get"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of access policies associated with this redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies + /// + /// + /// Operation Id + /// AccessPolicy_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _redisCacheAccessPolicyAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _redisCacheAccessPolicyAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RedisCacheAccessPolicyResource(Client, RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(e)), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, "RedisCacheAccessPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of access policies associated with this redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies + /// + /// + /// Operation Id + /// AccessPolicy_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _redisCacheAccessPolicyAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _redisCacheAccessPolicyAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RedisCacheAccessPolicyResource(Client, RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(e)), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, "RedisCacheAccessPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, accessPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyData.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyData.cs new file mode 100644 index 000000000000..50cfd05458d6 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyData.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A class representing the RedisCacheAccessPolicy data model. + /// Response to get/put access policy. + /// + public partial class RedisCacheAccessPolicyData : ResourceData + { + /// Initializes a new instance of RedisCacheAccessPolicyData. + public RedisCacheAccessPolicyData() + { + } + + /// Initializes a new instance of RedisCacheAccessPolicyData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning state of access policy. + /// Built-In or Custom access policy. + /// Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites. + internal RedisCacheAccessPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AccessPolicyProvisioningState? provisioningState, AccessPolicyType? typePropertiesType, string permissions) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + TypePropertiesType = typePropertiesType; + Permissions = permissions; + } + + /// Provisioning state of access policy. + public AccessPolicyProvisioningState? ProvisioningState { get; } + /// Built-In or Custom access policy. + public AccessPolicyType? TypePropertiesType { get; } + /// Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites. + public string Permissions { get; set; } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs new file mode 100644 index 000000000000..13a64a504ac7 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisCacheAccessPolicyResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.Redis +{ + /// + /// A Class representing a RedisCacheAccessPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRedisCacheAccessPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetRedisCacheAccessPolicy method. + /// + public partial class RedisCacheAccessPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _redisCacheAccessPolicyAccessPolicyClientDiagnostics; + private readonly AccessPolicyRestOperations _redisCacheAccessPolicyAccessPolicyRestClient; + private readonly RedisCacheAccessPolicyData _data; + + /// Initializes a new instance of the class for mocking. + protected RedisCacheAccessPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RedisCacheAccessPolicyResource(ArmClient client, RedisCacheAccessPolicyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RedisCacheAccessPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _redisCacheAccessPolicyAccessPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Redis", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string redisCacheAccessPolicyAccessPolicyApiVersion); + _redisCacheAccessPolicyAccessPolicyRestClient = new AccessPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, redisCacheAccessPolicyAccessPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Cache/redis/accessPolicies"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RedisCacheAccessPolicyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Get"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Get"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RedisCacheAccessPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the access policy from a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(_redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.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; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the access policy from a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Delete"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RedisArmOperation(_redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds an access policy to the redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_CreateUpdate + /// + /// + /// + /// 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 Create Update Access Policy operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Update"); + scope.Start(); + try + { + var response = await _redisCacheAccessPolicyAccessPolicyRestClient.CreateUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyOperationSource(Client), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Adds an access policy to the redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_CreateUpdate + /// + /// + /// + /// 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 Create Update Access Policy operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _redisCacheAccessPolicyAccessPolicyClientDiagnostics.CreateScope("RedisCacheAccessPolicyResource.Update"); + scope.Start(); + try + { + var response = _redisCacheAccessPolicyAccessPolicyRestClient.CreateUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RedisArmOperation(new RedisCacheAccessPolicyOperationSource(Client), _redisCacheAccessPolicyAccessPolicyClientDiagnostics, Pipeline, _redisCacheAccessPolicyAccessPolicyRestClient.CreateCreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs index d51dfdaf39ff..c04dadba6aae 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RedisResource.cs @@ -301,6 +301,112 @@ public virtual Response GetRedisPrivateE return GetRedisPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } + /// Gets a collection of RedisCacheAccessPolicyResources in the Redis. + /// An object representing collection of RedisCacheAccessPolicyResources and their operations over a RedisCacheAccessPolicyResource. + public virtual RedisCacheAccessPolicyCollection GetRedisCacheAccessPolicies() + { + return GetCachedClient(Client => new RedisCacheAccessPolicyCollection(Client, Id)); + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRedisCacheAccessPolicyAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + return await GetRedisCacheAccessPolicies().GetAsync(accessPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the detailed information about an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicy_Get + /// + /// + /// + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRedisCacheAccessPolicy(string accessPolicyName, CancellationToken cancellationToken = default) + { + return GetRedisCacheAccessPolicies().Get(accessPolicyName, cancellationToken); + } + + /// Gets a collection of RedisCacheAccessPolicyAssignmentSetResources in the Redis. + /// An object representing collection of RedisCacheAccessPolicyAssignmentSetResources and their operations over a RedisCacheAccessPolicyAssignmentSetResource. + public virtual RedisCacheAccessPolicyAssignmentSetCollection GetRedisCacheAccessPolicyAssignmentSets() + { + return GetCachedClient(Client => new RedisCacheAccessPolicyAssignmentSetCollection(Client, Id)); + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRedisCacheAccessPolicyAssignmentSetAsync(string accessPolicyName, CancellationToken cancellationToken = default) + { + return await GetRedisCacheAccessPolicyAssignmentSets().GetAsync(accessPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the list of assignments for an access policy of a redis cache + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyName} + /// + /// + /// Operation Id + /// AccessPolicyAssignment_Get + /// + /// + /// + /// The name of the assigned access policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRedisCacheAccessPolicyAssignmentSet(string accessPolicyName, CancellationToken cancellationToken = default) + { + return GetRedisCacheAccessPolicyAssignmentSets().Get(accessPolicyName, cancellationToken); + } + /// /// Gets a Redis cache (resource description). /// diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs new file mode 100644 index 000000000000..9ea4edc5d4e4 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyAssignmentRestOperations.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + internal partial class AccessPolicyAssignmentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AccessPolicyAssignmentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AccessPolicyAssignmentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyAssignmentSetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicyAssignments/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Adds the access policy assignment to the specified users. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy to assign. + /// Parameters supplied to the Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Adds the access policy assignment to the specified users. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy to assign. + /// Parameters supplied to the Create Update Access Policy Assignment operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdate(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyAssignmentSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicyAssignments/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the access policy assignment from a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy being unassigned. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the access policy assignment from a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy being unassigned. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicyAssignments/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of assignments for an access policy of a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the assigned access policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentSetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RedisCacheAccessPolicyAssignmentSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of assignments for an access policy of a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the assigned access policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentSetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyAssignmentSetData.DeserializeRedisCacheAccessPolicyAssignmentSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RedisCacheAccessPolicyAssignmentSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string cacheName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicyAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of access policy assignments associated with this redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, cacheName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyAssignmentList.DeserializeRedisCacheAccessPolicyAssignmentList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of access policy assignments associated with this redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, cacheName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyAssignmentList.DeserializeRedisCacheAccessPolicyAssignmentList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cacheName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of access policy assignments associated with this redis cache. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, cacheName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyAssignmentList.DeserializeRedisCacheAccessPolicyAssignmentList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of access policy assignments associated with this redis cache. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, cacheName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyAssignmentList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyAssignmentList.DeserializeRedisCacheAccessPolicyAssignmentList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs new file mode 100644 index 000000000000..037c13e63ab7 --- /dev/null +++ b/sdk/redis/Azure.ResourceManager.Redis/src/Generated/RestOperations/AccessPolicyRestOperations.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Redis.Models; + +namespace Azure.ResourceManager.Redis +{ + internal partial class AccessPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AccessPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AccessPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateCreateUpdateRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicies/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Adds an access policy to the redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being added to the Redis cache. + /// Parameters supplied to the Create Update Access Policy operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Adds an access policy to the redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being added to the Redis cache. + /// Parameters supplied to the Create Update Access Policy operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdate(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, RedisCacheAccessPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicies/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the access policy from a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the access policy from a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicies/", false); + uri.AppendPath(accessPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the detailed information about an access policy of a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RedisCacheAccessPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the detailed information about an access policy of a redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The name of the access policy that is being deleted from the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string cacheName, string accessPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + Argument.AssertNotNullOrEmpty(accessPolicyName, nameof(accessPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cacheName, accessPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyData.DeserializeRedisCacheAccessPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RedisCacheAccessPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string cacheName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Cache/redis/", false); + uri.AppendPath(cacheName, true); + uri.AppendPath("/accessPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of access policies associated with this redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, cacheName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyList.DeserializeRedisCacheAccessPolicyList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of access policies associated with this redis cache. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, cacheName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyList.DeserializeRedisCacheAccessPolicyList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cacheName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of access policies associated with this redis cache. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, cacheName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RedisCacheAccessPolicyList.DeserializeRedisCacheAccessPolicyList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of access policies associated with this redis cache. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Redis cache. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cacheName, nameof(cacheName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, cacheName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RedisCacheAccessPolicyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RedisCacheAccessPolicyList.DeserializeRedisCacheAccessPolicyList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} 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 7f458e51384c..21709678fe77 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -58,7 +58,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// For checking the ongoing status of an operation. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The location at which operation was triggered. /// The ID of asynchronous operation. /// The cancellation token to use. @@ -86,7 +86,7 @@ public async Task> GetAsync(string subscriptionId } /// For checking the ongoing status of an operation. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The location at which operation was triggered. /// The ID of asynchronous operation. /// The cancellation token to use. 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 ba1fe934effb..72d91d11b13a 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets all firewall rules in the specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -88,8 +88,8 @@ public async Task> ListAsync(string subscr } /// Gets all firewall rules in the specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -143,8 +143,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a redis cache firewall rule. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// Parameters supplied to the create or update redis firewall rule operation. @@ -177,8 +177,8 @@ public async Task> CreateOrUpdateAsync(string su } /// Create or update a redis cache firewall rule. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// Parameters supplied to the create or update redis firewall rule operation. @@ -233,8 +233,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets a single firewall rule in a specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// The cancellation token to use. @@ -266,8 +266,8 @@ public async Task> GetAsync(string subscriptionI } /// Gets a single firewall rule in a specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// The cancellation token to use. @@ -321,8 +321,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a single firewall rule in a specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// The cancellation token to use. @@ -348,8 +348,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a single firewall rule in a specified redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the firewall rule. /// The cancellation token to use. @@ -390,8 +390,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets all firewall rules in the specified redis cache. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , , or is null. @@ -421,8 +421,8 @@ public async Task> ListNextPageAsync(strin /// Gets all firewall rules in the specified redis cache. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , , or is null. 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 655dc54a8093..3f915a5f6948 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -64,8 +64,8 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Adds a linked server to the Redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the linked server that is being added to the Redis cache. /// Parameters supplied to the Create Linked server operation. @@ -93,8 +93,8 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Adds a linked server to the Redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the linked server that is being added to the Redis cache. /// Parameters supplied to the Create Linked server operation. @@ -144,8 +144,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the linked server from a redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The name of the linked server that is being added to the Redis cache. /// The cancellation token to use. @@ -171,8 +171,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the linked server from a redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The name of the linked server that is being added to the Redis cache. /// The cancellation token to use. @@ -220,8 +220,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The name of the linked server. /// The cancellation token to use. @@ -253,8 +253,8 @@ public async Task> GetAsync(string s } /// Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The name of the linked server. /// The cancellation token to use. @@ -307,8 +307,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets the list of linked servers associated with this redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The cancellation token to use. /// , or is null. @@ -336,8 +336,8 @@ public async Task> ListAsync(strin } /// Gets the list of linked servers associated with this redis cache (requires Premium SKU). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The cancellation token to use. /// , or is null. @@ -380,8 +380,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets the list of linked servers associated with this redis cache (requires Premium SKU). /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The cancellation token to use. /// , , or is null. @@ -411,8 +411,8 @@ public async Task> ListNextPageAsy /// Gets the list of linked servers associated with this redis cache (requires Premium SKU). /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// The cancellation token to use. /// , , or is null. 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 bac507b0547b..1dbeed2f22dc 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,8 @@ internal HttpMessage CreateListByRedisResourceRequest(string subscriptionId, str } /// Gets all patch schedules in the specified redis cache (there is only one). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -88,8 +88,8 @@ public async Task> ListByRedisResourceAsy } /// Gets all patch schedules in the specified redis cache (there is only one). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -143,8 +143,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or replace the patching schedule for Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// Parameters to set the patching schedule for Redis cache. @@ -176,8 +176,8 @@ public async Task> CreateOrUpdateAsync(string s } /// Create or replace the patching schedule for Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// Parameters to set the patching schedule for Redis cache. @@ -231,8 +231,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the patching schedule of a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. @@ -257,8 +257,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the patching schedule of a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. @@ -305,8 +305,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the patching schedule of a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. @@ -337,8 +337,8 @@ public async Task> GetAsync(string subscription } /// Gets the patching schedule of a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the redis cache. /// Default string modeled as parameter for auto generation to work correctly. /// The cancellation token to use. @@ -384,8 +384,8 @@ internal HttpMessage CreateListByRedisResourceNextPageRequest(string nextLink, s /// Gets all patch schedules in the specified redis cache (there is only one). /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , , or is null. @@ -415,8 +415,8 @@ public async Task> ListByRedisResourceNex /// Gets all patch schedules in the specified redis cache (there is only one). /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , , or is null. 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 c8cfee2cbede..fc8640af87d2 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all the private endpoint connections associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -88,8 +88,8 @@ public async Task> ListAsync( } /// List all the private endpoint connections associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -139,8 +139,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. @@ -172,8 +172,8 @@ public async Task> GetAsync(string } /// Gets the specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. @@ -231,8 +231,8 @@ internal HttpMessage CreatePutRequest(string subscriptionId, string resourceGrou } /// Update the state of specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The private endpoint connection properties. @@ -260,8 +260,8 @@ public async Task PutAsync(string subscriptionId, string resourceGroup } /// Update the state of specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The private endpoint connection properties. @@ -311,8 +311,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. @@ -338,8 +338,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified private endpoint connection associated with the redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. 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 d1dfa9df1355..d8be7aa4c51b 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,8 @@ internal HttpMessage CreateListByRedisCacheRequest(string subscriptionId, string } /// Gets the private link resources that need to be created for a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -88,8 +88,8 @@ public async Task> ListByRedisCache } /// Gets the private link resources that need to be created for a redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. 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 783a28cf6bb6..7e75cf97374a 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 ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2023-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,7 +59,7 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, R } /// Checks that the redis cache name is valid and is not already in use. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. /// The cancellation token to use. /// or is null. @@ -81,7 +81,7 @@ public async Task CheckNameAvailabilityAsync(string subscriptionId, Re } /// Checks that the redis cache name is valid and is not already in use. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// Parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type is 'Microsoft.Cache/redis'. /// The cancellation token to use. /// or is null. @@ -125,8 +125,8 @@ internal HttpMessage CreateListUpgradeNotificationsRequest(string subscriptionId } /// Gets any upgrade notifications for a Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// how many minutes in past to look for upgrade notifications. /// The cancellation token to use. @@ -155,8 +155,8 @@ public async Task> ListUpgradeNot } /// Gets any upgrade notifications for a Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// how many minutes in past to look for upgrade notifications. /// The cancellation token to use. @@ -209,8 +209,8 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters supplied to the Create Redis operation. /// The cancellation token to use. @@ -236,8 +236,8 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters supplied to the Create Redis operation. /// The cancellation token to use. @@ -287,8 +287,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update an existing Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters supplied to the Update Redis operation. /// The cancellation token to use. @@ -314,8 +314,8 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Update an existing Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters supplied to the Update Redis operation. /// The cancellation token to use. @@ -361,8 +361,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -387,8 +387,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -433,8 +433,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets a Redis cache (resource description). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -464,8 +464,8 @@ public async Task> GetAsync(string subscriptionId, string re } /// Gets a Redis cache (resource description). - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -514,8 +514,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Lists all Redis caches in a resource group. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -541,8 +541,8 @@ public async Task> ListByResourceGroupAsync(string sub } /// Lists all Redis caches in a resource group. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -585,7 +585,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Gets all Redis caches in the specified subscription. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -610,7 +610,7 @@ public async Task> ListBySubscriptionAsync(string subs } /// Gets all Redis caches in the specified subscription. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -656,8 +656,8 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -685,8 +685,8 @@ public async Task> ListKeysAsync(string subscriptionId } /// Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// The cancellation token to use. /// , or is null. @@ -739,8 +739,8 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re } /// Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Specifies which key to regenerate. /// The cancellation token to use. @@ -770,8 +770,8 @@ public async Task> RegenerateKeyAsync(string subscript } /// Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Specifies which key to regenerate. /// The cancellation token to use. @@ -826,8 +826,8 @@ internal HttpMessage CreateForceRebootRequest(string subscriptionId, string reso } /// Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Specifies which Redis node(s) to reboot. /// The cancellation token to use. @@ -857,8 +857,8 @@ public async Task> ForceRebootAsync(string subs } /// Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Specifies which Redis node(s) to reboot. /// The cancellation token to use. @@ -913,8 +913,8 @@ internal HttpMessage CreateImportDataRequest(string subscriptionId, string resou } /// Import data into Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters for Redis import operation. /// The cancellation token to use. @@ -941,8 +941,8 @@ public async Task ImportDataAsync(string subscriptionId, string resour } /// Import data into Redis cache. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters for Redis import operation. /// The cancellation token to use. @@ -994,8 +994,8 @@ internal HttpMessage CreateExportDataRequest(string subscriptionId, string resou } /// Export data from the redis cache to blobs in a container. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters for Redis export operation. /// The cancellation token to use. @@ -1022,8 +1022,8 @@ public async Task ExportDataAsync(string subscriptionId, string resour } /// Export data from the redis cache to blobs in a container. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// Parameters for Redis export operation. /// The cancellation token to use. @@ -1065,8 +1065,8 @@ internal HttpMessage CreateListUpgradeNotificationsNextPageRequest(string nextLi /// Gets any upgrade notifications for a Redis cache. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// how many minutes in past to look for upgrade notifications. /// The cancellation token to use. @@ -1097,8 +1097,8 @@ public async Task> ListUpgradeNot /// Gets any upgrade notifications for a Redis cache. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Redis cache. /// how many minutes in past to look for upgrade notifications. /// The cancellation token to use. @@ -1143,8 +1143,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Lists all Redis caches in a resource group. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -1172,8 +1172,8 @@ public async Task> ListByResourceGroupNextPageAsync(st /// Lists all Redis caches in a resource group. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -1215,7 +1215,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Gets all Redis caches in the specified subscription. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1242,7 +1242,7 @@ public async Task> ListBySubscriptionNextPageAsync(str /// Gets all Redis caches in the specified subscription. /// The URL to the next page of results. - /// Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md index 4b14772a1086..24e23f630f6c 100644 --- a/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md +++ b/sdk/redis/Azure.ResourceManager.Redis/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: Redis namespace: Azure.ResourceManager.Redis -require: https://github.com/Azure/azure-rest-api-specs/blob/68847d6ae901f0cb2efa62ae2c523ad8cf5c2ea3/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