diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/IUserAssignedIdentitiesOperations.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/IUserAssignedIdentitiesOperations.cs index 753172de93a5..8198a9d67261 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/IUserAssignedIdentitiesOperations.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/IUserAssignedIdentitiesOperations.cs @@ -67,6 +67,50 @@ public partial interface IUserAssignedIdentitiesOperations /// Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Lists the associated resources for this identity. + /// + /// + /// The name of the Resource Group to which the identity belongs. + /// + /// + /// The name of the identity resource. + /// + /// + /// OData filter expression to apply to the query. + /// + /// + /// OData orderBy expression to apply to the query. + /// + /// + /// Number of records to return. + /// + /// + /// Number of records to skip. + /// + /// + /// A skip token is used to continue retrieving items after an + /// operation returns a partial result. If a previous response contains + /// a nextLink element, the value of the nextLink element will include + /// a skipToken parameter that specifies a starting point to use for + /// subsequent calls. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string resourceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Create or update an identity in the specified subscription and /// resource group. /// @@ -217,5 +261,27 @@ public partial interface IUserAssignedIdentitiesOperations /// Thrown when a required parameter is null /// Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the associated resources for this identity. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/ManagedServiceIdentityClient.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/ManagedServiceIdentityClient.cs index 7c63088cc2f2..e6b7c58f9e87 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/ManagedServiceIdentityClient.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/ManagedServiceIdentityClient.cs @@ -334,7 +334,7 @@ private void Initialize() Operations = new Operations(this); UserAssignedIdentities = new UserAssignedIdentitiesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-11-30"; + ApiVersion = "2021-09-30-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureEntityResource.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureEntityResource.cs index e79f1d4038c5..724c5e654124 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureEntityResource.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureEntityResource.cs @@ -14,9 +14,12 @@ namespace Microsoft.Azure.Management.ManagedServiceIdentity.Models using System.Linq; /// - /// The resource model definition for a Azure Resource Manager resource - /// with an etag. + /// Entity Resource /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// public partial class AzureEntityResource : Resource { /// @@ -30,12 +33,12 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource Etag. public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) : base(id, name, type) diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureResource.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureResource.cs new file mode 100644 index 000000000000..6e90707c9cde --- /dev/null +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/AzureResource.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ManagedServiceIdentity.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure Resource properties. + /// + /// + /// Describes an Azure resource that is attached to an identity. + /// + public partial class AzureResource + { + /// + /// Initializes a new instance of the AzureResource class. + /// + public AzureResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureResource class. + /// + /// The ID of this resource. + /// The name of this resource. + /// The type of this resource. + /// The name of the resource group this + /// resource belongs to. + /// The ID of the subscription this + /// resource belongs to. + /// The name of the subscription + /// this resource belongs to. + public AzureResource(string id = default(string), string name = default(string), string type = default(string), string resourceGroup = default(string), string subscriptionId = default(string), string subscriptionDisplayName = default(string)) + { + Id = id; + Name = name; + Type = type; + ResourceGroup = resourceGroup; + SubscriptionId = subscriptionId; + SubscriptionDisplayName = subscriptionDisplayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the ID of this resource. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of this resource. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of this resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the name of the resource group this resource belongs to. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets the ID of the subscription this resource belongs to. + /// + [JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets the name of the subscription this resource belongs to. + /// + [JsonProperty(PropertyName = "subscriptionDisplayName")] + public string SubscriptionDisplayName { get; private set; } + + } +} diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Identity.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Identity.cs index 54300a22d15d..65dbccaef62d 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Identity.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Identity.cs @@ -36,12 +36,12 @@ public Identity() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The id of the tenant which the identity /// belongs to. diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/IdentityUpdate.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/IdentityUpdate.cs index 72d121a70532..963cdce76468 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/IdentityUpdate.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/IdentityUpdate.cs @@ -34,12 +34,12 @@ public IdentityUpdate() /// /// Initializes a new instance of the IdentityUpdate class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The geo-location where the resource /// lives /// Resource tags diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/ProxyResource.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/ProxyResource.cs index 7cf9fb57db92..6efb05fe8243 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/ProxyResource.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/ProxyResource.cs @@ -13,9 +13,12 @@ namespace Microsoft.Azure.Management.ManagedServiceIdentity.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource. It will have - /// everything other than required location and tags + /// Proxy Resource /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// public partial class ProxyResource : Resource { /// @@ -29,12 +32,12 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Resource.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Resource.cs index 754e6c1534f8..9ddef18053bc 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Resource.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/Resource.cs @@ -15,6 +15,13 @@ namespace Microsoft.Azure.Management.ManagedServiceIdentity.Models using Newtonsoft.Json; using System.Linq; + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -28,12 +35,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; @@ -48,7 +55,7 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource Id for the resource. Ex - + /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] @@ -61,9 +68,9 @@ public Resource() public string Name { get; private set; } /// - /// Gets the type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/SystemAssignedIdentity.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/SystemAssignedIdentity.cs index 35159a460061..3eee0967fceb 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/SystemAssignedIdentity.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/SystemAssignedIdentity.cs @@ -36,12 +36,12 @@ public SystemAssignedIdentity() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags /// The id of the tenant which the identity /// belongs to. diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/TrackedResource.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/TrackedResource.cs index 0c6dda5ee004..b0ce032238c4 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/TrackedResource.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/Models/TrackedResource.cs @@ -17,8 +17,12 @@ namespace Microsoft.Azure.Management.ManagedServiceIdentity.Models using System.Linq; /// - /// The resource model definition for a ARM tracked top level resource + /// Tracked Resource /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// public partial class TrackedResource : Resource { /// @@ -34,12 +38,12 @@ public TrackedResource() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource - /// The type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/SdkInfo_ManagedServiceIdentityClient.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/SdkInfo_ManagedServiceIdentityClient.cs index 69c19dc74b56..3312c09b3c49 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/SdkInfo_ManagedServiceIdentityClient.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/SdkInfo_ManagedServiceIdentityClient.cs @@ -19,22 +19,11 @@ public static IEnumerable> ApiInfo_ManagedServiceI { return new Tuple[] { - new Tuple("ManagedIdentity", "Operations", "2018-11-30"), - new Tuple("ManagedIdentity", "SystemAssignedIdentities", "2018-11-30"), - new Tuple("ManagedIdentity", "UserAssignedIdentities", "2018-11-30"), + new Tuple("ManagedIdentity", "Operations", "2021-09-30-preview"), + new Tuple("ManagedIdentity", "SystemAssignedIdentities", "2021-09-30-preview"), + new Tuple("ManagedIdentity", "UserAssignedIdentities", "2021-09-30-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "2.0.4283"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/msi/resource-manager/readme.md --csharp --version=2.0.4283 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\angos\\Documents\\GitHub\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5b0ede713ff5c9ca3343afd544dc34fc5b45c716"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperations.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperations.cs index 48a2b9722c4c..44d20d273fbc 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperations.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperations.cs @@ -417,6 +417,253 @@ internal UserAssignedIdentitiesOperations(ManagedServiceIdentityClient client) return _result; } + /// + /// Lists the associated resources for this identity. + /// + /// + /// The name of the Resource Group to which the identity belongs. + /// + /// + /// The name of the identity resource. + /// + /// + /// OData filter expression to apply to the query. + /// + /// + /// OData orderBy expression to apply to the query. + /// + /// + /// Number of records to return. + /// + /// + /// Number of records to skip. + /// + /// + /// A skip token is used to continue retrieving items after an operation + /// returns a partial result. If a previous response contains a nextLink + /// element, the value of the nextLink element will include a skipToken + /// parameter that specifies a starting point to use for subsequent calls. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAssociatedResourcesWithHttpMessagesAsync(string resourceGroupName, string resourceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + if (skip < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 1); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); + tracingParameters.Add("top", top); + tracingParameters.Add("skip", skip); + tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResources", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}/listAssociatedResources").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skip != null) + { + _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Create or update an identity in the specified subscription and resource /// group. @@ -1579,5 +1826,178 @@ internal UserAssignedIdentitiesOperations(ManagedServiceIdentityClient client) return _result; } + /// + /// Lists the associated resources for this identity. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAssociatedResourcesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAssociatedResourcesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperationsExtensions.cs b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperationsExtensions.cs index d60498c616a1..90779f5c336a 100644 --- a/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperationsExtensions.cs +++ b/sdk/managedserviceidentity/Microsoft.Azure.Management.ManagedServiceIdentity/src/Generated/UserAssignedIdentitiesOperationsExtensions.cs @@ -87,6 +87,82 @@ public static IPage ListByResourceGroup(this IUserAssignedIdentitiesOp } } + /// + /// Lists the associated resources for this identity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Resource Group to which the identity belongs. + /// + /// + /// The name of the identity resource. + /// + /// + /// OData filter expression to apply to the query. + /// + /// + /// OData orderBy expression to apply to the query. + /// + /// + /// Number of records to return. + /// + /// + /// Number of records to skip. + /// + /// + /// A skip token is used to continue retrieving items after an operation + /// returns a partial result. If a previous response contains a nextLink + /// element, the value of the nextLink element will include a skipToken + /// parameter that specifies a starting point to use for subsequent calls. + /// + public static IPage ListAssociatedResources(this IUserAssignedIdentitiesOperations operations, string resourceGroupName, string resourceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), string skiptoken = default(string)) + { + return operations.ListAssociatedResourcesAsync(resourceGroupName, resourceName, filter, orderby, top, skip, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists the associated resources for this identity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Resource Group to which the identity belongs. + /// + /// + /// The name of the identity resource. + /// + /// + /// OData filter expression to apply to the query. + /// + /// + /// OData orderBy expression to apply to the query. + /// + /// + /// Number of records to return. + /// + /// + /// Number of records to skip. + /// + /// + /// A skip token is used to continue retrieving items after an operation + /// returns a partial result. If a previous response contains a nextLink + /// element, the value of the nextLink element will include a skipToken + /// parameter that specifies a starting point to use for subsequent calls. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAssociatedResourcesAsync(this IUserAssignedIdentitiesOperations operations, string resourceGroupName, string resourceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAssociatedResourcesWithHttpMessagesAsync(resourceGroupName, resourceName, filter, orderby, top, skip, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Create or update an identity in the specified subscription and resource /// group. @@ -330,5 +406,39 @@ public static IPage ListByResourceGroupNext(this IUserAssignedIdentiti } } + /// + /// Lists the associated resources for this identity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAssociatedResourcesNext(this IUserAssignedIdentitiesOperations operations, string nextPageLink) + { + return operations.ListAssociatedResourcesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the associated resources for this identity. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAssociatedResourcesNextAsync(this IUserAssignedIdentitiesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAssociatedResourcesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } }