From 065aa5f4ca013cbaa40dbd313a4ab8a8c29b109f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Mar 2022 11:04:20 +0000 Subject: [PATCH] CodeGen from PR 18255 in Azure/azure-rest-api-specs Merge 947333e51a47a11269064ddd0cb1eafa057a621f into 6354ca8bf06ea064f4f0fef331a10c1baf62ac35 --- .../src/Generated/IManagedServicesClient.cs | 17 +- ...tplaceRegistrationDefinitionsOperations.cs | 105 +++ ...rationDefinitionsWithoutScopeOperations.cs | 99 +++ .../src/Generated/IOperationsWithScope.cs | 49 ++ .../IRegistrationAssignmentsOperations.cs | 37 +- .../IRegistrationDefinitionsOperations.cs | 27 +- .../src/Generated/ManagedServicesClient.cs | 22 +- ...tplaceRegistrationDefinitionsOperations.cs | 598 ++++++++++++++++++ ...strationDefinitionsOperationsExtensions.cs | 149 +++++ ...rationDefinitionsWithoutScopeOperations.cs | 580 +++++++++++++++++ ...nitionsWithoutScopeOperationsExtensions.cs | 137 ++++ .../src/Generated/Models/Authorization.cs | 60 +- .../src/Generated/Models/CreatedByType.cs | 24 + .../src/Generated/Models/EligibleApprover.cs | 79 +++ .../Generated/Models/EligibleAuthorization.cs | 109 ++++ ...rorResponseError.cs => ErrorDefinition.cs} | 44 +- .../src/Generated/Models/ErrorResponse.cs | 12 +- .../Models/JustInTimeAccessPolicy.cs | 101 +++ .../MarketplaceRegistrationDefinition.cs | 110 ++++ ...etplaceRegistrationDefinitionProperties.cs | 148 +++++ .../Models/MultiFactorAuthProvider.cs | 22 + .../src/Generated/Models/Operation.cs | 7 +- .../src/Generated/Models/OperationDisplay.cs | 22 +- .../src/Generated/Models/OperationList.cs | 6 +- .../src/Generated/Models/Plan.cs | 18 +- .../Models/RegistrationAssignment.cs | 27 +- .../RegistrationAssignmentProperties.cs | 33 +- ...ignmentPropertiesRegistrationDefinition.cs | 40 +- ...pertiesRegistrationDefinitionProperties.cs | 78 ++- .../Models/RegistrationDefinition.cs | 37 +- .../RegistrationDefinitionProperties.cs | 95 ++- .../src/Generated/Models/SystemData.cs | 103 +++ .../src/Generated/OperationsWithScope.cs | 231 +++++++ .../OperationsWithScopeExtensions.cs | 59 ++ .../RegistrationAssignmentsOperations.cs | 42 +- ...strationAssignmentsOperationsExtensions.cs | 78 +-- .../RegistrationDefinitionsOperations.cs | 32 +- ...strationDefinitionsOperationsExtensions.cs | 58 +- .../SdkInfo_ManagedServicesClient.cs | 9 +- 39 files changed, 3210 insertions(+), 294 deletions(-) create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsOperations.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsWithoutScopeOperations.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IOperationsWithScope.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperations.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperationsExtensions.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperations.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperationsExtensions.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/CreatedByType.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleApprover.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleAuthorization.cs rename sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/{ErrorResponseError.cs => ErrorDefinition.cs} (56%) create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/JustInTimeAccessPolicy.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinition.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinitionProperties.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MultiFactorAuthProvider.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/SystemData.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScope.cs create mode 100644 sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScopeExtensions.cs diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IManagedServicesClient.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IManagedServicesClient.cs index 380ada5ccf25c..d8b326130c8ec 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IManagedServicesClient.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IManagedServicesClient.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ManagedServices using Newtonsoft.Json; /// - /// Specification for ManagedServices. + /// The specification for ManagedServices. /// public partial interface IManagedServicesClient : System.IDisposable { @@ -74,10 +74,25 @@ public partial interface IManagedServicesClient : System.IDisposable /// IRegistrationAssignmentsOperations RegistrationAssignments { get; } + /// + /// Gets the IMarketplaceRegistrationDefinitionsOperations. + /// + IMarketplaceRegistrationDefinitionsOperations MarketplaceRegistrationDefinitions { get; } + + /// + /// Gets the IMarketplaceRegistrationDefinitionsWithoutScopeOperations. + /// + IMarketplaceRegistrationDefinitionsWithoutScopeOperations MarketplaceRegistrationDefinitionsWithoutScope { get; } + /// /// Gets the IOperations. /// IOperations Operations { get; } + /// + /// Gets the IOperationsWithScope. + /// + IOperationsWithScope OperationsWithScope { get; } + } } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsOperations.cs new file mode 100644 index 0000000000000..d0b67006f107b --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsOperations.cs @@ -0,0 +1,105 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MarketplaceRegistrationDefinitionsOperations operations. + /// + public partial interface IMarketplaceRegistrationDefinitionsOperations + { + /// + /// Gets a list of the marketplace registration definitions for the + /// marketplace identifier. + /// + /// + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string scope, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the marketplace registration definition for the marketplace + /// identifier. + /// + /// + /// The scope of the resource. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string scope, string marketplaceIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of the marketplace registration definitions for the + /// marketplace identifier. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsWithoutScopeOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsWithoutScopeOperations.cs new file mode 100644 index 0000000000000..4d6cfe320869e --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IMarketplaceRegistrationDefinitionsWithoutScopeOperations.cs @@ -0,0 +1,99 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MarketplaceRegistrationDefinitionsWithoutScopeOperations operations. + /// + public partial interface IMarketplaceRegistrationDefinitionsWithoutScopeOperations + { + /// + /// Gets a list of the marketplace registration definitions for the + /// marketplace identifier. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the marketplace registration definition for the marketplace + /// identifier. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string marketplaceIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of the marketplace registration definitions for the + /// marketplace identifier. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IOperationsWithScope.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IOperationsWithScope.cs new file mode 100644 index 0000000000000..5e4e1edeba0e6 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IOperationsWithScope.cs @@ -0,0 +1,49 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationsWithScope operations. + /// + public partial interface IOperationsWithScope + { + /// + /// Gets a list of the operations with the scope. + /// + /// + /// The scope of the resource. + /// + /// + /// 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> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationAssignmentsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationAssignmentsOperations.cs index d66d95e022c81..02a70349b588f 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationAssignmentsOperations.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationAssignmentsOperations.cs @@ -24,17 +24,17 @@ namespace Microsoft.Azure.Management.ManagedServices public partial interface IRegistrationAssignmentsOperations { /// - /// Gets the details of specified registration assignment. + /// Gets the details of the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// - /// Tells whether to return registration definition details also along - /// with registration assignment details. + /// The flag indicating whether to return the registration definition + /// details along with the registration assignment details. /// /// /// The headers that will be added to request. @@ -56,10 +56,10 @@ public partial interface IRegistrationAssignmentsOperations /// Deletes the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The headers that will be added to request. @@ -78,10 +78,10 @@ public partial interface IRegistrationAssignmentsOperations /// Creates or updates a registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. @@ -106,11 +106,14 @@ public partial interface IRegistrationAssignmentsOperations /// Gets a list of the registration assignments. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Tells whether to return registration definition details also along - /// with registration assignment details. + /// The flag indicating whether to return the registration definition + /// details along with the registration assignment details. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// The headers that will be added to request. @@ -127,15 +130,15 @@ public partial interface IRegistrationAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string scope, bool? expandRegistrationDefinition = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string scope, bool? expandRegistrationDefinition = default(bool?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The headers that will be added to request. @@ -154,10 +157,10 @@ public partial interface IRegistrationAssignmentsOperations /// Creates or updates a registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationDefinitionsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationDefinitionsOperations.cs index 0de04d987e3ba..84a1bd2812b65 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationDefinitionsOperations.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/IRegistrationDefinitionsOperations.cs @@ -27,10 +27,10 @@ public partial interface IRegistrationDefinitionsOperations /// Gets the registration definition details. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// /// The headers that will be added to request. @@ -52,10 +52,10 @@ public partial interface IRegistrationDefinitionsOperations /// Deletes the registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// /// The headers that will be added to request. @@ -74,13 +74,13 @@ public partial interface IRegistrationDefinitionsOperations /// Creates or updates a registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// The headers that will be added to request. @@ -102,7 +102,10 @@ public partial interface IRegistrationDefinitionsOperations /// Gets a list of the registration definitions. /// /// - /// Scope of the resource. + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// The headers that will be added to request. @@ -119,18 +122,18 @@ public partial interface IRegistrationDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string scope, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates a registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// The headers that will be added to request. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/ManagedServicesClient.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/ManagedServicesClient.cs index 445c497cfb758..ab9796e4bdad5 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/ManagedServicesClient.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/ManagedServicesClient.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.ManagedServices using System.Net.Http; /// - /// Specification for ManagedServices. + /// The specification for ManagedServices. /// public partial class ManagedServicesClient : ServiceClient, IManagedServicesClient, IAzureClient { @@ -79,11 +79,26 @@ public partial class ManagedServicesClient : ServiceClient public virtual IRegistrationAssignmentsOperations RegistrationAssignments { get; private set; } + /// + /// Gets the IMarketplaceRegistrationDefinitionsOperations. + /// + public virtual IMarketplaceRegistrationDefinitionsOperations MarketplaceRegistrationDefinitions { get; private set; } + + /// + /// Gets the IMarketplaceRegistrationDefinitionsWithoutScopeOperations. + /// + public virtual IMarketplaceRegistrationDefinitionsWithoutScopeOperations MarketplaceRegistrationDefinitionsWithoutScope { get; private set; } + /// /// Gets the IOperations. /// public virtual IOperations Operations { get; private set; } + /// + /// Gets the IOperationsWithScope. + /// + public virtual IOperationsWithScope OperationsWithScope { get; private set; } + /// /// Initializes a new instance of the ManagedServicesClient class. /// @@ -327,9 +342,12 @@ private void Initialize() { RegistrationDefinitions = new RegistrationDefinitionsOperations(this); RegistrationAssignments = new RegistrationAssignmentsOperations(this); + MarketplaceRegistrationDefinitions = new MarketplaceRegistrationDefinitionsOperations(this); + MarketplaceRegistrationDefinitionsWithoutScope = new MarketplaceRegistrationDefinitionsWithoutScopeOperations(this); Operations = new Operations(this); + OperationsWithScope = new OperationsWithScope(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-06-01"; + ApiVersion = "2022-01-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperations.cs new file mode 100644 index 0000000000000..37e9c5a75da90 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperations.cs @@ -0,0 +1,598 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MarketplaceRegistrationDefinitionsOperations operations. + /// + internal partial class MarketplaceRegistrationDefinitionsOperations : IServiceOperations, IMarketplaceRegistrationDefinitionsOperations + { + /// + /// Initializes a new instance of the MarketplaceRegistrationDefinitionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MarketplaceRegistrationDefinitionsOperations(ManagedServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ManagedServicesClient + /// + public ManagedServicesClient Client { get; private set; } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string scope, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + 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("scope", scope); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The scope of the resource. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string scope, string marketplaceIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + if (marketplaceIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "marketplaceIdentifier"); + } + 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("scope", scope); + tracingParameters.Add("marketplaceIdentifier", marketplaceIdentifier); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier}").ToString(); + _url = _url.Replace("{scope}", scope); + _url = _url.Replace("{marketplaceIdentifier}", System.Uri.EscapeDataString(marketplaceIdentifier)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperationsExtensions.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperationsExtensions.cs new file mode 100644 index 0000000000000..6562e2054005f --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsOperationsExtensions.cs @@ -0,0 +1,149 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MarketplaceRegistrationDefinitionsOperations. + /// + public static partial class MarketplaceRegistrationDefinitionsOperationsExtensions + { + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + public static IPage List(this IMarketplaceRegistrationDefinitionsOperations operations, string scope, string filter = default(string)) + { + return operations.ListAsync(scope, filter).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IMarketplaceRegistrationDefinitionsOperations operations, string scope, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(scope, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + public static MarketplaceRegistrationDefinition Get(this IMarketplaceRegistrationDefinitionsOperations operations, string scope, string marketplaceIdentifier) + { + return operations.GetAsync(scope, marketplaceIdentifier).GetAwaiter().GetResult(); + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMarketplaceRegistrationDefinitionsOperations operations, string scope, string marketplaceIdentifier, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(scope, marketplaceIdentifier, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IMarketplaceRegistrationDefinitionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IMarketplaceRegistrationDefinitionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperations.cs new file mode 100644 index 0000000000000..d7f15e127c89b --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperations.cs @@ -0,0 +1,580 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// MarketplaceRegistrationDefinitionsWithoutScopeOperations operations. + /// + internal partial class MarketplaceRegistrationDefinitionsWithoutScopeOperations : IServiceOperations, IMarketplaceRegistrationDefinitionsWithoutScopeOperations + { + /// + /// Initializes a new instance of the MarketplaceRegistrationDefinitionsWithoutScopeOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MarketplaceRegistrationDefinitionsWithoutScopeOperations(ManagedServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ManagedServicesClient + /// + public ManagedServicesClient Client { get; private set; } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions").ToString(); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string marketplaceIdentifier, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (marketplaceIdentifier == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "marketplaceIdentifier"); + } + 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("marketplaceIdentifier", marketplaceIdentifier); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier}").ToString(); + _url = _url.Replace("{marketplaceIdentifier}", System.Uri.EscapeDataString(marketplaceIdentifier)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperationsExtensions.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperationsExtensions.cs new file mode 100644 index 0000000000000..3cc2b2c1a9318 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/MarketplaceRegistrationDefinitionsWithoutScopeOperationsExtensions.cs @@ -0,0 +1,137 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for MarketplaceRegistrationDefinitionsWithoutScopeOperations. + /// + public static partial class MarketplaceRegistrationDefinitionsWithoutScopeOperationsExtensions + { + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + public static IPage List(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string filter = default(string)) + { + return operations.ListAsync(filter).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The filter query parameter to filter managed services resources by. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + public static MarketplaceRegistrationDefinition Get(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string marketplaceIdentifier) + { + return operations.GetAsync(marketplaceIdentifier).GetAwaiter().GetResult(); + } + + /// + /// Get the marketplace registration definition for the marketplace identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Azure Marketplace identifier. Expected formats: + /// {publisher}.{product[-preview]}.{planName}.{version} or + /// {publisher}.{product[-preview]}.{planName} or + /// {publisher}.{product[-preview]} or {publisher}). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string marketplaceIdentifier, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(marketplaceIdentifier, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of the marketplace registration definitions for the marketplace + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IMarketplaceRegistrationDefinitionsWithoutScopeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Authorization.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Authorization.cs index 6a4a0996b8ae3..98eaeb01093e8 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Authorization.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Authorization.cs @@ -12,11 +12,14 @@ namespace Microsoft.Azure.Management.ManagedServices.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Authorization tuple containing principal Id (of user/service - /// principal/security group) and role definition id. + /// The Azure Active Directory principal identifier and Azure built-in role + /// that describes the access the principal will receive on the delegated + /// resource in the managed tenant. /// public partial class Authorization { @@ -31,17 +34,25 @@ public Authorization() /// /// Initializes a new instance of the Authorization class. /// - /// Principal Id of the security - /// group/service principal/user that would be assigned permissions to - /// the projected subscription - /// The role definition identifier. This - /// role will define all the permissions that the security - /// group/service principal/user must have on the projected - /// subscription. This role cannot be an owner role. - public Authorization(string principalId, string roleDefinitionId) + /// The identifier of the Azure Active + /// Directory principal. + /// The identifier of the Azure built-in + /// role that defines the permissions that the Azure Active Directory + /// principal will have on the projected scope. + /// The display name of the Azure + /// Active Directory principal. + /// The + /// delegatedRoleDefinitionIds field is required when the + /// roleDefinitionId refers to the User Access Administrator Role. It + /// is the list of role definition ids which define all the permissions + /// that the user in the authorization can assign to other + /// principals. + public Authorization(string principalId, string roleDefinitionId, string principalIdDisplayName = default(string), IList delegatedRoleDefinitionIds = default(IList)) { PrincipalId = principalId; + PrincipalIdDisplayName = principalIdDisplayName; RoleDefinitionId = roleDefinitionId; + DelegatedRoleDefinitionIds = delegatedRoleDefinitionIds; CustomInit(); } @@ -51,22 +62,37 @@ public Authorization(string principalId, string roleDefinitionId) partial void CustomInit(); /// - /// Gets or sets principal Id of the security group/service - /// principal/user that would be assigned permissions to the projected - /// subscription + /// Gets or sets the identifier of the Azure Active Directory + /// principal. /// [JsonProperty(PropertyName = "principalId")] public string PrincipalId { get; set; } /// - /// Gets or sets the role definition identifier. This role will define - /// all the permissions that the security group/service principal/user - /// must have on the projected subscription. This role cannot be an - /// owner role. + /// Gets or sets the display name of the Azure Active Directory + /// principal. + /// + [JsonProperty(PropertyName = "principalIdDisplayName")] + public string PrincipalIdDisplayName { get; set; } + + /// + /// Gets or sets the identifier of the Azure built-in role that defines + /// the permissions that the Azure Active Directory principal will have + /// on the projected scope. /// [JsonProperty(PropertyName = "roleDefinitionId")] public string RoleDefinitionId { get; set; } + /// + /// Gets or sets the delegatedRoleDefinitionIds field is required when + /// the roleDefinitionId refers to the User Access Administrator Role. + /// It is the list of role definition ids which define all the + /// permissions that the user in the authorization can assign to other + /// principals. + /// + [JsonProperty(PropertyName = "delegatedRoleDefinitionIds")] + public IList DelegatedRoleDefinitionIds { get; set; } + /// /// Validate the object. /// diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/CreatedByType.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..7a7a3e96f3876 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// 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.ManagedServices.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleApprover.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleApprover.cs new file mode 100644 index 0000000000000..8f85086826ed7 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleApprover.cs @@ -0,0 +1,79 @@ +// +// 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.ManagedServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the Azure Active Directory principal that can approve any + /// just-in-time access requests by the principal defined in the + /// EligibleAuthorization. + /// + public partial class EligibleApprover + { + /// + /// Initializes a new instance of the EligibleApprover class. + /// + public EligibleApprover() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EligibleApprover class. + /// + /// The identifier of the Azure Active + /// Directory principal. + /// The display name of the Azure + /// Active Directory principal. + public EligibleApprover(string principalId, string principalIdDisplayName = default(string)) + { + PrincipalId = principalId; + PrincipalIdDisplayName = principalIdDisplayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identifier of the Azure Active Directory + /// principal. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the display name of the Azure Active Directory + /// principal. + /// + [JsonProperty(PropertyName = "principalIdDisplayName")] + public string PrincipalIdDisplayName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrincipalId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrincipalId"); + } + } + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleAuthorization.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleAuthorization.cs new file mode 100644 index 0000000000000..fad0b87f215a9 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/EligibleAuthorization.cs @@ -0,0 +1,109 @@ +// +// 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.ManagedServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Azure Active Directory principal identifier, Azure built-in role, + /// and just-in-time access policy that describes the just-in-time access + /// the principal will receive on the delegated resource in the managed + /// tenant. + /// + public partial class EligibleAuthorization + { + /// + /// Initializes a new instance of the EligibleAuthorization class. + /// + public EligibleAuthorization() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EligibleAuthorization class. + /// + /// The identifier of the Azure Active + /// Directory principal. + /// The identifier of the Azure built-in + /// role that defines the permissions that the Azure Active Directory + /// principal will have on the projected scope. + /// The display name of the Azure + /// Active Directory principal. + /// The just-in-time access policy + /// setting. + public EligibleAuthorization(string principalId, string roleDefinitionId, string principalIdDisplayName = default(string), JustInTimeAccessPolicy justInTimeAccessPolicy = default(JustInTimeAccessPolicy)) + { + PrincipalId = principalId; + PrincipalIdDisplayName = principalIdDisplayName; + RoleDefinitionId = roleDefinitionId; + JustInTimeAccessPolicy = justInTimeAccessPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identifier of the Azure Active Directory + /// principal. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the display name of the Azure Active Directory + /// principal. + /// + [JsonProperty(PropertyName = "principalIdDisplayName")] + public string PrincipalIdDisplayName { get; set; } + + /// + /// Gets or sets the identifier of the Azure built-in role that defines + /// the permissions that the Azure Active Directory principal will have + /// on the projected scope. + /// + [JsonProperty(PropertyName = "roleDefinitionId")] + public string RoleDefinitionId { get; set; } + + /// + /// Gets or sets the just-in-time access policy setting. + /// + [JsonProperty(PropertyName = "justInTimeAccessPolicy")] + public JustInTimeAccessPolicy JustInTimeAccessPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrincipalId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrincipalId"); + } + if (RoleDefinitionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RoleDefinitionId"); + } + if (JustInTimeAccessPolicy != null) + { + JustInTimeAccessPolicy.Validate(); + } + } + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponseError.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorDefinition.cs similarity index 56% rename from sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponseError.cs rename to sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorDefinition.cs index 20d4f22452a57..7cdd5815c127e 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponseError.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorDefinition.cs @@ -12,32 +12,36 @@ namespace Microsoft.Azure.Management.ManagedServices.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Error response indicates Azure Resource Manager is not able to process - /// the incoming request. The reason is provided in the error message. + /// The error response indicating why the incoming request wasn’t able to + /// be processed /// - public partial class ErrorResponseError + public partial class ErrorDefinition { /// - /// Initializes a new instance of the ErrorResponseError class. + /// Initializes a new instance of the ErrorDefinition class. /// - public ErrorResponseError() + public ErrorDefinition() { CustomInit(); } /// - /// Initializes a new instance of the ErrorResponseError class. + /// Initializes a new instance of the ErrorDefinition class. /// - /// Error code. - /// Error message indicating why the operation - /// failed. - public ErrorResponseError(string code, string message) + /// The error code. + /// The error message indicating why the + /// operation failed. + /// The internal error details. + public ErrorDefinition(string code, string message, IList details = default(IList)) { Code = code; Message = message; + Details = details; CustomInit(); } @@ -47,17 +51,23 @@ public ErrorResponseError(string code, string message) partial void CustomInit(); /// - /// Gets or sets error code. + /// Gets or sets the error code. /// [JsonProperty(PropertyName = "code")] public string Code { get; set; } /// - /// Gets or sets error message indicating why the operation failed. + /// Gets or sets the error message indicating why the operation failed. /// [JsonProperty(PropertyName = "message")] public string Message { get; set; } + /// + /// Gets or sets the internal error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + /// /// Validate the object. /// @@ -74,6 +84,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Message"); } + if (Details != null) + { + foreach (var element in Details) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponse.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponse.cs index 4941a69f09d1a..5b2ed0613df8d 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponse.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/ErrorResponse.cs @@ -29,10 +29,8 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// Error response indicates Azure Resource Manager - /// is not able to process the incoming request. The reason is provided - /// in the error message. - public ErrorResponse(ErrorResponseError error = default(ErrorResponseError)) + /// The error details. + public ErrorResponse(ErrorDefinition error = default(ErrorDefinition)) { Error = error; CustomInit(); @@ -44,12 +42,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets error response indicates Azure Resource Manager is not able to - /// process the incoming request. The reason is provided in the error - /// message. + /// Gets or sets the error details. /// [JsonProperty(PropertyName = "error")] - public ErrorResponseError Error { get; private set; } + public ErrorDefinition Error { get; set; } /// /// Validate the object. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/JustInTimeAccessPolicy.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/JustInTimeAccessPolicy.cs new file mode 100644 index 0000000000000..00832d038b162 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/JustInTimeAccessPolicy.cs @@ -0,0 +1,101 @@ +// +// 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.ManagedServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Just-in-time access policy setting. + /// + public partial class JustInTimeAccessPolicy + { + /// + /// Initializes a new instance of the JustInTimeAccessPolicy class. + /// + public JustInTimeAccessPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JustInTimeAccessPolicy class. + /// + /// The multi-factor + /// authorization provider to be used for just-in-time access requests. + /// Possible values include: 'Azure', 'None' + /// The maximum access duration + /// in ISO 8601 format for just-in-time access requests. + /// The list of managedByTenant + /// approvers for the eligible authorization. + public JustInTimeAccessPolicy(string multiFactorAuthProvider, System.TimeSpan? maximumActivationDuration = default(System.TimeSpan?), IList managedByTenantApprovers = default(IList)) + { + MultiFactorAuthProvider = multiFactorAuthProvider; + MaximumActivationDuration = maximumActivationDuration; + ManagedByTenantApprovers = managedByTenantApprovers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the multi-factor authorization provider to be used for + /// just-in-time access requests. Possible values include: 'Azure', + /// 'None' + /// + [JsonProperty(PropertyName = "multiFactorAuthProvider")] + public string MultiFactorAuthProvider { get; set; } + + /// + /// Gets or sets the maximum access duration in ISO 8601 format for + /// just-in-time access requests. + /// + [JsonProperty(PropertyName = "maximumActivationDuration")] + public System.TimeSpan? MaximumActivationDuration { get; set; } + + /// + /// Gets or sets the list of managedByTenant approvers for the eligible + /// authorization. + /// + [JsonProperty(PropertyName = "managedByTenantApprovers")] + public IList ManagedByTenantApprovers { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MultiFactorAuthProvider == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MultiFactorAuthProvider"); + } + if (ManagedByTenantApprovers != null) + { + foreach (var element in ManagedByTenantApprovers) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinition.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinition.cs new file mode 100644 index 0000000000000..ccd44aa502227 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinition.cs @@ -0,0 +1,110 @@ +// +// 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.ManagedServices.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + public partial class MarketplaceRegistrationDefinition : IResource + { + /// + /// Initializes a new instance of the MarketplaceRegistrationDefinition + /// class. + /// + public MarketplaceRegistrationDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MarketplaceRegistrationDefinition + /// class. + /// + /// The properties of the marketplace + /// registration definition. + /// The details for the Managed Services offer’s + /// plan in Azure Marketplace. + /// The fully qualified path of the marketplace + /// registration definition. + /// The type of the Azure resource + /// (Microsoft.ManagedServices/marketplaceRegistrationDefinitions). + /// The name of the marketplace registration + /// definition. + public MarketplaceRegistrationDefinition(MarketplaceRegistrationDefinitionProperties properties = default(MarketplaceRegistrationDefinitionProperties), Plan plan = default(Plan), string id = default(string), string type = default(string), string name = default(string)) + { + Properties = properties; + Plan = plan; + Id = id; + Type = type; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the properties of the marketplace registration + /// definition. + /// + [JsonProperty(PropertyName = "properties")] + public MarketplaceRegistrationDefinitionProperties Properties { get; set; } + + /// + /// Gets or sets the details for the Managed Services offer’s plan in + /// Azure Marketplace. + /// + [JsonProperty(PropertyName = "plan")] + public Plan Plan { get; set; } + + /// + /// Gets the fully qualified path of the marketplace registration + /// definition. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the type of the Azure resource + /// (Microsoft.ManagedServices/marketplaceRegistrationDefinitions). + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the name of the marketplace registration definition. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties != null) + { + Properties.Validate(); + } + if (Plan != null) + { + Plan.Validate(); + } + } + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinitionProperties.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinitionProperties.cs new file mode 100644 index 0000000000000..dd1dc6f560493 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MarketplaceRegistrationDefinitionProperties.cs @@ -0,0 +1,148 @@ +// +// 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.ManagedServices.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of the marketplace registration definition. + /// + public partial class MarketplaceRegistrationDefinitionProperties + { + /// + /// Initializes a new instance of the + /// MarketplaceRegistrationDefinitionProperties class. + /// + public MarketplaceRegistrationDefinitionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MarketplaceRegistrationDefinitionProperties class. + /// + /// The identifier of the managedBy + /// tenant. + /// The collection of authorization + /// objects describing the access Azure Active Directory principals in + /// the managedBy tenant will receive on the delegated resource in the + /// managed tenant. + /// The collection of eligible + /// authorization objects describing the just-in-time access Azure + /// Active Directory principals in the managedBy tenant will receive on + /// the delegated resource in the managed tenant. + /// The marketplace offer display + /// name. + /// The marketplace publisher + /// display name. + /// The marketplace plan display + /// name. + public MarketplaceRegistrationDefinitionProperties(string managedByTenantId, IList authorizations, IList eligibleAuthorizations = default(IList), string offerDisplayName = default(string), string publisherDisplayName = default(string), string planDisplayName = default(string)) + { + ManagedByTenantId = managedByTenantId; + Authorizations = authorizations; + EligibleAuthorizations = eligibleAuthorizations; + OfferDisplayName = offerDisplayName; + PublisherDisplayName = publisherDisplayName; + PlanDisplayName = planDisplayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identifier of the managedBy tenant. + /// + [JsonProperty(PropertyName = "managedByTenantId")] + public string ManagedByTenantId { get; set; } + + /// + /// Gets or sets the collection of authorization objects describing the + /// access Azure Active Directory principals in the managedBy tenant + /// will receive on the delegated resource in the managed tenant. + /// + [JsonProperty(PropertyName = "authorizations")] + public IList Authorizations { get; set; } + + /// + /// Gets or sets the collection of eligible authorization objects + /// describing the just-in-time access Azure Active Directory + /// principals in the managedBy tenant will receive on the delegated + /// resource in the managed tenant. + /// + [JsonProperty(PropertyName = "eligibleAuthorizations")] + public IList EligibleAuthorizations { get; set; } + + /// + /// Gets or sets the marketplace offer display name. + /// + [JsonProperty(PropertyName = "offerDisplayName")] + public string OfferDisplayName { get; set; } + + /// + /// Gets or sets the marketplace publisher display name. + /// + [JsonProperty(PropertyName = "publisherDisplayName")] + public string PublisherDisplayName { get; set; } + + /// + /// Gets or sets the marketplace plan display name. + /// + [JsonProperty(PropertyName = "planDisplayName")] + public string PlanDisplayName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ManagedByTenantId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ManagedByTenantId"); + } + if (Authorizations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Authorizations"); + } + if (Authorizations != null) + { + foreach (var element in Authorizations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (EligibleAuthorizations != null) + { + foreach (var element1 in EligibleAuthorizations) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MultiFactorAuthProvider.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MultiFactorAuthProvider.cs new file mode 100644 index 0000000000000..91fa6af73fcc9 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/MultiFactorAuthProvider.cs @@ -0,0 +1,22 @@ +// +// 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.ManagedServices.Models +{ + + /// + /// Defines values for MultiFactorAuthProvider. + /// + public static class MultiFactorAuthProvider + { + public const string Azure = "Azure"; + public const string None = "None"; + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Operation.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Operation.cs index 1f62df997d5e1..a4e79f5389848 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Operation.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Operation.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Object that describes a single Microsoft.ManagedServices operation. + /// The object that describes a single Microsoft.ManagedServices operation. /// public partial class Operation { @@ -29,7 +29,7 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Operation name: + /// The operation name with the format: /// {provider}/{resource}/{operation} /// The object that represents the /// operation. @@ -46,7 +46,8 @@ public Operation() partial void CustomInit(); /// - /// Gets operation name: {provider}/{resource}/{operation} + /// Gets the operation name with the format: + /// {provider}/{resource}/{operation} /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationDisplay.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationDisplay.cs index da44aa4b456a1..c47b419bf022c 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationDisplay.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationDisplay.cs @@ -29,14 +29,11 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Service provider: - /// Microsoft.ManagedServices - /// Resource on which the operation is - /// performed: Registration definition, registration assignment - /// etc. - /// Operation type: Read, write, delete, - /// etc. - /// Description of the operation. + /// The service provider. + /// The resource on which the operation is + /// performed. + /// The operation type. + /// The description of the operation. public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) { Provider = provider; @@ -52,26 +49,25 @@ public OperationDisplay() partial void CustomInit(); /// - /// Gets or sets service provider: Microsoft.ManagedServices + /// Gets or sets the service provider. /// [JsonProperty(PropertyName = "provider")] public string Provider { get; set; } /// - /// Gets or sets resource on which the operation is performed: - /// Registration definition, registration assignment etc. + /// Gets or sets the resource on which the operation is performed. /// [JsonProperty(PropertyName = "resource")] public string Resource { get; set; } /// - /// Gets or sets operation type: Read, write, delete, etc. + /// Gets or sets the operation type. /// [JsonProperty(PropertyName = "operation")] public string Operation { get; set; } /// - /// Gets or sets description of the operation. + /// Gets or sets the description of the operation. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationList.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationList.cs index 673c674030741..d11055dd595d7 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationList.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/OperationList.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// List of the operations. + /// The list of the operations. /// public partial class OperationList { @@ -31,7 +31,7 @@ public OperationList() /// /// Initializes a new instance of the OperationList class. /// - /// List of Microsoft.ManagedServices + /// The list of Microsoft.ManagedServices /// operations. public OperationList(IList value = default(IList)) { @@ -45,7 +45,7 @@ public OperationList() partial void CustomInit(); /// - /// Gets list of Microsoft.ManagedServices operations. + /// Gets the list of Microsoft.ManagedServices operations. /// [JsonProperty(PropertyName = "value")] public IList Value { get; private set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Plan.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Plan.cs index 6aa7a53d9d76b..0d5c80279ca2e 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Plan.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/Plan.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Plan details for the managed services. + /// The details for the Managed Services offer’s plan in Azure Marketplace. /// public partial class Plan { @@ -30,10 +30,10 @@ public Plan() /// /// Initializes a new instance of the Plan class. /// - /// The plan name. - /// The publisher ID. - /// The product code. - /// The plan's version. + /// Azure Marketplace plan name. + /// Azure Marketplace publisher ID. + /// Azure Marketplace product code. + /// Azure Marketplace plan's version. public Plan(string name, string publisher, string product, string version) { Name = name; @@ -49,25 +49,25 @@ public Plan(string name, string publisher, string product, string version) partial void CustomInit(); /// - /// Gets or sets the plan name. + /// Gets or sets azure Marketplace plan name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets the publisher ID. + /// Gets or sets azure Marketplace publisher ID. /// [JsonProperty(PropertyName = "publisher")] public string Publisher { get; set; } /// - /// Gets or sets the product code. + /// Gets or sets azure Marketplace product code. /// [JsonProperty(PropertyName = "product")] public string Product { get; set; } /// - /// Gets or sets the plan's version. + /// Gets or sets azure Marketplace plan's version. /// [JsonProperty(PropertyName = "version")] public string Version { get; set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignment.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignment.cs index 15e2b97a7d09c..30c34f0480470 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignment.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignment.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Registration assignment. + /// The registration assignment. /// public partial class RegistrationAssignment : IResource { @@ -31,18 +31,22 @@ public RegistrationAssignment() /// /// Initializes a new instance of the RegistrationAssignment class. /// - /// Properties of a registration + /// The properties of a registration /// assignment. /// The fully qualified path of the registration /// assignment. - /// Type of the resource. - /// Name of the registration assignment. - public RegistrationAssignment(RegistrationAssignmentProperties properties = default(RegistrationAssignmentProperties), string id = default(string), string type = default(string), string name = default(string)) + /// The type of the Azure resource + /// (Microsoft.ManagedServices/registrationAssignments). + /// The name of the registration assignment. + /// The metadata for the registration + /// assignment resource. + public RegistrationAssignment(RegistrationAssignmentProperties properties = default(RegistrationAssignmentProperties), string id = default(string), string type = default(string), string name = default(string), SystemData systemData = default(SystemData)) { Properties = properties; Id = id; Type = type; Name = name; + SystemData = systemData; CustomInit(); } @@ -52,7 +56,7 @@ public RegistrationAssignment() partial void CustomInit(); /// - /// Gets or sets properties of a registration assignment. + /// Gets or sets the properties of a registration assignment. /// [JsonProperty(PropertyName = "properties")] public RegistrationAssignmentProperties Properties { get; set; } @@ -64,17 +68,24 @@ public RegistrationAssignment() public string Id { get; private set; } /// - /// Gets type of the resource. + /// Gets the type of the Azure resource + /// (Microsoft.ManagedServices/registrationAssignments). /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Gets name of the registration assignment. + /// Gets the name of the registration assignment. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets the metadata for the registration assignment resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentProperties.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentProperties.cs index d28de874becfd..bce1ef9a04346 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentProperties.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentProperties.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Properties of a registration assignment. + /// The properties of the registration assignment. /// public partial class RegistrationAssignmentProperties { @@ -32,14 +32,15 @@ public RegistrationAssignmentProperties() /// Initializes a new instance of the RegistrationAssignmentProperties /// class. /// - /// Fully qualified path of the - /// registration definition. - /// Current state of the registration - /// assignment. Possible values include: 'NotSpecified', 'Accepted', - /// 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', - /// 'Canceled', 'Failed', 'Succeeded', 'Updating' - /// Registration definition inside - /// registration assignment. + /// The fully qualified path of + /// the registration definition. + /// The current provisioning state of + /// the registration assignment. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Updating' + /// The registration definition + /// associated with the registration assignment. public RegistrationAssignmentProperties(string registrationDefinitionId, string provisioningState = default(string), RegistrationAssignmentPropertiesRegistrationDefinition registrationDefinition = default(RegistrationAssignmentPropertiesRegistrationDefinition)) { RegistrationDefinitionId = registrationDefinitionId; @@ -54,22 +55,24 @@ public RegistrationAssignmentProperties() partial void CustomInit(); /// - /// Gets or sets fully qualified path of the registration definition. + /// Gets or sets the fully qualified path of the registration + /// definition. /// [JsonProperty(PropertyName = "registrationDefinitionId")] public string RegistrationDefinitionId { get; set; } /// - /// Gets current state of the registration assignment. Possible values - /// include: 'NotSpecified', 'Accepted', 'Running', 'Ready', - /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - /// 'Succeeded', 'Updating' + /// Gets the current provisioning state of the registration assignment. + /// Possible values include: 'NotSpecified', 'Accepted', 'Running', + /// 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', + /// 'Failed', 'Succeeded', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } /// - /// Gets registration definition inside registration assignment. + /// Gets the registration definition associated with the registration + /// assignment. /// [JsonProperty(PropertyName = "registrationDefinition")] public RegistrationAssignmentPropertiesRegistrationDefinition RegistrationDefinition { get; private set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinition.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinition.cs index bc623b23b10b0..de6e86f87bbc0 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinition.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinition.cs @@ -14,7 +14,8 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Registration definition inside registration assignment. + /// The registration definition associated with the registration + /// assignment. /// public partial class RegistrationAssignmentPropertiesRegistrationDefinition { @@ -31,21 +32,25 @@ public RegistrationAssignmentPropertiesRegistrationDefinition() /// Initializes a new instance of the /// RegistrationAssignmentPropertiesRegistrationDefinition class. /// - /// Properties of registration definition - /// inside registration assignment. - /// Plan details for the managed services. - /// Fully qualified path of the registration + /// The properties of the registration + /// definition associated with the registration assignment. + /// The details for the Managed Services offer’s + /// plan in Azure Marketplace. + /// The fully qualified path of the registration /// definition. - /// Type of the resource + /// The type of the Azure resource /// (Microsoft.ManagedServices/registrationDefinitions). - /// Name of the registration definition. - public RegistrationAssignmentPropertiesRegistrationDefinition(RegistrationAssignmentPropertiesRegistrationDefinitionProperties properties = default(RegistrationAssignmentPropertiesRegistrationDefinitionProperties), Plan plan = default(Plan), string id = default(string), string type = default(string), string name = default(string)) + /// The name of the registration definition. + /// The metadata for the registration + /// definition resource. + public RegistrationAssignmentPropertiesRegistrationDefinition(RegistrationAssignmentPropertiesRegistrationDefinitionProperties properties = default(RegistrationAssignmentPropertiesRegistrationDefinitionProperties), Plan plan = default(Plan), string id = default(string), string type = default(string), string name = default(string), SystemData systemData = default(SystemData)) { Properties = properties; Plan = plan; Id = id; Type = type; Name = name; + SystemData = systemData; CustomInit(); } @@ -55,37 +60,44 @@ public RegistrationAssignmentPropertiesRegistrationDefinition() partial void CustomInit(); /// - /// Gets or sets properties of registration definition inside - /// registration assignment. + /// Gets or sets the properties of the registration definition + /// associated with the registration assignment. /// [JsonProperty(PropertyName = "properties")] public RegistrationAssignmentPropertiesRegistrationDefinitionProperties Properties { get; set; } /// - /// Gets or sets plan details for the managed services. + /// Gets or sets the details for the Managed Services offer’s plan in + /// Azure Marketplace. /// [JsonProperty(PropertyName = "plan")] public Plan Plan { get; set; } /// - /// Gets fully qualified path of the registration definition. + /// Gets the fully qualified path of the registration definition. /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets type of the resource + /// Gets the type of the Azure resource /// (Microsoft.ManagedServices/registrationDefinitions). /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Gets name of the registration definition. + /// Gets the name of the registration definition. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets the metadata for the registration definition resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs index 29aff9ba4c0c1..d77f5cbb8143e 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationAssignmentPropertiesRegistrationDefinitionProperties.cs @@ -16,7 +16,8 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Properties of registration definition inside registration assignment. + /// The properties of the registration definition associated with the + /// registration assignment. /// public partial class RegistrationAssignmentPropertiesRegistrationDefinitionProperties { @@ -35,26 +36,36 @@ public RegistrationAssignmentPropertiesRegistrationDefinitionProperties() /// RegistrationAssignmentPropertiesRegistrationDefinitionProperties /// class. /// - /// Description of the registration + /// The description of the registration /// definition. - /// Authorization tuple containing - /// principal id of the user/security group or service principal and id - /// of the build-in role. - /// Name of the registration - /// definition. - /// Current state of the registration - /// definition. Possible values include: 'NotSpecified', 'Accepted', - /// 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', - /// 'Canceled', 'Failed', 'Succeeded', 'Updating' - /// Id of the home tenant. - /// Name of the home tenant. - /// Id of the managedBy tenant. - /// Name of the managedBy + /// The collection of authorization + /// objects describing the access Azure Active Directory principals in + /// the managedBy tenant will receive on the delegated resource in the + /// managed tenant. + /// The collection of eligible + /// authorization objects describing the just-in-time access Azure + /// Active Directory principals in the managedBy tenant will receive on + /// the delegated resource in the managed tenant. + /// The name of the + /// registration definition. + /// The current provisioning state of + /// the registration definition. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Updating' + /// The identifier of the managed + /// tenant. + /// The name of the managed + /// tenant. + /// The identifier of the managedBy + /// tenant. + /// The name of the managedBy /// tenant. - public RegistrationAssignmentPropertiesRegistrationDefinitionProperties(string description = default(string), IList authorizations = default(IList), string registrationDefinitionName = default(string), string provisioningState = default(string), string manageeTenantId = default(string), string manageeTenantName = default(string), string managedByTenantId = default(string), string managedByTenantName = default(string)) + public RegistrationAssignmentPropertiesRegistrationDefinitionProperties(string description = default(string), IList authorizations = default(IList), IList eligibleAuthorizations = default(IList), string registrationDefinitionName = default(string), string provisioningState = default(string), string manageeTenantId = default(string), string manageeTenantName = default(string), string managedByTenantId = default(string), string managedByTenantName = default(string)) { Description = description; Authorizations = authorizations; + EligibleAuthorizations = eligibleAuthorizations; RegistrationDefinitionName = registrationDefinitionName; ProvisioningState = provisioningState; ManageeTenantId = manageeTenantId; @@ -70,54 +81,63 @@ public RegistrationAssignmentPropertiesRegistrationDefinitionProperties() partial void CustomInit(); /// - /// Gets or sets description of the registration definition. + /// Gets or sets the description of the registration definition. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// - /// Gets or sets authorization tuple containing principal id of the - /// user/security group or service principal and id of the build-in - /// role. + /// Gets or sets the collection of authorization objects describing the + /// access Azure Active Directory principals in the managedBy tenant + /// will receive on the delegated resource in the managed tenant. /// [JsonProperty(PropertyName = "authorizations")] public IList Authorizations { get; set; } /// - /// Gets or sets name of the registration definition. + /// Gets or sets the collection of eligible authorization objects + /// describing the just-in-time access Azure Active Directory + /// principals in the managedBy tenant will receive on the delegated + /// resource in the managed tenant. + /// + [JsonProperty(PropertyName = "eligibleAuthorizations")] + public IList EligibleAuthorizations { get; set; } + + /// + /// Gets or sets the name of the registration definition. /// [JsonProperty(PropertyName = "registrationDefinitionName")] public string RegistrationDefinitionName { get; set; } /// - /// Gets or sets current state of the registration definition. Possible - /// values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', - /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - /// 'Succeeded', 'Updating' + /// Gets or sets the current provisioning state of the registration + /// definition. Possible values include: 'NotSpecified', 'Accepted', + /// 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', + /// 'Canceled', 'Failed', 'Succeeded', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; set; } /// - /// Gets or sets id of the home tenant. + /// Gets or sets the identifier of the managed tenant. /// [JsonProperty(PropertyName = "manageeTenantId")] public string ManageeTenantId { get; set; } /// - /// Gets or sets name of the home tenant. + /// Gets or sets the name of the managed tenant. /// [JsonProperty(PropertyName = "manageeTenantName")] public string ManageeTenantName { get; set; } /// - /// Gets or sets id of the managedBy tenant. + /// Gets or sets the identifier of the managedBy tenant. /// [JsonProperty(PropertyName = "managedByTenantId")] public string ManagedByTenantId { get; set; } /// - /// Gets or sets name of the managedBy tenant. + /// Gets or sets the name of the managedBy tenant. /// [JsonProperty(PropertyName = "managedByTenantName")] public string ManagedByTenantName { get; set; } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinition.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinition.cs index 65d88d10b5dcb..ad32f3c954aed 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinition.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinition.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Registration definition. + /// The registration definition. /// public partial class RegistrationDefinition : IResource { @@ -31,20 +31,25 @@ public RegistrationDefinition() /// /// Initializes a new instance of the RegistrationDefinition class. /// - /// Properties of a registration + /// The properties of a registration /// definition. - /// Plan details for the managed services. - /// Fully qualified path of the registration + /// The details for the Managed Services offer’s + /// plan in Azure Marketplace. + /// The fully qualified path of the registration /// definition. - /// Type of the resource. - /// Name of the registration definition. - public RegistrationDefinition(RegistrationDefinitionProperties properties = default(RegistrationDefinitionProperties), Plan plan = default(Plan), string id = default(string), string type = default(string), string name = default(string)) + /// The type of the Azure resource + /// (Microsoft.ManagedServices/registrationDefinitions). + /// The name of the registration definition. + /// The metadata for the registration + /// assignment resource. + public RegistrationDefinition(RegistrationDefinitionProperties properties = default(RegistrationDefinitionProperties), Plan plan = default(Plan), string id = default(string), string type = default(string), string name = default(string), SystemData systemData = default(SystemData)) { Properties = properties; Plan = plan; Id = id; Type = type; Name = name; + SystemData = systemData; CustomInit(); } @@ -54,35 +59,43 @@ public RegistrationDefinition() partial void CustomInit(); /// - /// Gets or sets properties of a registration definition. + /// Gets or sets the properties of a registration definition. /// [JsonProperty(PropertyName = "properties")] public RegistrationDefinitionProperties Properties { get; set; } /// - /// Gets or sets plan details for the managed services. + /// Gets or sets the details for the Managed Services offer’s plan in + /// Azure Marketplace. /// [JsonProperty(PropertyName = "plan")] public Plan Plan { get; set; } /// - /// Gets fully qualified path of the registration definition. + /// Gets the fully qualified path of the registration definition. /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets type of the resource. + /// Gets the type of the Azure resource + /// (Microsoft.ManagedServices/registrationDefinitions). /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Gets name of the registration definition. + /// Gets the name of the registration definition. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets the metadata for the registration assignment resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinitionProperties.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinitionProperties.cs index 6f1ded14d68fa..185cde49f6b03 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinitionProperties.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/RegistrationDefinitionProperties.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Management.ManagedServices.Models using System.Linq; /// - /// Properties of a registration definition. + /// The properties of a registration definition. /// public partial class RegistrationDefinitionProperties { @@ -34,27 +34,41 @@ public RegistrationDefinitionProperties() /// Initializes a new instance of the RegistrationDefinitionProperties /// class. /// - /// Authorization tuple containing - /// principal id of the user/security group or service principal and id - /// of the build-in role. - /// Id of the managedBy tenant. - /// Description of the registration - /// definition. - /// Name of the registration + /// The collection of authorization + /// objects describing the access Azure Active Directory principals in + /// the managedBy tenant will receive on the delegated resource in the + /// managed tenant. + /// The identifier of the managedBy + /// tenant. + /// The description of the registration /// definition. - /// Current state of the registration - /// definition. Possible values include: 'NotSpecified', 'Accepted', - /// 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', - /// 'Canceled', 'Failed', 'Succeeded', 'Updating' - /// Name of the managedBy + /// The collection of eligible + /// authorization objects describing the just-in-time access Azure + /// Active Directory principals in the managedBy tenant will receive on + /// the delegated resource in the managed tenant. + /// The name of the + /// registration definition. + /// The current provisioning state of + /// the registration definition. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Updating' + /// The identifier of the managed + /// tenant. + /// The name of the managed /// tenant. - public RegistrationDefinitionProperties(IList authorizations, string managedByTenantId, string description = default(string), string registrationDefinitionName = default(string), string provisioningState = default(string), string managedByTenantName = default(string)) + /// The name of the managedBy + /// tenant. + public RegistrationDefinitionProperties(IList authorizations, string managedByTenantId, string description = default(string), IList eligibleAuthorizations = default(IList), string registrationDefinitionName = default(string), string provisioningState = default(string), string manageeTenantId = default(string), string manageeTenantName = default(string), string managedByTenantName = default(string)) { Description = description; Authorizations = authorizations; + EligibleAuthorizations = eligibleAuthorizations; RegistrationDefinitionName = registrationDefinitionName; ManagedByTenantId = managedByTenantId; ProvisioningState = provisioningState; + ManageeTenantId = manageeTenantId; + ManageeTenantName = manageeTenantName; ManagedByTenantName = managedByTenantName; CustomInit(); } @@ -65,42 +79,63 @@ public RegistrationDefinitionProperties() partial void CustomInit(); /// - /// Gets or sets description of the registration definition. + /// Gets or sets the description of the registration definition. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// - /// Gets or sets authorization tuple containing principal id of the - /// user/security group or service principal and id of the build-in - /// role. + /// Gets or sets the collection of authorization objects describing the + /// access Azure Active Directory principals in the managedBy tenant + /// will receive on the delegated resource in the managed tenant. /// [JsonProperty(PropertyName = "authorizations")] public IList Authorizations { get; set; } /// - /// Gets or sets name of the registration definition. + /// Gets or sets the collection of eligible authorization objects + /// describing the just-in-time access Azure Active Directory + /// principals in the managedBy tenant will receive on the delegated + /// resource in the managed tenant. + /// + [JsonProperty(PropertyName = "eligibleAuthorizations")] + public IList EligibleAuthorizations { get; set; } + + /// + /// Gets or sets the name of the registration definition. /// [JsonProperty(PropertyName = "registrationDefinitionName")] public string RegistrationDefinitionName { get; set; } /// - /// Gets or sets id of the managedBy tenant. + /// Gets or sets the identifier of the managedBy tenant. /// [JsonProperty(PropertyName = "managedByTenantId")] public string ManagedByTenantId { get; set; } /// - /// Gets current state of the registration definition. Possible values - /// include: 'NotSpecified', 'Accepted', 'Running', 'Ready', - /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - /// 'Succeeded', 'Updating' + /// Gets the current provisioning state of the registration definition. + /// Possible values include: 'NotSpecified', 'Accepted', 'Running', + /// 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', + /// 'Failed', 'Succeeded', 'Updating' /// [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } /// - /// Gets name of the managedBy tenant. + /// Gets the identifier of the managed tenant. + /// + [JsonProperty(PropertyName = "manageeTenantId")] + public string ManageeTenantId { get; private set; } + + /// + /// Gets the name of the managed tenant. + /// + [JsonProperty(PropertyName = "manageeTenantName")] + public string ManageeTenantName { get; private set; } + + /// + /// Gets the name of the managedBy tenant. /// [JsonProperty(PropertyName = "managedByTenantName")] public string ManagedByTenantName { get; private set; } @@ -131,6 +166,16 @@ public virtual void Validate() } } } + if (EligibleAuthorizations != null) + { + foreach (var element1 in EligibleAuthorizations) + { + if (element1 != null) + { + element1.Validate(); + } + } + } } } } diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/SystemData.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..f6d8cae1028b6 --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// 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.ManagedServices.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScope.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScope.cs new file mode 100644 index 0000000000000..98bfcfbe8f51a --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScope.cs @@ -0,0 +1,231 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationsWithScope operations. + /// + internal partial class OperationsWithScope : IServiceOperations, IOperationsWithScope + { + /// + /// Initializes a new instance of the OperationsWithScope class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationsWithScope(ManagedServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ManagedServicesClient + /// + public ManagedServicesClient Client { get; private set; } + + /// + /// Gets a list of the operations with the scope. + /// + /// + /// The scope of the resource. + /// + /// + /// 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> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + 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("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.ManagedServices/operations").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScopeExtensions.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScopeExtensions.cs new file mode 100644 index 0000000000000..2125d0aa9bfbe --- /dev/null +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/OperationsWithScopeExtensions.cs @@ -0,0 +1,59 @@ +// +// 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.ManagedServices +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationsWithScope. + /// + public static partial class OperationsWithScopeExtensions + { + /// + /// Gets a list of the operations with the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + public static OperationList List(this IOperationsWithScope operations, string scope) + { + return operations.ListAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of the operations with the scope. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The scope of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IOperationsWithScope operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperations.cs index 600a7b5d4e769..5363cd387b862 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperations.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperations.cs @@ -51,17 +51,17 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) public ManagedServicesClient Client { get; private set; } /// - /// Gets the details of specified registration assignment. + /// Gets the details of the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. /// /// /// Headers that will be added to request. @@ -249,10 +249,10 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// Deletes the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The headers that will be added to request. @@ -271,10 +271,10 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// Creates or updates a registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. @@ -296,11 +296,14 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// Gets a list of the registration assignments. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// Headers that will be added to request. @@ -323,7 +326,7 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string scope, bool? expandRegistrationDefinition = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string scope, bool? expandRegistrationDefinition = default(bool?), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -342,6 +345,7 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("scope", scope); tracingParameters.Add("expandRegistrationDefinition", expandRegistrationDefinition); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -358,6 +362,10 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -482,10 +490,10 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// Deletes the specified registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// Headers that will be added to request. @@ -647,10 +655,10 @@ internal RegistrationAssignmentsOperations(ManagedServicesClient client) /// Creates or updates a registration assignment. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperationsExtensions.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperationsExtensions.cs index c5f1dcff1e1e1..86f756e1d5cc6 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperationsExtensions.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationAssignmentsOperationsExtensions.cs @@ -22,20 +22,20 @@ namespace Microsoft.Azure.Management.ManagedServices public static partial class RegistrationAssignmentsOperationsExtensions { /// - /// Gets the details of specified registration assignment. + /// Gets the details of the specified registration assignment. /// /// /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. /// public static RegistrationAssignment Get(this IRegistrationAssignmentsOperations operations, string scope, string registrationAssignmentId, bool? expandRegistrationDefinition = default(bool?)) { @@ -43,20 +43,20 @@ public static partial class RegistrationAssignmentsOperationsExtensions } /// - /// Gets the details of specified registration assignment. + /// Gets the details of the specified registration assignment. /// /// /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. /// /// /// The cancellation token. @@ -76,10 +76,10 @@ public static partial class RegistrationAssignmentsOperationsExtensions /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// public static void Delete(this IRegistrationAssignmentsOperations operations, string scope, string registrationAssignmentId) { @@ -93,10 +93,10 @@ public static void Delete(this IRegistrationAssignmentsOperations operations, st /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The cancellation token. @@ -113,10 +113,10 @@ public static void Delete(this IRegistrationAssignmentsOperations operations, st /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. @@ -133,10 +133,10 @@ public static RegistrationAssignment CreateOrUpdate(this IRegistrationAssignment /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. @@ -159,15 +159,18 @@ public static RegistrationAssignment CreateOrUpdate(this IRegistrationAssignment /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. /// - public static IPage List(this IRegistrationAssignmentsOperations operations, string scope, bool? expandRegistrationDefinition = default(bool?)) + /// + /// The filter query parameter to filter managed services resources by. + /// + public static IPage List(this IRegistrationAssignmentsOperations operations, string scope, bool? expandRegistrationDefinition = default(bool?), string filter = default(string)) { - return operations.ListAsync(scope, expandRegistrationDefinition).GetAwaiter().GetResult(); + return operations.ListAsync(scope, expandRegistrationDefinition, filter).GetAwaiter().GetResult(); } /// @@ -177,18 +180,21 @@ public static RegistrationAssignment CreateOrUpdate(this IRegistrationAssignment /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Tells whether to return registration definition details also along with - /// registration assignment details. + /// The flag indicating whether to return the registration definition details + /// along with the registration assignment details. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRegistrationAssignmentsOperations operations, string scope, bool? expandRegistrationDefinition = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRegistrationAssignmentsOperations operations, string scope, bool? expandRegistrationDefinition = default(bool?), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(scope, expandRegistrationDefinition, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(scope, expandRegistrationDefinition, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -201,10 +207,10 @@ public static RegistrationAssignment CreateOrUpdate(this IRegistrationAssignment /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// public static void BeginDelete(this IRegistrationAssignmentsOperations operations, string scope, string registrationAssignmentId) { @@ -218,10 +224,10 @@ public static void BeginDelete(this IRegistrationAssignmentsOperations operation /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The cancellation token. @@ -238,10 +244,10 @@ public static void BeginDelete(this IRegistrationAssignmentsOperations operation /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. @@ -258,10 +264,10 @@ public static RegistrationAssignment BeginCreateOrUpdate(this IRegistrationAssig /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration assignment. + /// The GUID of the registration assignment. /// /// /// The parameters required to create new registration assignment. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperations.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperations.cs index 795cc4fcea558..20d355a73e564 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperations.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperations.cs @@ -54,10 +54,10 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// Gets the registration definition details. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// /// Headers that will be added to request. @@ -240,10 +240,10 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// Deletes the registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// /// Headers that will be added to request. @@ -405,13 +405,13 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// Creates or updates a registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// The headers that will be added to request. @@ -430,7 +430,10 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// Gets a list of the registration definitions. /// /// - /// Scope of the resource. + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// Headers that will be added to request. @@ -453,7 +456,7 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string scope, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -471,6 +474,7 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("scope", scope); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -483,6 +487,10 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -607,13 +615,13 @@ internal RegistrationDefinitionsOperations(ManagedServicesClient client) /// Creates or updates a registration definition. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// Headers that will be added to request. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperationsExtensions.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperationsExtensions.cs index e86770e032bea..722042cc9da20 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperationsExtensions.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/RegistrationDefinitionsOperationsExtensions.cs @@ -28,10 +28,10 @@ public static partial class RegistrationDefinitionsOperationsExtensions /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// public static RegistrationDefinition Get(this IRegistrationDefinitionsOperations operations, string scope, string registrationDefinitionId) { @@ -45,10 +45,10 @@ public static RegistrationDefinition Get(this IRegistrationDefinitionsOperations /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// /// The cancellation token. @@ -68,10 +68,10 @@ public static RegistrationDefinition Get(this IRegistrationDefinitionsOperations /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// public static void Delete(this IRegistrationDefinitionsOperations operations, string registrationDefinitionId, string scope) { @@ -85,10 +85,10 @@ public static void Delete(this IRegistrationDefinitionsOperations operations, st /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// /// The cancellation token. @@ -105,13 +105,13 @@ public static void Delete(this IRegistrationDefinitionsOperations operations, st /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// public static RegistrationDefinition CreateOrUpdate(this IRegistrationDefinitionsOperations operations, string registrationDefinitionId, string scope, RegistrationDefinition requestBody) { @@ -125,13 +125,13 @@ public static RegistrationDefinition CreateOrUpdate(this IRegistrationDefinition /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// The cancellation token. @@ -151,11 +151,14 @@ public static RegistrationDefinition CreateOrUpdate(this IRegistrationDefinition /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. /// - public static IPage List(this IRegistrationDefinitionsOperations operations, string scope) + /// + /// The filter query parameter to filter managed services resources by. + /// + public static IPage List(this IRegistrationDefinitionsOperations operations, string scope, string filter = default(string)) { - return operations.ListAsync(scope).GetAwaiter().GetResult(); + return operations.ListAsync(scope, filter).GetAwaiter().GetResult(); } /// @@ -165,14 +168,17 @@ public static IPage List(this IRegistrationDefinitionsOp /// The operations group for this extension method. /// /// - /// Scope of the resource. + /// The scope of the resource. + /// + /// + /// The filter query parameter to filter managed services resources by. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IRegistrationDefinitionsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRegistrationDefinitionsOperations operations, string scope, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(scope, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -185,13 +191,13 @@ public static IPage List(this IRegistrationDefinitionsOp /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// public static RegistrationDefinition BeginCreateOrUpdate(this IRegistrationDefinitionsOperations operations, string registrationDefinitionId, string scope, RegistrationDefinition requestBody) { @@ -205,13 +211,13 @@ public static RegistrationDefinition BeginCreateOrUpdate(this IRegistrationDefin /// The operations group for this extension method. /// /// - /// Guid of the registration definition. + /// The GUID of the registration definition. /// /// - /// Scope of the resource. + /// The scope of the resource. /// /// - /// The parameters required to create new registration definition. + /// The parameters required to create a new registration definition. /// /// /// The cancellation token. diff --git a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/SdkInfo_ManagedServicesClient.cs b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/SdkInfo_ManagedServicesClient.cs index c28da342868c4..676441fade3a5 100644 --- a/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/SdkInfo_ManagedServicesClient.cs +++ b/sdk/managedservices/Microsoft.Azure.Management.ManagedServices/src/Generated/SdkInfo_ManagedServicesClient.cs @@ -19,9 +19,12 @@ public static IEnumerable> ApiInfo_ManagedServices { return new Tuple[] { - new Tuple("ManagedServices", "Operations", "2019-06-01"), - new Tuple("ManagedServices", "RegistrationAssignments", "2019-06-01"), - new Tuple("ManagedServices", "RegistrationDefinitions", "2019-06-01"), + new Tuple("ManagedServices", "MarketplaceRegistrationDefinitions", "2022-01-01-preview"), + new Tuple("ManagedServices", "MarketplaceRegistrationDefinitionsWithoutScope", "2022-01-01-preview"), + new Tuple("ManagedServices", "Operations", "2022-01-01-preview"), + new Tuple("ManagedServices", "OperationsWithScope", "2022-01-01-preview"), + new Tuple("ManagedServices", "RegistrationAssignments", "2022-01-01-preview"), + new Tuple("ManagedServices", "RegistrationDefinitions", "2022-01-01-preview"), }.AsEnumerable(); } }