diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs index f359a120a5cd..7499f372ca8e 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementClient.cs @@ -257,9 +257,9 @@ public partial class ApiManagementClient : ServiceClient, I public virtual IPolicyOperations Policy { get; private set; } /// - /// Gets the IPolicySnippetOperations. + /// Gets the IPolicyDescriptionOperations. /// - public virtual IPolicySnippetOperations PolicySnippet { get; private set; } + public virtual IPolicyDescriptionOperations PolicyDescription { get; private set; } /// /// Gets the ISignInSettingsOperations. @@ -302,9 +302,9 @@ public partial class ApiManagementClient : ServiceClient, I public virtual IProductPolicyOperations ProductPolicy { get; private set; } /// - /// Gets the IPropertyOperations. + /// Gets the INamedValueOperations. /// - public virtual IPropertyOperations Property { get; private set; } + public virtual INamedValueOperations NamedValue { get; private set; } /// /// Gets the IQuotaByCounterKeysOperations. @@ -658,7 +658,7 @@ private void Initialize() NotificationRecipientEmail = new NotificationRecipientEmailOperations(this); OpenIdConnectProvider = new OpenIdConnectProviderOperations(this); Policy = new PolicyOperations(this); - PolicySnippet = new PolicySnippetOperations(this); + PolicyDescription = new PolicyDescriptionOperations(this); SignInSettings = new SignInSettingsOperations(this); SignUpSettings = new SignUpSettingsOperations(this); DelegationSettings = new DelegationSettingsOperations(this); @@ -667,7 +667,7 @@ private void Initialize() ProductGroup = new ProductGroupOperations(this); ProductSubscriptions = new ProductSubscriptionsOperations(this); ProductPolicy = new ProductPolicyOperations(this); - Property = new PropertyOperations(this); + NamedValue = new NamedValueOperations(this); QuotaByCounterKeys = new QuotaByCounterKeysOperations(this); QuotaByPeriodKeys = new QuotaByPeriodKeysOperations(this); Region = new RegionOperations(this); @@ -684,7 +684,7 @@ private void Initialize() UserConfirmationPassword = new UserConfirmationPasswordOperations(this); ApiExport = new ApiExportOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-01-01"; + ApiVersion = "2019-12-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs index 0f2243752094..2434d5cfd4df 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceOperations.cs @@ -171,7 +171,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -302,14 +302,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -319,10 +318,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -401,7 +396,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -511,14 +506,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -528,10 +522,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -770,7 +760,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -901,14 +891,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -918,10 +907,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -979,7 +964,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1098,14 +1083,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1115,10 +1099,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1213,7 +1193,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1359,14 +1339,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1376,10 +1355,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1444,7 +1419,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1590,14 +1565,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1607,10 +1581,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1674,7 +1644,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1820,14 +1790,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1837,10 +1806,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1921,7 +1886,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2063,14 +2028,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2080,10 +2044,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2143,7 +2103,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2274,14 +2234,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2291,10 +2250,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2361,7 +2316,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2499,14 +2454,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2516,10 +2470,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2576,7 +2526,7 @@ internal ApiManagementServiceOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2672,14 +2622,13 @@ internal ApiManagementServiceOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2689,10 +2638,6 @@ internal ApiManagementServiceOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs index 0d6f14e89e32..9d697c4b8548 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiManagementServiceSkusOperations.cs @@ -68,7 +68,7 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -199,14 +199,13 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +215,6 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -279,7 +274,7 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -375,14 +370,13 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -392,10 +386,6 @@ internal ApiManagementServiceSkusOperations(ApiManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs index 6abac6404a96..9cae2fce25d1 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperations.cs @@ -864,6 +864,45 @@ internal ApiSchemaOperations(ApiManagementClient client) /// updating an entity. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the schema configuration at the Api. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// API revision identifier. Must be unique in the current API Management + /// service instance. Non-current revision has ;rev=n as a suffix where n is + /// the revision number. + /// + /// + /// Schema identifier within an API. Must be unique in the current API + /// Management service instance. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// If true removes all references to the schema before deleting it. + /// + /// /// Headers that will be added to request. /// /// @@ -872,9 +911,6 @@ internal ApiSchemaOperations(ApiManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -884,7 +920,7 @@ internal ApiSchemaOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, string ifMatch, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -947,13 +983,9 @@ internal ApiSchemaOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "schemaId", "^[^*#&+:<>?]+$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (ifMatch == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); } if (Client.ApiVersion == null) { @@ -974,10 +1006,10 @@ internal ApiSchemaOperations(ApiManagementClient client) tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); tracingParameters.Add("schemaId", schemaId); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("force", force); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -988,6 +1020,10 @@ internal ApiSchemaOperations(ApiManagementClient client) _url = _url.Replace("{schemaId}", System.Uri.EscapeDataString(schemaId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (force != null) + { + _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -999,7 +1035,7 @@ internal ApiSchemaOperations(ApiManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1038,12 +1074,6 @@ internal ApiSchemaOperations(ApiManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1064,7 +1094,7 @@ internal ApiSchemaOperations(ApiManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1094,62 +1124,13 @@ internal ApiSchemaOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1158,7 +1139,7 @@ internal ApiSchemaOperations(ApiManagementClient client) } /// - /// Deletes the schema configuration at the Api. + /// Creates or updates schema configuration for the API. /// /// /// The name of the resource group. @@ -1175,13 +1156,12 @@ internal ApiSchemaOperations(ApiManagementClient client) /// Schema identifier within an API. Must be unique in the current API /// Management service instance. /// - /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. + /// + /// The schema contents to apply. /// - /// - /// If true removes all references to the schema before deleting it. + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. /// /// /// Headers that will be added to request. @@ -1192,6 +1172,9 @@ internal ApiSchemaOperations(ApiManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1201,7 +1184,7 @@ internal ApiSchemaOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, string ifMatch, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1264,9 +1247,13 @@ internal ApiSchemaOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "schemaId", "^[^*#&+:<>?]+$"); } } - if (ifMatch == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } if (Client.ApiVersion == null) { @@ -1287,10 +1274,10 @@ internal ApiSchemaOperations(ApiManagementClient client) tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); tracingParameters.Add("schemaId", schemaId); - tracingParameters.Add("force", force); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1301,10 +1288,6 @@ internal ApiSchemaOperations(ApiManagementClient client) _url = _url.Replace("{schemaId}", System.Uri.EscapeDataString(schemaId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (force != null) - { - _queryParameters.Add(string.Format("force={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(force, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -1316,7 +1299,7 @@ internal ApiSchemaOperations(ApiManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1355,6 +1338,12 @@ internal ApiSchemaOperations(ApiManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1375,7 +1364,7 @@ internal ApiSchemaOperations(ApiManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1405,13 +1394,62 @@ internal ApiSchemaOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs index 0636ec44f3ff..6bbea3e1cb31 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiSchemaOperationsExtensions.cs @@ -243,7 +243,7 @@ public static SchemaContract Get(this IApiSchemaOperations operations, string re /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// - public static SchemaContract CreateOrUpdate(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string)) + public static SchemaContract CreateOrUpdate(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string)) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch).GetAwaiter().GetResult(); } @@ -279,7 +279,7 @@ public static SchemaContract Get(this IApiSchemaOperations operations, string re /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { @@ -358,6 +358,78 @@ public static SchemaContract Get(this IApiSchemaOperations operations, string re (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, schemaId, ifMatch, force, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Creates or updates schema configuration for the API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// API revision identifier. Must be unique in the current API Management + /// service instance. Non-current revision has ;rev=n as a suffix where n is + /// the revision number. + /// + /// + /// Schema identifier within an API. Must be unique in the current API + /// Management service instance. + /// + /// + /// The schema contents to apply. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + public static SchemaContract BeginCreateOrUpdate(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string)) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates schema configuration for the API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// API revision identifier. Must be unique in the current API Management + /// service instance. Non-current revision has ;rev=n as a suffix where n is + /// the revision number. + /// + /// + /// Schema identifier within an API. Must be unique in the current API + /// Management service instance. + /// + /// + /// The schema contents to apply. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IApiSchemaOperations operations, string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, schemaId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get the schema configuration at the API level. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs index fae11a014ff3..74c35d5e26e6 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperations.cs @@ -311,9 +311,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// Headers that will be added to request. @@ -333,7 +333,7 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -377,23 +377,23 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$"); } } - if (tagId == null) + if (tagDescriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagId"); + throw new ValidationException(ValidationRules.CannotBeNull, "tagDescriptionId"); } - if (tagId != null) + if (tagDescriptionId != null) { - if (tagId.Length > 80) + if (tagDescriptionId.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "tagId", 80); + throw new ValidationException(ValidationRules.MaxLength, "tagDescriptionId", 80); } - if (tagId.Length < 1) + if (tagDescriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "tagId", 1); + throw new ValidationException(ValidationRules.MinLength, "tagDescriptionId", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(tagId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(tagDescriptionId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "tagId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$"); } } if (Client.ApiVersion == null) @@ -414,17 +414,17 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); - tracingParameters.Add("tagId", tagId); + tracingParameters.Add("tagDescriptionId", tagDescriptionId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId)); - _url = _url.Replace("{tagId}", System.Uri.EscapeDataString(tagId)); + _url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -560,9 +560,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// Headers that will be added to request. @@ -585,7 +585,7 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -629,23 +629,23 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$"); } } - if (tagId == null) + if (tagDescriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagId"); + throw new ValidationException(ValidationRules.CannotBeNull, "tagDescriptionId"); } - if (tagId != null) + if (tagDescriptionId != null) { - if (tagId.Length > 80) + if (tagDescriptionId.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "tagId", 80); + throw new ValidationException(ValidationRules.MaxLength, "tagDescriptionId", 80); } - if (tagId.Length < 1) + if (tagDescriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "tagId", 1); + throw new ValidationException(ValidationRules.MinLength, "tagDescriptionId", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(tagId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(tagDescriptionId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "tagId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$"); } } if (Client.ApiVersion == null) @@ -666,17 +666,17 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); - tracingParameters.Add("tagId", tagId); + tracingParameters.Add("tagDescriptionId", tagDescriptionId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId)); - _url = _url.Replace("{tagId}", System.Uri.EscapeDataString(tagId)); + _url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -830,9 +830,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// Create parameters. @@ -862,7 +862,7 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -906,23 +906,23 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$"); } } - if (tagId == null) + if (tagDescriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagId"); + throw new ValidationException(ValidationRules.CannotBeNull, "tagDescriptionId"); } - if (tagId != null) + if (tagDescriptionId != null) { - if (tagId.Length > 80) + if (tagDescriptionId.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "tagId", 80); + throw new ValidationException(ValidationRules.MaxLength, "tagDescriptionId", 80); } - if (tagId.Length < 1) + if (tagDescriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "tagId", 1); + throw new ValidationException(ValidationRules.MinLength, "tagDescriptionId", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(tagId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(tagDescriptionId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "tagId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$"); } } if (parameters == null) @@ -951,7 +951,7 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); - tracingParameters.Add("tagId", tagId); + tracingParameters.Add("tagDescriptionId", tagDescriptionId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); @@ -959,11 +959,11 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId)); - _url = _url.Replace("{tagId}", System.Uri.EscapeDataString(tagId)); + _url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1149,9 +1149,9 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// ETag of the Entity. ETag should match the current entity state from the @@ -1176,7 +1176,7 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1220,23 +1220,23 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$"); } } - if (tagId == null) + if (tagDescriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tagId"); + throw new ValidationException(ValidationRules.CannotBeNull, "tagDescriptionId"); } - if (tagId != null) + if (tagDescriptionId != null) { - if (tagId.Length > 80) + if (tagDescriptionId.Length > 80) { - throw new ValidationException(ValidationRules.MaxLength, "tagId", 80); + throw new ValidationException(ValidationRules.MaxLength, "tagDescriptionId", 80); } - if (tagId.Length < 1) + if (tagDescriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "tagId", 1); + throw new ValidationException(ValidationRules.MinLength, "tagDescriptionId", 1); } - if (!System.Text.RegularExpressions.Regex.IsMatch(tagId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(tagDescriptionId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "tagId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "tagDescriptionId", "^[^*#&+:<>?]+$"); } } if (ifMatch == null) @@ -1261,18 +1261,18 @@ internal ApiTagDescriptionOperations(ApiManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); tracingParameters.Add("apiId", apiId); - tracingParameters.Add("tagId", tagId); + tracingParameters.Add("tagDescriptionId", tagDescriptionId); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{apiId}", System.Uri.EscapeDataString(apiId)); - _url = _url.Replace("{tagId}", System.Uri.EscapeDataString(tagId)); + _url = _url.Replace("{tagDescriptionId}", System.Uri.EscapeDataString(tagDescriptionId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperationsExtensions.cs index 08a1701f324d..8016c3a7931a 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ApiTagDescriptionOperationsExtensions.cs @@ -99,13 +99,13 @@ public static partial class ApiTagDescriptionOperationsExtensions /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// - public static ApiTagDescriptionGetEntityTagHeaders GetEntityTag(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId) + public static ApiTagDescriptionGetEntityTagHeaders GetEntityTag(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId) { - return operations.GetEntityTagAsync(resourceGroupName, serviceName, apiId, tagId).GetAwaiter().GetResult(); + return operations.GetEntityTagAsync(resourceGroupName, serviceName, apiId, tagDescriptionId).GetAwaiter().GetResult(); } /// @@ -125,16 +125,16 @@ public static ApiTagDescriptionGetEntityTagHeaders GetEntityTag(this IApiTagDesc /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// The cancellation token. /// - public static async Task GetEntityTagAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetEntityTagAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } @@ -157,13 +157,13 @@ public static ApiTagDescriptionGetEntityTagHeaders GetEntityTag(this IApiTagDesc /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// - public static TagDescriptionContract Get(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId) + public static TagDescriptionContract Get(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId) { - return operations.GetAsync(resourceGroupName, serviceName, apiId, tagId).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, serviceName, apiId, tagDescriptionId).GetAwaiter().GetResult(); } /// @@ -183,16 +183,16 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -215,9 +215,9 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// Create parameters. @@ -226,9 +226,9 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// - public static TagDescriptionContract CreateOrUpdate(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, TagDescriptionCreateParameters parameters, string ifMatch = default(string)) + public static TagDescriptionContract CreateOrUpdate(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, TagDescriptionCreateParameters parameters, string ifMatch = default(string)) { - return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, apiId, tagId, parameters, ifMatch).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch).GetAwaiter().GetResult(); } /// @@ -248,9 +248,9 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// Create parameters. @@ -262,9 +262,9 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -287,18 +287,18 @@ public static TagDescriptionContract Get(this IApiTagDescriptionOperations opera /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// - public static void Delete(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, string ifMatch) + public static void Delete(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch) { - operations.DeleteAsync(resourceGroupName, serviceName, apiId, tagId, ifMatch).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch).GetAwaiter().GetResult(); } /// @@ -318,9 +318,9 @@ public static void Delete(this IApiTagDescriptionOperations operations, string r /// service instance. Non-current revision has ;rev=n as a suffix where n is /// the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management service - /// instance. + /// + /// Tag description identifier. Used when creating tagDescription for API/Tag + /// association. Based on API and Tag names. /// /// /// ETag of the Entity. ETag should match the current entity state from the @@ -330,9 +330,9 @@ public static void Delete(this IApiTagDescriptionOperations operations, string r /// /// The cancellation token. /// - public static async Task DeleteAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IApiTagDescriptionOperations operations, string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, apiId, tagDescriptionId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs index 3228d8203769..1e74e110c600 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperations.cs @@ -1498,6 +1498,236 @@ internal AuthorizationServerOperations(ApiManagementClient client) return _result; } + /// + /// Gets the client secret details of the authorization server. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the authorization server. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (authsid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "authsid"); + } + if (authsid != null) + { + if (authsid.Length > 80) + { + throw new ValidationException(ValidationRules.MaxLength, "authsid", 80); + } + if (authsid.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "authsid", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(authsid, "^[^*#&+:<>?]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "authsid", "^[^*#&+:<>?]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("authsid", authsid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{authsid}", System.Uri.EscapeDataString(authsid)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + /// /// Lists a collection of authorization servers defined within a service /// instance. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs index 843f492ccfa3..77e0a9164cad 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/AuthorizationServerOperationsExtensions.cs @@ -340,6 +340,52 @@ public static void Delete(this IAuthorizationServerOperations operations, string (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, authsid, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the client secret details of the authorization server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the authorization server. + /// + public static ClientSecretContract ListSecrets(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName, authsid).GetAwaiter().GetResult(); + } + + /// + /// Gets the client secret details of the authorization server. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the authorization server. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this IAuthorizationServerOperations operations, string resourceGroupName, string serviceName, string authsid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, authsid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists a collection of authorization servers defined within a service /// instance. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperations.cs index 12e1a197102f..ff58ec28a557 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperations.cs @@ -917,5 +917,211 @@ internal DelegationSettingsOperations(ApiManagementClient client) return _result; } + /// + /// Gets the secret validation key of the DelegationSettings. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperationsExtensions.cs index 0f5770da5bef..7fca2afb47c5 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/DelegationSettingsOperationsExtensions.cs @@ -208,5 +208,45 @@ public static void Update(this IDelegationSettingsOperations operations, string } } + /// + /// Gets the secret validation key of the DelegationSettings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + public static PortalSettingValidationKeyContract ListSecrets(this IDelegationSettingsOperations operations, string resourceGroupName, string serviceName) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the secret validation key of the DelegationSettings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this IDelegationSettingsOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementClient.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementClient.cs index af383c0b11fd..2cb4981e0708 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementClient.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementClient.cs @@ -252,9 +252,9 @@ public partial interface IApiManagementClient : System.IDisposable IPolicyOperations Policy { get; } /// - /// Gets the IPolicySnippetOperations. + /// Gets the IPolicyDescriptionOperations. /// - IPolicySnippetOperations PolicySnippet { get; } + IPolicyDescriptionOperations PolicyDescription { get; } /// /// Gets the ISignInSettingsOperations. @@ -297,9 +297,9 @@ public partial interface IApiManagementClient : System.IDisposable IProductPolicyOperations ProductPolicy { get; } /// - /// Gets the IPropertyOperations. + /// Gets the INamedValueOperations. /// - IPropertyOperations Property { get; } + INamedValueOperations NamedValue { get; } /// /// Gets the IQuotaByCounterKeysOperations. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceOperations.cs index 214f132e961e..18a92821d2b0 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceOperations.cs @@ -45,7 +45,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -75,7 +75,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -134,7 +134,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -159,7 +159,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,7 +184,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -206,7 +206,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -251,7 +251,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -274,7 +274,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -306,7 +306,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -338,7 +338,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -368,7 +368,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -398,7 +398,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -427,7 +427,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -452,7 +452,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -484,7 +484,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -506,7 +506,7 @@ public partial interface IApiManagementServiceOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceSkusOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceSkusOperations.cs index 8dba60dcca05..7b4b401e3577 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceSkusOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiManagementServiceSkusOperations.cs @@ -41,7 +41,7 @@ public partial interface IApiManagementServiceSkusOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,7 +66,7 @@ public partial interface IApiManagementServiceSkusOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiSchemaOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiSchemaOperations.cs index 5f405449114d..36b04281fafe 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiSchemaOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiSchemaOperations.cs @@ -172,7 +172,7 @@ public partial interface IApiSchemaOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaCreateOrUpdateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the schema configuration at the Api. /// @@ -213,6 +213,47 @@ public partial interface IApiSchemaOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, string ifMatch, bool? force = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Creates or updates schema configuration for the API. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// API revision identifier. Must be unique in the current API + /// Management service instance. Non-current revision has ;rev=n as a + /// suffix where n is the revision number. + /// + /// + /// Schema identifier within an API. Must be unique in the current API + /// Management service instance. + /// + /// + /// The schema contents to apply. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but + /// required when updating an entity. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string schemaId, SchemaContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get the schema configuration at the API level. /// /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiTagDescriptionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiTagDescriptionOperations.cs index de82a0ef8a2e..8ee299769bdb 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiTagDescriptionOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IApiTagDescriptionOperations.cs @@ -74,9 +74,9 @@ public partial interface IApiTagDescriptionOperations /// Management service instance. Non-current revision has ;rev=n as a /// suffix where n is the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management - /// service instance. + /// + /// Tag description identifier. Used when creating tagDescription for + /// API/Tag association. Based on API and Tag names. /// /// /// The headers that will be added to request. @@ -90,7 +90,7 @@ public partial interface IApiTagDescriptionOperations /// /// Thrown when a required parameter is null /// - Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get Tag description in scope of API /// @@ -105,9 +105,9 @@ public partial interface IApiTagDescriptionOperations /// Management service instance. Non-current revision has ;rev=n as a /// suffix where n is the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management - /// service instance. + /// + /// Tag description identifier. Used when creating tagDescription for + /// API/Tag association. Based on API and Tag names. /// /// /// The headers that will be added to request. @@ -124,7 +124,7 @@ public partial interface IApiTagDescriptionOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create/Update tag description in scope of the Api. /// @@ -139,9 +139,9 @@ public partial interface IApiTagDescriptionOperations /// Management service instance. Non-current revision has ;rev=n as a /// suffix where n is the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management - /// service instance. + /// + /// Tag description identifier. Used when creating tagDescription for + /// API/Tag association. Based on API and Tag names. /// /// /// Create parameters. @@ -165,7 +165,7 @@ public partial interface IApiTagDescriptionOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, TagDescriptionCreateParameters parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete tag description for the Api. /// @@ -180,9 +180,9 @@ public partial interface IApiTagDescriptionOperations /// Management service instance. Non-current revision has ;rev=n as a /// suffix where n is the revision number. /// - /// - /// Tag identifier. Must be unique in the current API Management - /// service instance. + /// + /// Tag description identifier. Used when creating tagDescription for + /// API/Tag association. Based on API and Tag names. /// /// /// ETag of the Entity. ETag should match the current entity state from @@ -201,7 +201,7 @@ public partial interface IApiTagDescriptionOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string apiId, string tagDescriptionId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all Tags descriptions in scope of API. Model similar to /// swagger - tagDescription is defined on API level but tag may be diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IAuthorizationServerOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IAuthorizationServerOperations.cs index a2a7f772c677..95d05f9f40ff 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IAuthorizationServerOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IAuthorizationServerOperations.cs @@ -209,6 +209,34 @@ public partial interface IAuthorizationServerOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the client secret details of the authorization server. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the authorization server. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string authsid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists a collection of authorization servers defined within a /// service instance. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IDelegationSettingsOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IDelegationSettingsOperations.cs index 8f2a0ec61d69..23de5bee062a 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IDelegationSettingsOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IDelegationSettingsOperations.cs @@ -132,5 +132,30 @@ public partial interface IDelegationSettingsOperations /// Thrown when a required parameter is null /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, PortalDelegationSettings parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the secret validation key of the DelegationSettings. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IIdentityProviderOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IIdentityProviderOperations.cs index 9c6d200fe20c..021090af3731 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IIdentityProviderOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IIdentityProviderOperations.cs @@ -142,7 +142,7 @@ public partial interface IIdentityProviderOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates an existing IdentityProvider configuration. /// @@ -209,6 +209,35 @@ public partial interface IIdentityProviderOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the client secret details of the Identity Provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identity Provider Type identifier. Possible values include: + /// 'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists a collection of Identity Provider configured in the specified /// service instance. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPropertyOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/INamedValueOperations.cs similarity index 51% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPropertyOperations.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/INamedValueOperations.cs index 17962e6db70c..b695f960bc37 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPropertyOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/INamedValueOperations.cs @@ -20,12 +20,13 @@ namespace Microsoft.Azure.Management.ApiManagement using System.Threading.Tasks; /// - /// PropertyOperations operations. + /// NamedValueOperations operations. /// - public partial interface IPropertyOperations + public partial interface INamedValueOperations { /// - /// Lists a collection of properties defined within a service instance. + /// Lists a collection of NamedValues defined within a service + /// instance. /// /// /// @@ -52,9 +53,9 @@ public partial interface IPropertyOperations /// /// Thrown when a required parameter is null /// - Task>> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the entity state (Etag) version of the property specified by + /// Gets the entity state (Etag) version of the NamedValue specified by /// its identifier. /// /// @@ -63,8 +64,8 @@ public partial interface IPropertyOperations /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// The headers that will be added to request. @@ -78,9 +79,9 @@ public partial interface IPropertyOperations /// /// Thrown when a required parameter is null /// - Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the details of the property specified by its identifier. + /// Gets the details of the NamedValue specified by its identifier. /// /// /// The name of the resource group. @@ -88,8 +89,8 @@ public partial interface IPropertyOperations /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// The headers that will be added to request. @@ -106,9 +107,9 @@ public partial interface IPropertyOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a property. + /// Creates or updates a NamedValue. /// /// /// The name of the resource group. @@ -116,8 +117,8 @@ public partial interface IPropertyOperations /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// Create parameters. @@ -141,9 +142,9 @@ public partial interface IPropertyOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, PropertyContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the specific property. + /// Updates the specific NamedValue. /// /// /// The name of the resource group. @@ -151,8 +152,8 @@ public partial interface IPropertyOperations /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// Update parameters. @@ -171,12 +172,74 @@ public partial interface IPropertyOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes specific NamedValue from the API Management service + /// instance. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from + /// the header response of the GET request or it should be * for + /// unconditional update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the secret value of the NamedValue. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, PropertyUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListValueWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes specific property from the API Management service instance. + /// Creates or updates a NamedValue. /// /// /// The name of the resource group. @@ -184,8 +247,46 @@ public partial interface IPropertyOperations /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. + /// + /// + /// Create parameters. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but + /// required when updating an entity. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the specific NamedValue. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. /// /// /// ETag of the Entity. ETag should match the current entity state from @@ -201,12 +302,16 @@ public partial interface IPropertyOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists a collection of properties defined within a service instance. + /// Lists a collection of NamedValues defined within a service + /// instance. /// /// /// @@ -227,6 +332,6 @@ public partial interface IPropertyOperations /// /// Thrown when a required parameter is null /// - Task>> ListByServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IOpenIdConnectProviderOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IOpenIdConnectProviderOperations.cs index 17aec5998271..90ed33ed8fd6 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IOpenIdConnectProviderOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IOpenIdConnectProviderOperations.cs @@ -206,6 +206,34 @@ public partial interface IOpenIdConnectProviderOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string opid, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the client secret details of the OpenID Connect Provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the OpenID Connect Provider. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string opid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists of all the OpenId Connect Providers. /// /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicySnippetOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicyDescriptionOperations.cs similarity index 78% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicySnippetOperations.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicyDescriptionOperations.cs index 85e4a3f200ae..c40cd8d614de 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicySnippetOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IPolicyDescriptionOperations.cs @@ -19,12 +19,12 @@ namespace Microsoft.Azure.Management.ApiManagement using System.Threading.Tasks; /// - /// PolicySnippetOperations operations. + /// PolicyDescriptionOperations operations. /// - public partial interface IPolicySnippetOperations + public partial interface IPolicyDescriptionOperations { /// - /// Lists all policy snippets. + /// Lists all policy descriptions. /// /// /// The name of the resource group. @@ -51,6 +51,6 @@ public partial interface IPolicySnippetOperations /// /// Thrown when a required parameter is null /// - Task> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ISubscriptionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ISubscriptionOperations.cs index e587fee3e4c3..e6bcee54fde4 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ISubscriptionOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ISubscriptionOperations.cs @@ -279,6 +279,35 @@ public partial interface ISubscriptionOperations /// Task RegenerateSecondaryKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, string sid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets the subscription keys. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Subscription entity Identifier. The entity represents the + /// association between a user and a product in API Management. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string sid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all subscriptions of the API Management service instance. /// /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessGitOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessGitOperations.cs index 6e72a416b0fd..9ebab93b6b56 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessGitOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessGitOperations.cs @@ -24,7 +24,7 @@ namespace Microsoft.Azure.Management.ApiManagement public partial interface ITenantAccessGitOperations { /// - /// Gets the Git access configuration for the tenant. + /// Gets the Git access configuration for the tenant. Without secrets. /// /// /// The name of the resource group. @@ -92,5 +92,30 @@ public partial interface ITenantAccessGitOperations /// Thrown when a required parameter is null /// Task RegenerateSecondaryKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the Git access configuration for the tenant. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessOperations.cs index 1779c4995d87..8b435ddc6dcc 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/ITenantAccessOperations.cs @@ -46,7 +46,7 @@ public partial interface ITenantAccessOperations /// Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get tenant access information details + /// Get tenant access information details without secrets. /// /// /// The name of the resource group. @@ -144,5 +144,30 @@ public partial interface ITenantAccessOperations /// Thrown when a required parameter is null /// Task RegenerateSecondaryKeyWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get tenant access information details. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperations.cs index aa8e2243206f..c259ba3a25dc 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperations.cs @@ -738,7 +738,7 @@ internal IdentityProviderOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1415,6 +1415,222 @@ internal IdentityProviderOperations(ApiManagementClient client) return _result; } + /// + /// Gets the client secret details of the Identity Provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identity Provider Type identifier. Possible values include: 'facebook', + /// 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string identityProviderName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (identityProviderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "identityProviderName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("identityProviderName", identityProviderName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{identityProviderName}", System.Uri.EscapeDataString(identityProviderName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + /// /// Lists a collection of Identity Provider configured in the specified service /// instance. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperationsExtensions.cs index 683fe0441804..e00fcf8085d6 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/IdentityProviderOperationsExtensions.cs @@ -188,7 +188,7 @@ public static IdentityProviderContract Get(this IIdentityProviderOperations oper /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// - public static IdentityProviderContract CreateOrUpdate(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderContract parameters, string ifMatch = default(string)) + public static IdentityProviderContract CreateOrUpdate(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderCreateContract parameters, string ifMatch = default(string)) { return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, identityProviderName, parameters, ifMatch).GetAwaiter().GetResult(); } @@ -219,7 +219,7 @@ public static IdentityProviderContract Get(this IIdentityProviderOperations oper /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName, IdentityProviderCreateContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, identityProviderName, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) { @@ -343,6 +343,54 @@ public static void Delete(this IIdentityProviderOperations operations, string re (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, identityProviderName, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the client secret details of the Identity Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identity Provider Type identifier. Possible values include: 'facebook', + /// 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + /// + public static ClientSecretContract ListSecrets(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName, identityProviderName).GetAwaiter().GetResult(); + } + + /// + /// Gets the client secret details of the Identity Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identity Provider Type identifier. Possible values include: 'facebook', + /// 'google', 'microsoft', 'twitter', 'aad', 'aadB2C' + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this IIdentityProviderOperations operations, string resourceGroupName, string serviceName, string identityProviderName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, identityProviderName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists a collection of Identity Provider configured in the specified service /// instance. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AccessInformationContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AccessInformationContract.cs index a95673ff3195..085f2cbb2760 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AccessInformationContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AccessInformationContract.cs @@ -30,8 +30,12 @@ public AccessInformationContract() /// Initializes a new instance of the AccessInformationContract class. /// /// Identifier. - /// Primary access key. - /// Secondary access key. + /// Primary access key. This property will not + /// be filled on 'GET' operations! Use '/listSecrets' POST request to + /// get the value. + /// Secondary access key. This property will + /// not be filled on 'GET' operations! Use '/listSecrets' POST request + /// to get the value. /// Determines whether direct access is /// enabled. public AccessInformationContract(string id = default(string), string primaryKey = default(string), string secondaryKey = default(string), bool? enabled = default(bool?)) @@ -55,13 +59,17 @@ public AccessInformationContract() public string Id { get; set; } /// - /// Gets or sets primary access key. + /// Gets or sets primary access key. This property will not be filled + /// on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. /// [JsonProperty(PropertyName = "primaryKey")] public string PrimaryKey { get; set; } /// - /// Gets or sets secondary access key. + /// Gets or sets secondary access key. This property will not be filled + /// on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. /// [JsonProperty(PropertyName = "secondaryKey")] public string SecondaryKey { get; set; } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AdditionalLocation.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AdditionalLocation.cs index 7fefcb4ade13..4aae1833f2b7 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AdditionalLocation.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AdditionalLocation.cs @@ -47,7 +47,10 @@ public AdditionalLocation() /// configuration for the location. /// Gateway URL of the API Management /// service in the Region. - public AdditionalLocation(string location, ApiManagementServiceSkuProperties sku, IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), string gatewayRegionalUrl = default(string)) + /// Property only valid for an Api + /// Management service deployed in multiple locations. This can be used + /// to disable the gateway in this additional location. + public AdditionalLocation(string location, ApiManagementServiceSkuProperties sku, IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), string gatewayRegionalUrl = default(string), bool? disableGateway = default(bool?)) { Location = location; Sku = sku; @@ -55,6 +58,7 @@ public AdditionalLocation() PrivateIPAddresses = privateIPAddresses; VirtualNetworkConfiguration = virtualNetworkConfiguration; GatewayRegionalUrl = gatewayRegionalUrl; + DisableGateway = disableGateway; CustomInit(); } @@ -105,6 +109,14 @@ public AdditionalLocation() [JsonProperty(PropertyName = "gatewayRegionalUrl")] public string GatewayRegionalUrl { get; private set; } + /// + /// Gets or sets property only valid for an Api Management service + /// deployed in multiple locations. This can be used to disable the + /// gateway in this additional location. + /// + [JsonProperty(PropertyName = "disableGateway")] + public bool? DisableGateway { get; set; } + /// /// Validate the object. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceBaseProperties.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceBaseProperties.cs index 25a9321bc86a..830d5e08d6f1 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceBaseProperties.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceBaseProperties.cs @@ -54,10 +54,10 @@ public ApiManagementServiceBaseProperties() /// Management service. /// Management API endpoint URL of the /// API Management service. - /// Developer Portal endpoint URL of - /// the API Management service. /// SCM endpoint URL of the API Management /// service. + /// DEveloper Portal endpoint URL of + /// the API Management service. /// Custom hostname configuration /// of the API Management service. /// Public Static Load Balanced IP @@ -105,7 +105,10 @@ public ApiManagementServiceBaseProperties() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// List of Certificates that need to be /// installed in the API Management service. Max supported certificates /// that can be installed is 10. @@ -114,6 +117,9 @@ public ApiManagementServiceBaseProperties() /// certificate to be presented on each request to the gateway. This /// also enables the ability to authenticate the certificate in the /// policy on the gateway. + /// Property only valid for an Api + /// Management service deployed in multiple locations. This can be used + /// to disable the gateway in master region. /// The type of VPN in which API /// Management service needs to be configured in. None (Default Value) /// means the API Management service is not part of any Virtual @@ -122,7 +128,9 @@ public ApiManagementServiceBaseProperties() /// Internal means that API Management deployment is setup inside a /// Virtual Network having an Intranet Facing Endpoint only. Possible /// values include: 'None', 'External', 'Internal' - public ApiManagementServiceBaseProperties(string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string developerPortalUrl = default(string), string scmUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), string virtualNetworkType = default(string)) + /// Control Plane Apis version + /// constraint for the API Management service. + public ApiManagementServiceBaseProperties(string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string scmUrl = default(string), string developerPortalUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), bool? disableGateway = default(bool?), string virtualNetworkType = default(string), ApiVersionConstraint apiVersionConstraint = default(ApiVersionConstraint)) { NotificationSenderEmail = notificationSenderEmail; ProvisioningState = provisioningState; @@ -132,8 +140,8 @@ public ApiManagementServiceBaseProperties() GatewayRegionalUrl = gatewayRegionalUrl; PortalUrl = portalUrl; ManagementApiUrl = managementApiUrl; - DeveloperPortalUrl = developerPortalUrl; ScmUrl = scmUrl; + DeveloperPortalUrl = developerPortalUrl; HostnameConfigurations = hostnameConfigurations; PublicIPAddresses = publicIPAddresses; PrivateIPAddresses = privateIPAddresses; @@ -142,7 +150,9 @@ public ApiManagementServiceBaseProperties() CustomProperties = customProperties; Certificates = certificates; EnableClientCertificate = enableClientCertificate; + DisableGateway = disableGateway; VirtualNetworkType = virtualNetworkType; + ApiVersionConstraint = apiVersionConstraint; CustomInit(); } @@ -206,18 +216,18 @@ public ApiManagementServiceBaseProperties() [JsonProperty(PropertyName = "managementApiUrl")] public string ManagementApiUrl { get; private set; } - /// - /// Gets developer Portal endpoint URL of the API Management service. - /// - [JsonProperty(PropertyName = "developerPortalUrl")] - public string DeveloperPortalUrl { get; private set; } - /// /// Gets SCM endpoint URL of the API Management service. /// [JsonProperty(PropertyName = "scmUrl")] public string ScmUrl { get; private set; } + /// + /// Gets dEveloper Portal endpoint URL of the API Management service. + /// + [JsonProperty(PropertyName = "developerPortalUrl")] + public string DeveloperPortalUrl { get; private set; } + /// /// Gets or sets custom hostname configuration of the API Management /// service. @@ -291,7 +301,10 @@ public ApiManagementServiceBaseProperties() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// [JsonProperty(PropertyName = "customProperties")] public IDictionary CustomProperties { get; set; } @@ -313,6 +326,14 @@ public ApiManagementServiceBaseProperties() [JsonProperty(PropertyName = "enableClientCertificate")] public bool? EnableClientCertificate { get; set; } + /// + /// Gets or sets property only valid for an Api Management service + /// deployed in multiple locations. This can be used to disable the + /// gateway in master region. + /// + [JsonProperty(PropertyName = "disableGateway")] + public bool? DisableGateway { get; set; } + /// /// Gets or sets the type of VPN in which API Management service needs /// to be configured in. None (Default Value) means the API Management @@ -326,6 +347,13 @@ public ApiManagementServiceBaseProperties() [JsonProperty(PropertyName = "virtualNetworkType")] public string VirtualNetworkType { get; set; } + /// + /// Gets or sets control Plane Apis version constraint for the API + /// Management service. + /// + [JsonProperty(PropertyName = "apiVersionConstraint")] + public ApiVersionConstraint ApiVersionConstraint { get; set; } + /// /// Validate the object. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceIdentity.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceIdentity.cs index 8e4c937c9f53..c6ca43806fdf 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceIdentity.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceIdentity.cs @@ -10,7 +10,10 @@ namespace Microsoft.Azure.Management.ApiManagement.Models { + using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -31,28 +34,45 @@ public ApiManagementServiceIdentity() /// Initializes a new instance of the ApiManagementServiceIdentity /// class. /// + /// The type of identity used for the resource. The + /// type 'SystemAssigned, UserAssigned' includes both an implicitly + /// created identity and a set of user assigned identities. The type + /// 'None' will remove any identities from the service. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' /// The principal id of the identity. /// The client tenant id of the /// identity. - public ApiManagementServiceIdentity(System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?)) + /// The list of user identities + /// associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public ApiManagementServiceIdentity(string type, System.Guid? principalId = default(System.Guid?), System.Guid? tenantId = default(System.Guid?), IDictionary userAssignedIdentities = default(IDictionary)) { + Type = type; PrincipalId = principalId; TenantId = tenantId; + UserAssignedIdentities = userAssignedIdentities; CustomInit(); } - /// - /// Static constructor for ApiManagementServiceIdentity class. - /// - static ApiManagementServiceIdentity() - { - Type = "SystemAssigned"; - } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// + /// Gets or sets the type of identity used for the resource. The type + /// 'SystemAssigned, UserAssigned' includes both an implicitly created + /// identity and a set of user assigned identities. The type 'None' + /// will remove any identities from the service. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, + /// UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + /// /// Gets the principal id of the identity. /// @@ -66,11 +86,27 @@ static ApiManagementServiceIdentity() public System.Guid? TenantId { get; private set; } /// - /// The identity type. Currently the only supported type is - /// 'SystemAssigned'. + /// Gets or sets the list of user identities associated with the + /// resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - [JsonProperty(PropertyName = "type")] - public static string Type { get; private set; } + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceResource.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceResource.cs index f86061a77689..9b12d219a0d8 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceResource.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceResource.cs @@ -66,10 +66,10 @@ public ApiManagementServiceResource() /// Management service. /// Management API endpoint URL of the /// API Management service. - /// Developer Portal endpoint URL of - /// the API Management service. /// SCM endpoint URL of the API Management /// service. + /// DEveloper Portal endpoint URL of + /// the API Management service. /// Custom hostname configuration /// of the API Management service. /// Public Static Load Balanced IP @@ -117,7 +117,10 @@ public ApiManagementServiceResource() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// List of Certificates that need to be /// installed in the API Management service. Max supported certificates /// that can be installed is 10. @@ -126,6 +129,9 @@ public ApiManagementServiceResource() /// certificate to be presented on each request to the gateway. This /// also enables the ability to authenticate the certificate in the /// policy on the gateway. + /// Property only valid for an Api + /// Management service deployed in multiple locations. This can be used + /// to disable the gateway in master region. /// The type of VPN in which API /// Management service needs to be configured in. None (Default Value) /// means the API Management service is not part of any Virtual @@ -134,10 +140,12 @@ public ApiManagementServiceResource() /// Internal means that API Management deployment is setup inside a /// Virtual Network having an Intranet Facing Endpoint only. Possible /// values include: 'None', 'External', 'Internal' + /// Control Plane Apis version + /// constraint for the API Management service. /// Managed service identity of the Api /// Management service. /// ETag of the resource. - public ApiManagementServiceResource(string publisherEmail, string publisherName, ApiManagementServiceSkuProperties sku, string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string developerPortalUrl = default(string), string scmUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), string virtualNetworkType = default(string), ApiManagementServiceIdentity identity = default(ApiManagementServiceIdentity), string etag = default(string)) + public ApiManagementServiceResource(string publisherEmail, string publisherName, ApiManagementServiceSkuProperties sku, string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string scmUrl = default(string), string developerPortalUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), bool? disableGateway = default(bool?), string virtualNetworkType = default(string), ApiVersionConstraint apiVersionConstraint = default(ApiVersionConstraint), ApiManagementServiceIdentity identity = default(ApiManagementServiceIdentity), string etag = default(string)) : base(id, name, type, tags) { NotificationSenderEmail = notificationSenderEmail; @@ -148,8 +156,8 @@ public ApiManagementServiceResource() GatewayRegionalUrl = gatewayRegionalUrl; PortalUrl = portalUrl; ManagementApiUrl = managementApiUrl; - DeveloperPortalUrl = developerPortalUrl; ScmUrl = scmUrl; + DeveloperPortalUrl = developerPortalUrl; HostnameConfigurations = hostnameConfigurations; PublicIPAddresses = publicIPAddresses; PrivateIPAddresses = privateIPAddresses; @@ -158,7 +166,9 @@ public ApiManagementServiceResource() CustomProperties = customProperties; Certificates = certificates; EnableClientCertificate = enableClientCertificate; + DisableGateway = disableGateway; VirtualNetworkType = virtualNetworkType; + ApiVersionConstraint = apiVersionConstraint; PublisherEmail = publisherEmail; PublisherName = publisherName; Sku = sku; @@ -228,18 +238,18 @@ public ApiManagementServiceResource() [JsonProperty(PropertyName = "properties.managementApiUrl")] public string ManagementApiUrl { get; private set; } - /// - /// Gets developer Portal endpoint URL of the API Management service. - /// - [JsonProperty(PropertyName = "properties.developerPortalUrl")] - public string DeveloperPortalUrl { get; private set; } - /// /// Gets SCM endpoint URL of the API Management service. /// [JsonProperty(PropertyName = "properties.scmUrl")] public string ScmUrl { get; private set; } + /// + /// Gets dEveloper Portal endpoint URL of the API Management service. + /// + [JsonProperty(PropertyName = "properties.developerPortalUrl")] + public string DeveloperPortalUrl { get; private set; } + /// /// Gets or sets custom hostname configuration of the API Management /// service. @@ -313,7 +323,10 @@ public ApiManagementServiceResource() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// [JsonProperty(PropertyName = "properties.customProperties")] public IDictionary CustomProperties { get; set; } @@ -335,6 +348,14 @@ public ApiManagementServiceResource() [JsonProperty(PropertyName = "properties.enableClientCertificate")] public bool? EnableClientCertificate { get; set; } + /// + /// Gets or sets property only valid for an Api Management service + /// deployed in multiple locations. This can be used to disable the + /// gateway in master region. + /// + [JsonProperty(PropertyName = "properties.disableGateway")] + public bool? DisableGateway { get; set; } + /// /// Gets or sets the type of VPN in which API Management service needs /// to be configured in. None (Default Value) means the API Management @@ -348,6 +369,13 @@ public ApiManagementServiceResource() [JsonProperty(PropertyName = "properties.virtualNetworkType")] public string VirtualNetworkType { get; set; } + /// + /// Gets or sets control Plane Apis version constraint for the API + /// Management service. + /// + [JsonProperty(PropertyName = "properties.apiVersionConstraint")] + public ApiVersionConstraint ApiVersionConstraint { get; set; } + /// /// Gets or sets publisher email. /// @@ -468,6 +496,10 @@ public virtual void Validate() { Sku.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceUpdateParameters.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceUpdateParameters.cs index a291ec81d9f4..304aafebf96e 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceUpdateParameters.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiManagementServiceUpdateParameters.cs @@ -61,10 +61,10 @@ public ApiManagementServiceUpdateParameters() /// Management service. /// Management API endpoint URL of the /// API Management service. - /// Developer Portal endpoint URL of - /// the API Management service. /// SCM endpoint URL of the API Management /// service. + /// DEveloper Portal endpoint URL of + /// the API Management service. /// Custom hostname configuration /// of the API Management service. /// Public Static Load Balanced IP @@ -112,7 +112,10 @@ public ApiManagementServiceUpdateParameters() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// List of Certificates that need to be /// installed in the API Management service. Max supported certificates /// that can be installed is 10. @@ -121,6 +124,9 @@ public ApiManagementServiceUpdateParameters() /// certificate to be presented on each request to the gateway. This /// also enables the ability to authenticate the certificate in the /// policy on the gateway. + /// Property only valid for an Api + /// Management service deployed in multiple locations. This can be used + /// to disable the gateway in master region. /// The type of VPN in which API /// Management service needs to be configured in. None (Default Value) /// means the API Management service is not part of any Virtual @@ -129,6 +135,8 @@ public ApiManagementServiceUpdateParameters() /// Internal means that API Management deployment is setup inside a /// Virtual Network having an Intranet Facing Endpoint only. Possible /// values include: 'None', 'External', 'Internal' + /// Control Plane Apis version + /// constraint for the API Management service. /// Publisher email. /// Publisher name. /// SKU properties of the API Management @@ -136,7 +144,7 @@ public ApiManagementServiceUpdateParameters() /// Managed service identity of the Api /// Management service. /// ETag of the resource. - public ApiManagementServiceUpdateParameters(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string developerPortalUrl = default(string), string scmUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), string virtualNetworkType = default(string), string publisherEmail = default(string), string publisherName = default(string), ApiManagementServiceSkuProperties sku = default(ApiManagementServiceSkuProperties), ApiManagementServiceIdentity identity = default(ApiManagementServiceIdentity), string etag = default(string)) + public ApiManagementServiceUpdateParameters(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string notificationSenderEmail = default(string), string provisioningState = default(string), string targetProvisioningState = default(string), System.DateTime? createdAtUtc = default(System.DateTime?), string gatewayUrl = default(string), string gatewayRegionalUrl = default(string), string portalUrl = default(string), string managementApiUrl = default(string), string scmUrl = default(string), string developerPortalUrl = default(string), IList hostnameConfigurations = default(IList), IList publicIPAddresses = default(IList), IList privateIPAddresses = default(IList), VirtualNetworkConfiguration virtualNetworkConfiguration = default(VirtualNetworkConfiguration), IList additionalLocations = default(IList), IDictionary customProperties = default(IDictionary), IList certificates = default(IList), bool? enableClientCertificate = default(bool?), bool? disableGateway = default(bool?), string virtualNetworkType = default(string), ApiVersionConstraint apiVersionConstraint = default(ApiVersionConstraint), string publisherEmail = default(string), string publisherName = default(string), ApiManagementServiceSkuProperties sku = default(ApiManagementServiceSkuProperties), ApiManagementServiceIdentity identity = default(ApiManagementServiceIdentity), string etag = default(string)) : base(id, name, type, tags) { NotificationSenderEmail = notificationSenderEmail; @@ -147,8 +155,8 @@ public ApiManagementServiceUpdateParameters() GatewayRegionalUrl = gatewayRegionalUrl; PortalUrl = portalUrl; ManagementApiUrl = managementApiUrl; - DeveloperPortalUrl = developerPortalUrl; ScmUrl = scmUrl; + DeveloperPortalUrl = developerPortalUrl; HostnameConfigurations = hostnameConfigurations; PublicIPAddresses = publicIPAddresses; PrivateIPAddresses = privateIPAddresses; @@ -157,7 +165,9 @@ public ApiManagementServiceUpdateParameters() CustomProperties = customProperties; Certificates = certificates; EnableClientCertificate = enableClientCertificate; + DisableGateway = disableGateway; VirtualNetworkType = virtualNetworkType; + ApiVersionConstraint = apiVersionConstraint; PublisherEmail = publisherEmail; PublisherName = publisherName; Sku = sku; @@ -226,18 +236,18 @@ public ApiManagementServiceUpdateParameters() [JsonProperty(PropertyName = "properties.managementApiUrl")] public string ManagementApiUrl { get; private set; } - /// - /// Gets developer Portal endpoint URL of the API Management service. - /// - [JsonProperty(PropertyName = "properties.developerPortalUrl")] - public string DeveloperPortalUrl { get; private set; } - /// /// Gets SCM endpoint URL of the API Management service. /// [JsonProperty(PropertyName = "properties.scmUrl")] public string ScmUrl { get; private set; } + /// + /// Gets dEveloper Portal endpoint URL of the API Management service. + /// + [JsonProperty(PropertyName = "properties.developerPortalUrl")] + public string DeveloperPortalUrl { get; private set; } + /// /// Gets or sets custom hostname configuration of the API Management /// service. @@ -311,7 +321,10 @@ public ApiManagementServiceUpdateParameters() /// TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, /// TLS_RSA_WITH_AES_128_CBC_SHA. For example, /// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. - /// The default value is `true` for them. + /// The default value is `true` for them. Note: next ciphers can't be + /// disabled since they are required by Azure CloudService internal + /// components: + /// TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 /// [JsonProperty(PropertyName = "properties.customProperties")] public IDictionary CustomProperties { get; set; } @@ -333,6 +346,14 @@ public ApiManagementServiceUpdateParameters() [JsonProperty(PropertyName = "properties.enableClientCertificate")] public bool? EnableClientCertificate { get; set; } + /// + /// Gets or sets property only valid for an Api Management service + /// deployed in multiple locations. This can be used to disable the + /// gateway in master region. + /// + [JsonProperty(PropertyName = "properties.disableGateway")] + public bool? DisableGateway { get; set; } + /// /// Gets or sets the type of VPN in which API Management service needs /// to be configured in. None (Default Value) means the API Management @@ -346,6 +367,13 @@ public ApiManagementServiceUpdateParameters() [JsonProperty(PropertyName = "properties.virtualNetworkType")] public string VirtualNetworkType { get; set; } + /// + /// Gets or sets control Plane Apis version constraint for the API + /// Management service. + /// + [JsonProperty(PropertyName = "properties.apiVersionConstraint")] + public ApiVersionConstraint ApiVersionConstraint { get; set; } + /// /// Gets or sets publisher email. /// @@ -444,6 +472,10 @@ public virtual void Validate() { Sku.Validate(); } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiVersionConstraint.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiVersionConstraint.cs new file mode 100644 index 000000000000..0f8af853b083 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApiVersionConstraint.cs @@ -0,0 +1,54 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Control Plane Apis version constraint for the API Management service. + /// + public partial class ApiVersionConstraint + { + /// + /// Initializes a new instance of the ApiVersionConstraint class. + /// + public ApiVersionConstraint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiVersionConstraint class. + /// + /// Limit control plane API calls to API + /// Management service with version equal to or newer than this + /// value. + public ApiVersionConstraint(string minApiVersion = default(string)) + { + MinApiVersion = minApiVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets limit control plane API calls to API Management + /// service with version equal to or newer than this value. + /// + [JsonProperty(PropertyName = "minApiVersion")] + public string MinApiVersion { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApimIdentityType.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApimIdentityType.cs new file mode 100644 index 000000000000..e2ec9cc913e1 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ApimIdentityType.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.ApiManagement.Models +{ + + /// + /// Defines values for ApimIdentityType. + /// + public static class ApimIdentityType + { + public const string SystemAssigned = "SystemAssigned"; + public const string UserAssigned = "UserAssigned"; + public const string SystemAssignedUserAssigned = "SystemAssigned, UserAssigned"; + public const string None = "None"; + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContract.cs index 586432abdbbd..f239f764153e 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContract.cs @@ -79,15 +79,17 @@ public AuthorizationServerContract() /// values. /// Specifies the mechanism by /// which access token is passed to the API. - /// Client or app secret registered with - /// this authorization server. /// Can be optionally specified /// when resource owner password grant type is supported by this /// authorization server. Default resource owner username. /// Can be optionally specified /// when resource owner password grant type is supported by this /// authorization server. Default resource owner password. - public AuthorizationServerContract(string displayName, string clientRegistrationEndpoint, string authorizationEndpoint, IList grantTypes, string clientId, string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string clientSecret = default(string), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string)) + /// Client or app secret registered with + /// this authorization server. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + public AuthorizationServerContract(string displayName, string clientRegistrationEndpoint, string authorizationEndpoint, IList grantTypes, string clientId, string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string), string clientSecret = default(string)) : base(id, name, type) { Description = description; @@ -98,7 +100,6 @@ public AuthorizationServerContract() SupportState = supportState; DefaultScope = defaultScope; BearerTokenSendingMethods = bearerTokenSendingMethods; - ClientSecret = clientSecret; ResourceOwnerUsername = resourceOwnerUsername; ResourceOwnerPassword = resourceOwnerPassword; DisplayName = displayName; @@ -106,6 +107,7 @@ public AuthorizationServerContract() AuthorizationEndpoint = authorizationEndpoint; GrantTypes = grantTypes; ClientId = clientId; + ClientSecret = clientSecret; CustomInit(); } @@ -177,13 +179,6 @@ public AuthorizationServerContract() [JsonProperty(PropertyName = "properties.bearerTokenSendingMethods")] public IList BearerTokenSendingMethods { get; set; } - /// - /// Gets or sets client or app secret registered with this - /// authorization server. - /// - [JsonProperty(PropertyName = "properties.clientSecret")] - public string ClientSecret { get; set; } - /// /// Gets or sets can be optionally specified when resource owner /// password grant type is supported by this authorization server. @@ -235,6 +230,14 @@ public AuthorizationServerContract() [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } + /// + /// Gets or sets client or app secret registered with this + /// authorization server. This property will not be filled on 'GET' + /// operations! Use '/listSecrets' POST request to get the value. + /// + [JsonProperty(PropertyName = "properties.clientSecret")] + public string ClientSecret { get; set; } + /// /// Validate the object. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContractBaseProperties.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContractBaseProperties.cs index b5fd7b6d54fa..063f69c9aef7 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContractBaseProperties.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerContractBaseProperties.cs @@ -60,15 +60,13 @@ public AuthorizationServerContractBaseProperties() /// values. /// Specifies the mechanism by /// which access token is passed to the API. - /// Client or app secret registered with - /// this authorization server. /// Can be optionally specified /// when resource owner password grant type is supported by this /// authorization server. Default resource owner username. /// Can be optionally specified /// when resource owner password grant type is supported by this /// authorization server. Default resource owner password. - public AuthorizationServerContractBaseProperties(string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string clientSecret = default(string), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string)) + public AuthorizationServerContractBaseProperties(string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string)) { Description = description; AuthorizationMethods = authorizationMethods; @@ -78,7 +76,6 @@ public AuthorizationServerContractBaseProperties() SupportState = supportState; DefaultScope = defaultScope; BearerTokenSendingMethods = bearerTokenSendingMethods; - ClientSecret = clientSecret; ResourceOwnerUsername = resourceOwnerUsername; ResourceOwnerPassword = resourceOwnerPassword; CustomInit(); @@ -152,13 +149,6 @@ public AuthorizationServerContractBaseProperties() [JsonProperty(PropertyName = "bearerTokenSendingMethods")] public IList BearerTokenSendingMethods { get; set; } - /// - /// Gets or sets client or app secret registered with this - /// authorization server. - /// - [JsonProperty(PropertyName = "clientSecret")] - public string ClientSecret { get; set; } - /// /// Gets or sets can be optionally specified when resource owner /// password grant type is supported by this authorization server. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerUpdateContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerUpdateContract.cs index 0fb38379c3e8..6ccf6044d68d 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerUpdateContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/AuthorizationServerUpdateContract.cs @@ -67,8 +67,6 @@ public AuthorizationServerUpdateContract() /// values. /// Specifies the mechanism by /// which access token is passed to the API. - /// Client or app secret registered with - /// this authorization server. /// Can be optionally specified /// when resource owner password grant type is supported by this /// authorization server. Default resource owner username. @@ -87,7 +85,11 @@ public AuthorizationServerUpdateContract() /// client uses to request the access token. /// Client or app id registered with this /// authorization server. - public AuthorizationServerUpdateContract(string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string clientSecret = default(string), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string), string displayName = default(string), string clientRegistrationEndpoint = default(string), string authorizationEndpoint = default(string), IList grantTypes = default(IList), string clientId = default(string)) + /// Client or app secret registered with + /// this authorization server. This property will not be filled on + /// 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + public AuthorizationServerUpdateContract(string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList authorizationMethods = default(IList), IList clientAuthenticationMethod = default(IList), IList tokenBodyParameters = default(IList), string tokenEndpoint = default(string), bool? supportState = default(bool?), string defaultScope = default(string), IList bearerTokenSendingMethods = default(IList), string resourceOwnerUsername = default(string), string resourceOwnerPassword = default(string), string displayName = default(string), string clientRegistrationEndpoint = default(string), string authorizationEndpoint = default(string), IList grantTypes = default(IList), string clientId = default(string), string clientSecret = default(string)) : base(id, name, type) { Description = description; @@ -98,7 +100,6 @@ public AuthorizationServerUpdateContract() SupportState = supportState; DefaultScope = defaultScope; BearerTokenSendingMethods = bearerTokenSendingMethods; - ClientSecret = clientSecret; ResourceOwnerUsername = resourceOwnerUsername; ResourceOwnerPassword = resourceOwnerPassword; DisplayName = displayName; @@ -106,6 +107,7 @@ public AuthorizationServerUpdateContract() AuthorizationEndpoint = authorizationEndpoint; GrantTypes = grantTypes; ClientId = clientId; + ClientSecret = clientSecret; CustomInit(); } @@ -177,13 +179,6 @@ public AuthorizationServerUpdateContract() [JsonProperty(PropertyName = "properties.bearerTokenSendingMethods")] public IList BearerTokenSendingMethods { get; set; } - /// - /// Gets or sets client or app secret registered with this - /// authorization server. - /// - [JsonProperty(PropertyName = "properties.clientSecret")] - public string ClientSecret { get; set; } - /// /// Gets or sets can be optionally specified when resource owner /// password grant type is supported by this authorization server. @@ -235,6 +230,14 @@ public AuthorizationServerUpdateContract() [JsonProperty(PropertyName = "properties.clientId")] public string ClientId { get; set; } + /// + /// Gets or sets client or app secret registered with this + /// authorization server. This property will not be filled on 'GET' + /// operations! Use '/listSecrets' POST request to get the value. + /// + [JsonProperty(PropertyName = "properties.clientSecret")] + public string ClientSecret { get; set; } + /// /// Validate the object. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ClientSecretContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ClientSecretContract.cs new file mode 100644 index 000000000000..ae8019aa75e5 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/ClientSecretContract.cs @@ -0,0 +1,53 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + /// + public partial class ClientSecretContract + { + /// + /// Initializes a new instance of the ClientSecretContract class. + /// + public ClientSecretContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientSecretContract class. + /// + /// Client or app secret used in + /// IdentityProviders, Aad, OpenID or OAuth. + public ClientSecretContract(string clientSecret = default(string)) + { + ClientSecret = clientSecret; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets client or app secret used in IdentityProviders, Aad, + /// OpenID or OAuth. + /// + [JsonProperty(PropertyName = "clientSecret")] + public string ClientSecret { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/DiagnosticContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/DiagnosticContract.cs index 082e6a043ed2..e22df586e42d 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/DiagnosticContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/DiagnosticContract.cs @@ -45,17 +45,15 @@ public DiagnosticContract() /// HTTP messages to the Gateway. /// Diagnostic settings for incoming/outgoing /// HTTP messages to the Backend - /// Whether to process - /// Correlation Headers coming to Api Management Service. Only - /// applicable to Application Insights diagnostics. Default is - /// true. + /// Log the ClientIP. Default is + /// false. /// Sets correlation protocol to /// use for Application Insights diagnostics. Possible values include: /// 'None', 'Legacy', 'W3C' /// The verbosity level applied to traces /// emitted by trace policies. Possible values include: 'verbose', /// 'information', 'error' - public DiagnosticContract(string loggerId, string id = default(string), string name = default(string), string type = default(string), string alwaysLog = default(string), SamplingSettings sampling = default(SamplingSettings), PipelineDiagnosticSettings frontend = default(PipelineDiagnosticSettings), PipelineDiagnosticSettings backend = default(PipelineDiagnosticSettings), bool? enableHttpCorrelationHeaders = default(bool?), string httpCorrelationProtocol = default(string), string verbosity = default(string)) + public DiagnosticContract(string loggerId, string id = default(string), string name = default(string), string type = default(string), string alwaysLog = default(string), SamplingSettings sampling = default(SamplingSettings), PipelineDiagnosticSettings frontend = default(PipelineDiagnosticSettings), PipelineDiagnosticSettings backend = default(PipelineDiagnosticSettings), bool? logClientIp = default(bool?), string httpCorrelationProtocol = default(string), string verbosity = default(string)) : base(id, name, type) { AlwaysLog = alwaysLog; @@ -63,7 +61,7 @@ public DiagnosticContract() Sampling = sampling; Frontend = frontend; Backend = backend; - EnableHttpCorrelationHeaders = enableHttpCorrelationHeaders; + LogClientIp = logClientIp; HttpCorrelationProtocol = httpCorrelationProtocol; Verbosity = verbosity; CustomInit(); @@ -108,12 +106,10 @@ public DiagnosticContract() public PipelineDiagnosticSettings Backend { get; set; } /// - /// Gets or sets whether to process Correlation Headers coming to Api - /// Management Service. Only applicable to Application Insights - /// diagnostics. Default is true. + /// Gets or sets log the ClientIP. Default is false. /// - [JsonProperty(PropertyName = "properties.enableHttpCorrelationHeaders")] - public bool? EnableHttpCorrelationHeaders { get; set; } + [JsonProperty(PropertyName = "properties.logClientIp")] + public bool? LogClientIp { get; set; } /// /// Gets or sets sets correlation protocol to use for Application diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderContract.cs index 652da992ef5b..8adc8501aed4 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderContract.cs @@ -37,10 +37,6 @@ public IdentityProviderContract() /// Client Id of the Application in the external /// Identity Provider. It is App ID for Facebook login, Client ID for /// Google login, App ID for Microsoft. - /// Client secret of the Application in - /// external Identity Provider, used to authenticate login request. For - /// example, it is App Secret for Facebook login, API Key for Google - /// login, Public Key for Microsoft. /// Resource ID. /// Resource name. /// Resource type for API Management @@ -62,7 +58,13 @@ public IdentityProviderContract() /// Only applies to AAD B2C Identity Provider. /// Password Reset Policy Name. /// Only applies to AAD B2C Identity Provider. - public IdentityProviderContract(string clientId, string clientSecret, string id = default(string), string name = default(string), string type = default(string), string identityProviderContractType = default(string), string signinTenant = default(string), IList allowedTenants = default(IList), string authority = default(string), string signupPolicyName = default(string), string signinPolicyName = default(string), string profileEditingPolicyName = default(string), string passwordResetPolicyName = default(string)) + /// Client secret of the Application in + /// external Identity Provider, used to authenticate login request. For + /// example, it is App Secret for Facebook login, API Key for Google + /// login, Public Key for Microsoft. This property will not be filled + /// on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + public IdentityProviderContract(string clientId, string id = default(string), string name = default(string), string type = default(string), string identityProviderContractType = default(string), string signinTenant = default(string), IList allowedTenants = default(IList), string authority = default(string), string signupPolicyName = default(string), string signinPolicyName = default(string), string profileEditingPolicyName = default(string), string passwordResetPolicyName = default(string), string clientSecret = default(string)) : base(id, name, type) { IdentityProviderContractType = identityProviderContractType; @@ -152,7 +154,8 @@ public IdentityProviderContract() /// Gets or sets client secret of the Application in external Identity /// Provider, used to authenticate login request. For example, it is /// App Secret for Facebook login, API Key for Google login, Public Key - /// for Microsoft. + /// for Microsoft. This property will not be filled on 'GET' + /// operations! Use '/listSecrets' POST request to get the value. /// [JsonProperty(PropertyName = "properties.clientSecret")] public string ClientSecret { get; set; } @@ -169,10 +172,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); } - if (ClientSecret == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ClientSecret"); - } if (AllowedTenants != null) { if (AllowedTenants.Count > 32) diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderCreateContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderCreateContract.cs new file mode 100644 index 000000000000..521ca44c16c4 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/IdentityProviderCreateContract.cs @@ -0,0 +1,232 @@ +// +// 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.ApiManagement.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity Provider details. + /// + [Rest.Serialization.JsonTransformation] + public partial class IdentityProviderCreateContract : Resource + { + /// + /// Initializes a new instance of the IdentityProviderCreateContract + /// class. + /// + public IdentityProviderCreateContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IdentityProviderCreateContract + /// class. + /// + /// Client Id of the Application in the external + /// Identity Provider. It is App ID for Facebook login, Client ID for + /// Google login, App ID for Microsoft. + /// Client secret of the Application in + /// external Identity Provider, used to authenticate login request. For + /// example, it is App Secret for Facebook login, API Key for Google + /// login, Public Key for Microsoft. This property will not be filled + /// on 'GET' operations! Use '/listSecrets' POST request to get the + /// value. + /// Resource ID. + /// Resource name. + /// Resource type for API Management + /// resource. + /// Identity Provider + /// Type identifier. Possible values include: 'facebook', 'google', + /// 'microsoft', 'twitter', 'aad', 'aadB2C' + /// The TenantId to use instead of Common + /// when logging into Active Directory + /// List of Allowed Tenants when + /// configuring Azure Active Directory login. + /// OpenID Connect discovery endpoint hostname + /// for AAD or AAD B2C. + /// Signup Policy Name. Only applies to + /// AAD B2C Identity Provider. + /// Signin Policy Name. Only applies to + /// AAD B2C Identity Provider. + /// Profile Editing Policy Name. + /// Only applies to AAD B2C Identity Provider. + /// Password Reset Policy Name. + /// Only applies to AAD B2C Identity Provider. + public IdentityProviderCreateContract(string clientId, string clientSecret, string id = default(string), string name = default(string), string type = default(string), string identityProviderCreateContractType = default(string), string signinTenant = default(string), IList allowedTenants = default(IList), string authority = default(string), string signupPolicyName = default(string), string signinPolicyName = default(string), string profileEditingPolicyName = default(string), string passwordResetPolicyName = default(string)) + : base(id, name, type) + { + IdentityProviderCreateContractType = identityProviderCreateContractType; + SigninTenant = signinTenant; + AllowedTenants = allowedTenants; + Authority = authority; + SignupPolicyName = signupPolicyName; + SigninPolicyName = signinPolicyName; + ProfileEditingPolicyName = profileEditingPolicyName; + PasswordResetPolicyName = passwordResetPolicyName; + ClientId = clientId; + ClientSecret = clientSecret; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets identity Provider Type identifier. Possible values + /// include: 'facebook', 'google', 'microsoft', 'twitter', 'aad', + /// 'aadB2C' + /// + [JsonProperty(PropertyName = "properties.type")] + public string IdentityProviderCreateContractType { get; set; } + + /// + /// Gets or sets the TenantId to use instead of Common when logging + /// into Active Directory + /// + [JsonProperty(PropertyName = "properties.signinTenant")] + public string SigninTenant { get; set; } + + /// + /// Gets or sets list of Allowed Tenants when configuring Azure Active + /// Directory login. + /// + [JsonProperty(PropertyName = "properties.allowedTenants")] + public IList AllowedTenants { get; set; } + + /// + /// Gets or sets openID Connect discovery endpoint hostname for AAD or + /// AAD B2C. + /// + [JsonProperty(PropertyName = "properties.authority")] + public string Authority { get; set; } + + /// + /// Gets or sets signup Policy Name. Only applies to AAD B2C Identity + /// Provider. + /// + [JsonProperty(PropertyName = "properties.signupPolicyName")] + public string SignupPolicyName { get; set; } + + /// + /// Gets or sets signin Policy Name. Only applies to AAD B2C Identity + /// Provider. + /// + [JsonProperty(PropertyName = "properties.signinPolicyName")] + public string SigninPolicyName { get; set; } + + /// + /// Gets or sets profile Editing Policy Name. Only applies to AAD B2C + /// Identity Provider. + /// + [JsonProperty(PropertyName = "properties.profileEditingPolicyName")] + public string ProfileEditingPolicyName { get; set; } + + /// + /// Gets or sets password Reset Policy Name. Only applies to AAD B2C + /// Identity Provider. + /// + [JsonProperty(PropertyName = "properties.passwordResetPolicyName")] + public string PasswordResetPolicyName { get; set; } + + /// + /// Gets or sets client Id of the Application in the external Identity + /// Provider. It is App ID for Facebook login, Client ID for Google + /// login, App ID for Microsoft. + /// + [JsonProperty(PropertyName = "properties.clientId")] + public string ClientId { get; set; } + + /// + /// Gets or sets client secret of the Application in external Identity + /// Provider, used to authenticate login request. For example, it is + /// App Secret for Facebook login, API Key for Google login, Public Key + /// for Microsoft. This property will not be filled on 'GET' + /// operations! Use '/listSecrets' POST request to get the value. + /// + [JsonProperty(PropertyName = "properties.clientSecret")] + public string ClientSecret { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ClientId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientId"); + } + if (ClientSecret == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ClientSecret"); + } + if (AllowedTenants != null) + { + if (AllowedTenants.Count > 32) + { + throw new ValidationException(ValidationRules.MaxItems, "AllowedTenants", 32); + } + } + if (SignupPolicyName != null) + { + if (SignupPolicyName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SignupPolicyName", 1); + } + } + if (SigninPolicyName != null) + { + if (SigninPolicyName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SigninPolicyName", 1); + } + } + if (ProfileEditingPolicyName != null) + { + if (ProfileEditingPolicyName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ProfileEditingPolicyName", 1); + } + } + if (PasswordResetPolicyName != null) + { + if (PasswordResetPolicyName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "PasswordResetPolicyName", 1); + } + } + if (ClientId != null) + { + if (ClientId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ClientId", 1); + } + } + if (ClientSecret != null) + { + if (ClientSecret.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ClientSecret", 1); + } + } + } + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueContract.cs new file mode 100644 index 000000000000..e0ebee604d58 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueContract.cs @@ -0,0 +1,144 @@ +// +// 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.ApiManagement.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// NamedValue details. + /// + [Rest.Serialization.JsonTransformation] + public partial class NamedValueContract : Resource + { + /// + /// Initializes a new instance of the NamedValueContract class. + /// + public NamedValueContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NamedValueContract class. + /// + /// Unique name of NamedValue. It may contain + /// only letters, digits, period, dash, and underscore + /// characters. + /// Resource ID. + /// Resource name. + /// Resource type for API Management + /// resource. + /// Optional tags that when provided can be used to + /// filter the NamedValue list. + /// Determines whether the value is a secret and + /// should be encrypted or not. Default value is false. + /// Value of the NamedValue. Can contain policy + /// expressions. It may not be empty or consist only of whitespace. + /// This property will not be filled on 'GET' operations! Use + /// '/listSecrets' POST request to get the value. + public NamedValueContract(string displayName, string id = default(string), string name = default(string), string type = default(string), IList tags = default(IList), bool? secret = default(bool?), string value = default(string)) + : base(id, name, type) + { + Tags = tags; + Secret = secret; + DisplayName = displayName; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets optional tags that when provided can be used to filter + /// the NamedValue list. + /// + [JsonProperty(PropertyName = "properties.tags")] + public IList Tags { get; set; } + + /// + /// Gets or sets determines whether the value is a secret and should be + /// encrypted or not. Default value is false. + /// + [JsonProperty(PropertyName = "properties.secret")] + public bool? Secret { get; set; } + + /// + /// Gets or sets unique name of NamedValue. It may contain only + /// letters, digits, period, dash, and underscore characters. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets value of the NamedValue. Can contain policy + /// expressions. It may not be empty or consist only of whitespace. + /// This property will not be filled on 'GET' operations! Use + /// '/listSecrets' POST request to get the value. + /// + [JsonProperty(PropertyName = "properties.value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + if (Tags != null) + { + if (Tags.Count > 32) + { + throw new ValidationException(ValidationRules.MaxItems, "Tags", 32); + } + } + if (DisplayName != null) + { + if (DisplayName.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "DisplayName", 256); + } + if (DisplayName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "DisplayName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(DisplayName, "^[A-Za-z0-9-._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "DisplayName", "^[A-Za-z0-9-._]+$"); + } + } + if (Value != null) + { + if (Value.Length > 4096) + { + throw new ValidationException(ValidationRules.MaxLength, "Value", 4096); + } + if (Value.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Value", 1); + } + } + } + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateContract.cs similarity index 75% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyContract.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateContract.cs index 3ccb9ea06aa4..137c29b9ad79 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateContract.cs @@ -18,37 +18,38 @@ namespace Microsoft.Azure.Management.ApiManagement.Models using System.Linq; /// - /// Property details. + /// NamedValue details. /// [Rest.Serialization.JsonTransformation] - public partial class PropertyContract : Resource + public partial class NamedValueCreateContract : Resource { /// - /// Initializes a new instance of the PropertyContract class. + /// Initializes a new instance of the NamedValueCreateContract class. /// - public PropertyContract() + public NamedValueCreateContract() { CustomInit(); } /// - /// Initializes a new instance of the PropertyContract class. + /// Initializes a new instance of the NamedValueCreateContract class. /// - /// Unique name of Property. It may contain + /// Unique name of NamedValue. It may contain /// only letters, digits, period, dash, and underscore /// characters. - /// Value of the property. Can contain policy - /// expressions. It may not be empty or consist only of - /// whitespace. + /// Value of the NamedValue. Can contain policy + /// expressions. It may not be empty or consist only of whitespace. + /// This property will not be filled on 'GET' operations! Use + /// '/listSecrets' POST request to get the value. /// Resource ID. /// Resource name. /// Resource type for API Management /// resource. /// Optional tags that when provided can be used to - /// filter the property list. + /// filter the NamedValue list. /// Determines whether the value is a secret and /// should be encrypted or not. Default value is false. - public PropertyContract(string displayName, string value, string id = default(string), string name = default(string), string type = default(string), IList tags = default(IList), bool? secret = default(bool?)) + public NamedValueCreateContract(string displayName, string value, string id = default(string), string name = default(string), string type = default(string), IList tags = default(IList), bool? secret = default(bool?)) : base(id, name, type) { Tags = tags; @@ -65,7 +66,7 @@ public PropertyContract() /// /// Gets or sets optional tags that when provided can be used to filter - /// the property list. + /// the NamedValue list. /// [JsonProperty(PropertyName = "properties.tags")] public IList Tags { get; set; } @@ -78,15 +79,17 @@ public PropertyContract() public bool? Secret { get; set; } /// - /// Gets or sets unique name of Property. It may contain only letters, - /// digits, period, dash, and underscore characters. + /// Gets or sets unique name of NamedValue. It may contain only + /// letters, digits, period, dash, and underscore characters. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } /// - /// Gets or sets value of the property. Can contain policy expressions. - /// It may not be empty or consist only of whitespace. + /// Gets or sets value of the NamedValue. Can contain policy + /// expressions. It may not be empty or consist only of whitespace. + /// This property will not be filled on 'GET' operations! Use + /// '/listSecrets' POST request to get the value. /// [JsonProperty(PropertyName = "properties.value")] public string Value { get; set; } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyCreateOrUpdateHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateOrUpdateHeaders.cs similarity index 80% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyCreateOrUpdateHeaders.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateOrUpdateHeaders.cs index f8793ab94cee..3f79e1ea46be 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyCreateOrUpdateHeaders.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueCreateOrUpdateHeaders.cs @@ -16,24 +16,24 @@ namespace Microsoft.Azure.Management.ApiManagement.Models /// /// Defines headers for CreateOrUpdate operation. /// - public partial class PropertyCreateOrUpdateHeaders + public partial class NamedValueCreateOrUpdateHeaders { /// - /// Initializes a new instance of the PropertyCreateOrUpdateHeaders + /// Initializes a new instance of the NamedValueCreateOrUpdateHeaders /// class. /// - public PropertyCreateOrUpdateHeaders() + public NamedValueCreateOrUpdateHeaders() { CustomInit(); } /// - /// Initializes a new instance of the PropertyCreateOrUpdateHeaders + /// Initializes a new instance of the NamedValueCreateOrUpdateHeaders /// class. /// /// Current entity state version. Should be treated /// as opaque and used to make conditional HTTP requests. - public PropertyCreateOrUpdateHeaders(string eTag = default(string)) + public NamedValueCreateOrUpdateHeaders(string eTag = default(string)) { ETag = eTag; CustomInit(); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyEntityBaseParameters.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueEntityBaseParameters.cs similarity index 81% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyEntityBaseParameters.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueEntityBaseParameters.cs index 5838df920928..9a5074be421b 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyEntityBaseParameters.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueEntityBaseParameters.cs @@ -17,28 +17,28 @@ namespace Microsoft.Azure.Management.ApiManagement.Models using System.Linq; /// - /// Property Entity Base Parameters set. + /// NamedValue Entity Base Parameters set. /// - public partial class PropertyEntityBaseParameters + public partial class NamedValueEntityBaseParameters { /// - /// Initializes a new instance of the PropertyEntityBaseParameters + /// Initializes a new instance of the NamedValueEntityBaseParameters /// class. /// - public PropertyEntityBaseParameters() + public NamedValueEntityBaseParameters() { CustomInit(); } /// - /// Initializes a new instance of the PropertyEntityBaseParameters + /// Initializes a new instance of the NamedValueEntityBaseParameters /// class. /// /// Optional tags that when provided can be used to - /// filter the property list. + /// filter the NamedValue list. /// Determines whether the value is a secret and /// should be encrypted or not. Default value is false. - public PropertyEntityBaseParameters(IList tags = default(IList), bool? secret = default(bool?)) + public NamedValueEntityBaseParameters(IList tags = default(IList), bool? secret = default(bool?)) { Tags = tags; Secret = secret; @@ -52,7 +52,7 @@ public PropertyEntityBaseParameters() /// /// Gets or sets optional tags that when provided can be used to filter - /// the property list. + /// the NamedValue list. /// [JsonProperty(PropertyName = "tags")] public IList Tags { get; set; } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetEntityTagHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetEntityTagHeaders.cs similarity index 81% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetEntityTagHeaders.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetEntityTagHeaders.cs index 7f01a17d3e50..b329938446fb 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetEntityTagHeaders.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetEntityTagHeaders.cs @@ -16,24 +16,24 @@ namespace Microsoft.Azure.Management.ApiManagement.Models /// /// Defines headers for GetEntityTag operation. /// - public partial class PropertyGetEntityTagHeaders + public partial class NamedValueGetEntityTagHeaders { /// - /// Initializes a new instance of the PropertyGetEntityTagHeaders + /// Initializes a new instance of the NamedValueGetEntityTagHeaders /// class. /// - public PropertyGetEntityTagHeaders() + public NamedValueGetEntityTagHeaders() { CustomInit(); } /// - /// Initializes a new instance of the PropertyGetEntityTagHeaders + /// Initializes a new instance of the NamedValueGetEntityTagHeaders /// class. /// /// Current entity state version. Should be treated /// as opaque and used to make conditional HTTP requests. - public PropertyGetEntityTagHeaders(string eTag = default(string)) + public NamedValueGetEntityTagHeaders(string eTag = default(string)) { ETag = eTag; CustomInit(); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetHeaders.cs similarity index 82% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetHeaders.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetHeaders.cs index 6de1635a3057..c8ca2e7430c9 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyGetHeaders.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueGetHeaders.cs @@ -16,22 +16,22 @@ namespace Microsoft.Azure.Management.ApiManagement.Models /// /// Defines headers for Get operation. /// - public partial class PropertyGetHeaders + public partial class NamedValueGetHeaders { /// - /// Initializes a new instance of the PropertyGetHeaders class. + /// Initializes a new instance of the NamedValueGetHeaders class. /// - public PropertyGetHeaders() + public NamedValueGetHeaders() { CustomInit(); } /// - /// Initializes a new instance of the PropertyGetHeaders class. + /// Initializes a new instance of the NamedValueGetHeaders class. /// /// Current entity state version. Should be treated /// as opaque and used to make conditional HTTP requests. - public PropertyGetHeaders(string eTag = default(string)) + public NamedValueGetHeaders(string eTag = default(string)) { ETag = eTag; CustomInit(); diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateHeaders.cs new file mode 100644 index 000000000000..7de507af6cac --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateHeaders.cs @@ -0,0 +1,53 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Update operation. + /// + public partial class NamedValueUpdateHeaders + { + /// + /// Initializes a new instance of the NamedValueUpdateHeaders class. + /// + public NamedValueUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NamedValueUpdateHeaders class. + /// + /// Current entity state version. Should be treated + /// as opaque and used to make conditional HTTP requests. + public NamedValueUpdateHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets current entity state version. Should be treated as + /// opaque and used to make conditional HTTP requests. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyUpdateParameters.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateParameters.cs similarity index 79% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyUpdateParameters.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateParameters.cs index e1467d2634b6..177bd429a609 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyUpdateParameters.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/NamedValueUpdateParameters.cs @@ -18,33 +18,33 @@ namespace Microsoft.Azure.Management.ApiManagement.Models using System.Linq; /// - /// Property update Parameters. + /// NamedValue update Parameters. /// [Rest.Serialization.JsonTransformation] - public partial class PropertyUpdateParameters + public partial class NamedValueUpdateParameters { /// - /// Initializes a new instance of the PropertyUpdateParameters class. + /// Initializes a new instance of the NamedValueUpdateParameters class. /// - public PropertyUpdateParameters() + public NamedValueUpdateParameters() { CustomInit(); } /// - /// Initializes a new instance of the PropertyUpdateParameters class. + /// Initializes a new instance of the NamedValueUpdateParameters class. /// /// Optional tags that when provided can be used to - /// filter the property list. + /// filter the NamedValue list. /// Determines whether the value is a secret and /// should be encrypted or not. Default value is false. - /// Unique name of Property. It may contain + /// Unique name of NamedValue. It may contain /// only letters, digits, period, dash, and underscore /// characters. - /// Value of the property. Can contain policy + /// Value of the NamedValue. Can contain policy /// expressions. It may not be empty or consist only of /// whitespace. - public PropertyUpdateParameters(IList tags = default(IList), bool? secret = default(bool?), string displayName = default(string), string value = default(string)) + public NamedValueUpdateParameters(IList tags = default(IList), bool? secret = default(bool?), string displayName = default(string), string value = default(string)) { Tags = tags; Secret = secret; @@ -60,7 +60,7 @@ public PropertyUpdateParameters() /// /// Gets or sets optional tags that when provided can be used to filter - /// the property list. + /// the NamedValue list. /// [JsonProperty(PropertyName = "properties.tags")] public IList Tags { get; set; } @@ -73,15 +73,15 @@ public PropertyUpdateParameters() public bool? Secret { get; set; } /// - /// Gets or sets unique name of Property. It may contain only letters, - /// digits, period, dash, and underscore characters. + /// Gets or sets unique name of NamedValue. It may contain only + /// letters, digits, period, dash, and underscore characters. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } /// - /// Gets or sets value of the property. Can contain policy expressions. - /// It may not be empty or consist only of whitespace. + /// Gets or sets value of the NamedValue. Can contain policy + /// expressions. It may not be empty or consist only of whitespace. /// [JsonProperty(PropertyName = "properties.value")] public string Value { get; set; } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionCollection.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionCollection.cs new file mode 100644 index 000000000000..4dbb06f7e4e5 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionCollection.cs @@ -0,0 +1,63 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Descriptions of APIM policies. + /// + public partial class PolicyDescriptionCollection + { + /// + /// Initializes a new instance of the PolicyDescriptionCollection + /// class. + /// + public PolicyDescriptionCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PolicyDescriptionCollection + /// class. + /// + /// Descriptions of APIM policies. + /// Total record count number. + public PolicyDescriptionCollection(IList value = default(IList), long? count = default(long?)) + { + Value = value; + Count = count; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets descriptions of APIM policies. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets total record count number. + /// + [JsonProperty(PropertyName = "count")] + public long? Count { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionContract.cs new file mode 100644 index 000000000000..2682af2f01f5 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicyDescriptionContract.cs @@ -0,0 +1,67 @@ +// +// 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.ApiManagement.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Policy description details. + /// + [Rest.Serialization.JsonTransformation] + public partial class PolicyDescriptionContract : Resource + { + /// + /// Initializes a new instance of the PolicyDescriptionContract class. + /// + public PolicyDescriptionContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PolicyDescriptionContract class. + /// + /// Resource ID. + /// Resource name. + /// Resource type for API Management + /// resource. + /// Policy description. + /// Binary OR value of the Snippet scope. + public PolicyDescriptionContract(string id = default(string), string name = default(string), string type = default(string), string description = default(string), int? scope = default(int?)) + : base(id, name, type) + { + Description = description; + Scope = scope; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets policy description. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets binary OR value of the Snippet scope. + /// + [JsonProperty(PropertyName = "properties.scope")] + public int? Scope { get; private set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetContract.cs deleted file mode 100644 index 369efa2d1c2b..000000000000 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetContract.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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.ApiManagement.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Policy snippet. - /// - public partial class PolicySnippetContract - { - /// - /// Initializes a new instance of the PolicySnippetContract class. - /// - public PolicySnippetContract() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PolicySnippetContract class. - /// - /// Snippet name. - /// Snippet content. - /// Snippet toolTip. - /// Binary OR value of the Snippet scope. - public PolicySnippetContract(string name = default(string), string content = default(string), string toolTip = default(string), int? scope = default(int?)) - { - Name = name; - Content = content; - ToolTip = toolTip; - Scope = scope; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets snippet name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets snippet content. - /// - [JsonProperty(PropertyName = "content")] - public string Content { get; private set; } - - /// - /// Gets snippet toolTip. - /// - [JsonProperty(PropertyName = "toolTip")] - public string ToolTip { get; private set; } - - /// - /// Gets binary OR value of the Snippet scope. - /// - [JsonProperty(PropertyName = "scope")] - public int? Scope { get; private set; } - - } -} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PortalSettingValidationKeyContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PortalSettingValidationKeyContract.cs new file mode 100644 index 000000000000..66228d789a48 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PortalSettingValidationKeyContract.cs @@ -0,0 +1,55 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + /// + public partial class PortalSettingValidationKeyContract + { + /// + /// Initializes a new instance of the + /// PortalSettingValidationKeyContract class. + /// + public PortalSettingValidationKeyContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PortalSettingValidationKeyContract class. + /// + /// This is secret value of the validation + /// key in portal settings. + public PortalSettingValidationKeyContract(string validationKey = default(string)) + { + ValidationKey = validationKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this is secret value of the validation key in portal + /// settings. + /// + [JsonProperty(PropertyName = "validationKey")] + public string ValidationKey { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetsCollection.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyValueContract.cs similarity index 59% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetsCollection.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyValueContract.cs index a5aa6b46c8d0..56186ab6403b 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PolicySnippetsCollection.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/PropertyValueContract.cs @@ -11,28 +11,27 @@ namespace Microsoft.Azure.Management.ApiManagement.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The response of the list policy snippets operation. + /// Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. /// - public partial class PolicySnippetsCollection + public partial class PropertyValueContract { /// - /// Initializes a new instance of the PolicySnippetsCollection class. + /// Initializes a new instance of the PropertyValueContract class. /// - public PolicySnippetsCollection() + public PropertyValueContract() { CustomInit(); } /// - /// Initializes a new instance of the PolicySnippetsCollection class. + /// Initializes a new instance of the PropertyValueContract class. /// - /// Policy snippet value. - public PolicySnippetsCollection(IList value = default(IList)) + /// This is secret value of the NamedValue + /// entity. + public PropertyValueContract(string value = default(string)) { Value = value; CustomInit(); @@ -44,10 +43,10 @@ public PolicySnippetsCollection() partial void CustomInit(); /// - /// Gets or sets policy snippet value. + /// Gets or sets this is secret value of the NamedValue entity. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + public string Value { get; set; } } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaContract.cs index 0b641ca8d148..55f15d39d255 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaContract.cs @@ -41,17 +41,22 @@ public SchemaContract() /// `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` /// Schema use `application/vnd.oai.openapi.components+json` /// </br> - `WADL Schema` use - /// `application/vnd.ms-azure-apim.wadl.grammars+xml`. + /// `application/vnd.ms-azure-apim.wadl.grammars+xml`. /// Resource ID. /// Resource name. /// Resource type for API Management /// resource. - /// Properties of the Schema Document. - public SchemaContract(string contentType, string id = default(string), string name = default(string), string type = default(string), object document = default(object)) + /// Json escaped string defining the document + /// representing the Schema. Used for schemas other than + /// Swagger/OpenAPI. + /// Types definitions. Used for + /// Swagger/OpenAPI schemas only, null otherwise. + public SchemaContract(string contentType, string id = default(string), string name = default(string), string type = default(string), string value = default(string), object definitions = default(object)) : base(id, name, type) { ContentType = contentType; - Document = document; + Value = value; + Definitions = definitions; CustomInit(); } @@ -76,10 +81,18 @@ public SchemaContract() public string ContentType { get; set; } /// - /// Gets or sets properties of the Schema Document. + /// Gets or sets json escaped string defining the document representing + /// the Schema. Used for schemas other than Swagger/OpenAPI. /// - [JsonProperty(PropertyName = "properties.document")] - public object Document { get; set; } + [JsonProperty(PropertyName = "properties.document.value")] + public string Value { get; set; } + + /// + /// Gets or sets types definitions. Used for Swagger/OpenAPI schemas + /// only, null otherwise. + /// + [JsonProperty(PropertyName = "properties.document.definitions")] + public object Definitions { get; set; } /// /// Validate the object. diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaCreateOrUpdateContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaCreateOrUpdateContract.cs deleted file mode 100644 index 30bb4caea2b6..000000000000 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SchemaCreateOrUpdateContract.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -// 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.ApiManagement.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Schema Contract details. - /// - [Rest.Serialization.JsonTransformation] - public partial class SchemaCreateOrUpdateContract : Resource - { - /// - /// Initializes a new instance of the SchemaCreateOrUpdateContract - /// class. - /// - public SchemaCreateOrUpdateContract() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SchemaCreateOrUpdateContract - /// class. - /// - /// Must be a valid a media type used in a - /// Content-Type header as defined in the RFC 2616. Media type of the - /// schema document (e.g. application/json, application/xml). - /// </br> - `Swagger` Schema use - /// `application/vnd.ms-azure-apim.swagger.definitions+json` - /// </br> - `WSDL` Schema use - /// `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` - /// Schema use `application/vnd.oai.openapi.components+json` - /// </br> - `WADL Schema` use - /// `application/vnd.ms-azure-apim.wadl.grammars+xml`. - /// Resource ID. - /// Resource name. - /// Resource type for API Management - /// resource. - /// Json escaped string defining the document - /// representing the Schema. - public SchemaCreateOrUpdateContract(string contentType, string id = default(string), string name = default(string), string type = default(string), string value = default(string)) - : base(id, name, type) - { - ContentType = contentType; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets must be a valid a media type used in a Content-Type - /// header as defined in the RFC 2616. Media type of the schema - /// document (e.g. application/json, application/xml). - /// &lt;/br&gt; - `Swagger` Schema use - /// `application/vnd.ms-azure-apim.swagger.definitions+json` - /// &lt;/br&gt; - `WSDL` Schema use - /// `application/vnd.ms-azure-apim.xsd+xml` &lt;/br&gt; - - /// `OpenApi` Schema use `application/vnd.oai.openapi.components+json` - /// &lt;/br&gt; - `WADL Schema` use - /// `application/vnd.ms-azure-apim.wadl.grammars+xml`. - /// - [JsonProperty(PropertyName = "properties.contentType")] - public string ContentType { get; set; } - - /// - /// Gets or sets json escaped string defining the document representing - /// the Schema. - /// - [JsonProperty(PropertyName = "properties.document.value")] - public string Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ContentType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContentType"); - } - } - } -} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionContract.cs index 958a0cea46e8..f915580ec674 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionContract.cs @@ -44,8 +44,6 @@ public SubscriptionContract() /// administrator, * expired – the subscription reached its expiration /// date and was deactivated. Possible values include: 'suspended', /// 'active', 'expired', 'submitted', 'rejected', 'cancelled' - /// Subscription primary key. - /// Subscription secondary key. /// Resource ID. /// Resource name. /// Resource type for API Management @@ -84,11 +82,17 @@ public SubscriptionContract() /// notification date. The date conforms to the following format: /// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. /// + /// Subscription primary key. This property + /// will not be filled on 'GET' operations! Use '/listSecrets' POST + /// request to get the value. + /// Subscription secondary key. This + /// property will not be filled on 'GET' operations! Use '/listSecrets' + /// POST request to get the value. /// Optional subscription comment added by /// an administrator. /// Determines whether tracing is /// enabled - public SubscriptionContract(string scope, SubscriptionState state, string primaryKey, string secondaryKey, string id = default(string), string name = default(string), string type = default(string), string ownerId = default(string), string displayName = default(string), System.DateTime? createdDate = default(System.DateTime?), System.DateTime? startDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), System.DateTime? notificationDate = default(System.DateTime?), string stateComment = default(string), bool? allowTracing = default(bool?)) + public SubscriptionContract(string scope, SubscriptionState state, string id = default(string), string name = default(string), string type = default(string), string ownerId = default(string), string displayName = default(string), System.DateTime? createdDate = default(System.DateTime?), System.DateTime? startDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), System.DateTime? notificationDate = default(System.DateTime?), string primaryKey = default(string), string secondaryKey = default(string), string stateComment = default(string), bool? allowTracing = default(bool?)) : base(id, name, type) { OwnerId = ownerId; @@ -202,13 +206,17 @@ public SubscriptionContract() public System.DateTime? NotificationDate { get; set; } /// - /// Gets or sets subscription primary key. + /// Gets or sets subscription primary key. This property will not be + /// filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. /// [JsonProperty(PropertyName = "properties.primaryKey")] public string PrimaryKey { get; set; } /// - /// Gets or sets subscription secondary key. + /// Gets or sets subscription secondary key. This property will not be + /// filled on 'GET' operations! Use '/listSecrets' POST request to get + /// the value. /// [JsonProperty(PropertyName = "properties.secondaryKey")] public string SecondaryKey { get; set; } @@ -238,14 +246,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Scope"); } - if (PrimaryKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PrimaryKey"); - } - if (SecondaryKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SecondaryKey"); - } if (DisplayName != null) { if (DisplayName.Length > 100) diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionKeysContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionKeysContract.cs new file mode 100644 index 000000000000..6d042d52bc5a --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/SubscriptionKeysContract.cs @@ -0,0 +1,91 @@ +// +// 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.ApiManagement.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Subscription keys. + /// + public partial class SubscriptionKeysContract + { + /// + /// Initializes a new instance of the SubscriptionKeysContract class. + /// + public SubscriptionKeysContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubscriptionKeysContract class. + /// + /// Subscription primary key. + /// Subscription secondary key. + public SubscriptionKeysContract(string primaryKey = default(string), string secondaryKey = default(string)) + { + PrimaryKey = primaryKey; + SecondaryKey = secondaryKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets subscription primary key. + /// + [JsonProperty(PropertyName = "primaryKey")] + public string PrimaryKey { get; set; } + + /// + /// Gets or sets subscription secondary key. + /// + [JsonProperty(PropertyName = "secondaryKey")] + public string SecondaryKey { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrimaryKey != null) + { + if (PrimaryKey.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "PrimaryKey", 256); + } + if (PrimaryKey.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "PrimaryKey", 1); + } + } + if (SecondaryKey != null) + { + if (SecondaryKey.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "SecondaryKey", 256); + } + if (SecondaryKey.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SecondaryKey", 1); + } + } + } + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TagDescriptionContract.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TagDescriptionContract.cs index c2304af9d949..343ac9393717 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TagDescriptionContract.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TagDescriptionContract.cs @@ -41,13 +41,16 @@ public TagDescriptionContract() /// describing the tag. /// Description of the external /// resources describing the tag. + /// Identifier of the tag in the form of + /// /tags/{tagId} /// Tag name. - public TagDescriptionContract(string id = default(string), string name = default(string), string type = default(string), string description = default(string), string externalDocsUrl = default(string), string externalDocsDescription = default(string), string displayName = default(string)) + public TagDescriptionContract(string id = default(string), string name = default(string), string type = default(string), string description = default(string), string externalDocsUrl = default(string), string externalDocsDescription = default(string), string tagId = default(string), string displayName = default(string)) : base(id, name, type) { Description = description; ExternalDocsUrl = externalDocsUrl; ExternalDocsDescription = externalDocsDescription; + TagId = tagId; DisplayName = displayName; CustomInit(); } @@ -76,6 +79,12 @@ public TagDescriptionContract() [JsonProperty(PropertyName = "properties.externalDocsDescription")] public string ExternalDocsDescription { get; set; } + /// + /// Gets or sets identifier of the tag in the form of /tags/{tagId} + /// + [JsonProperty(PropertyName = "properties.tagId")] + public string TagId { get; set; } + /// /// Gets or sets tag name. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessGitListSecretsHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessGitListSecretsHeaders.cs new file mode 100644 index 000000000000..d0730cc92a0b --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessGitListSecretsHeaders.cs @@ -0,0 +1,55 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ListSecrets operation. + /// + public partial class TenantAccessGitListSecretsHeaders + { + /// + /// Initializes a new instance of the TenantAccessGitListSecretsHeaders + /// class. + /// + public TenantAccessGitListSecretsHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantAccessGitListSecretsHeaders + /// class. + /// + /// Current entity state version. Should be treated + /// as opaque and used to make conditional HTTP requests. + public TenantAccessGitListSecretsHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets current entity state version. Should be treated as + /// opaque and used to make conditional HTTP requests. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessListSecretsHeaders.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessListSecretsHeaders.cs new file mode 100644 index 000000000000..305c6fee8f67 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/TenantAccessListSecretsHeaders.cs @@ -0,0 +1,55 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ListSecrets operation. + /// + public partial class TenantAccessListSecretsHeaders + { + /// + /// Initializes a new instance of the TenantAccessListSecretsHeaders + /// class. + /// + public TenantAccessListSecretsHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TenantAccessListSecretsHeaders + /// class. + /// + /// Current entity state version. Should be treated + /// as opaque and used to make conditional HTTP requests. + public TenantAccessListSecretsHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets current entity state version. Should be treated as + /// opaque and used to make conditional HTTP requests. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/UserIdentityProperties.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/UserIdentityProperties.cs new file mode 100644 index 000000000000..32c71f902943 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/Models/UserIdentityProperties.cs @@ -0,0 +1,58 @@ +// +// 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.ApiManagement.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class UserIdentityProperties + { + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + public UserIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperations.cs similarity index 75% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperations.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperations.cs index ab0302f10e0f..f7e5752c31da 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperations.cs @@ -24,12 +24,12 @@ namespace Microsoft.Azure.Management.ApiManagement using System.Threading.Tasks; /// - /// PropertyOperations operations. + /// NamedValueOperations operations. /// - internal partial class PropertyOperations : IServiceOperations, IPropertyOperations + internal partial class NamedValueOperations : IServiceOperations, INamedValueOperations { /// - /// Initializes a new instance of the PropertyOperations class. + /// Initializes a new instance of the NamedValueOperations class. /// /// /// Reference to the service client. @@ -37,7 +37,7 @@ internal partial class PropertyOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PropertyOperations(ApiManagementClient client) + internal NamedValueOperations(ApiManagementClient client) { if (client == null) { @@ -52,7 +52,7 @@ internal PropertyOperations(ApiManagementClient client) public ApiManagementClient Client { get; private set; } /// - /// Lists a collection of properties defined within a service instance. + /// Lists a collection of NamedValues defined within a service instance. /// /// /// @@ -85,7 +85,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -133,7 +133,7 @@ internal PropertyOperations(ApiManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -238,7 +238,7 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -251,7 +251,7 @@ internal PropertyOperations(ApiManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -271,7 +271,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Gets the entity state (Etag) version of the property specified by its + /// Gets the entity state (Etag) version of the NamedValue specified by its /// identifier. /// /// @@ -280,8 +280,8 @@ internal PropertyOperations(ApiManagementClient client) /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// Headers that will be added to request. @@ -301,7 +301,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetEntityTagWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -326,19 +326,19 @@ internal PropertyOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); } } - if (propId == null) + if (namedValueId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "propId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); } - if (propId != null) + if (namedValueId != null) { - if (propId.Length > 256) + if (namedValueId.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "propId", 256); + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); } - if (!System.Text.RegularExpressions.Regex.IsMatch(propId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "propId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); } } if (Client.ApiVersion == null) @@ -358,16 +358,16 @@ internal PropertyOperations(ApiManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("propId", propId); + tracingParameters.Add("namedValueId", namedValueId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetEntityTag", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{propId}", System.Uri.EscapeDataString(propId)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -462,7 +462,7 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -471,7 +471,7 @@ internal PropertyOperations(ApiManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -490,7 +490,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Gets the details of the property specified by its identifier. + /// Gets the details of the NamedValue specified by its identifier. /// /// /// The name of the resource group. @@ -498,8 +498,8 @@ internal PropertyOperations(ApiManagementClient client) /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// Headers that will be added to request. @@ -522,7 +522,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -547,19 +547,19 @@ internal PropertyOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); } } - if (propId == null) + if (namedValueId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "propId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); } - if (propId != null) + if (namedValueId != null) { - if (propId.Length > 256) + if (namedValueId.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "propId", 256); + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); } - if (!System.Text.RegularExpressions.Regex.IsMatch(propId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "propId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); } } if (Client.ApiVersion == null) @@ -579,16 +579,16 @@ internal PropertyOperations(ApiManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("propId", propId); + tracingParameters.Add("namedValueId", namedValueId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{propId}", System.Uri.EscapeDataString(propId)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -683,7 +683,7 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -696,7 +696,7 @@ internal PropertyOperations(ApiManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -710,7 +710,7 @@ internal PropertyOperations(ApiManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -729,7 +729,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Creates or updates a property. + /// Creates or updates a NamedValue. /// /// /// The name of the resource group. @@ -737,8 +737,8 @@ internal PropertyOperations(ApiManagementClient client) /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// /// Create parameters. @@ -748,6 +748,69 @@ internal PropertyOperations(ApiManagementClient client) /// updating an entity. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the specific NamedValue. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes specific NamedValue from the API Management service instance. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// /// Headers that will be added to request. /// /// @@ -756,9 +819,6 @@ internal PropertyOperations(ApiManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -768,7 +828,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, PropertyContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -793,28 +853,24 @@ internal PropertyOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); } } - if (propId == null) + if (namedValueId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "propId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); } - if (propId != null) + if (namedValueId != null) { - if (propId.Length > 256) + if (namedValueId.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "propId", 256); + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); } - if (!System.Text.RegularExpressions.Regex.IsMatch(propId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "propId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); } } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) + if (ifMatch == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); } if (Client.ApiVersion == null) { @@ -833,18 +889,17 @@ internal PropertyOperations(ApiManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("propId", propId); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("namedValueId", namedValueId); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{propId}", System.Uri.EscapeDataString(propId)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -858,7 +913,7 @@ internal PropertyOperations(ApiManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -897,12 +952,6 @@ internal PropertyOperations(ApiManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -923,7 +972,7 @@ internal PropertyOperations(ApiManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -953,38 +1002,228 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + if (_shouldTrace) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the secret value of the NamedValue. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// 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> ListValueWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); } - catch (JsonException ex) + if (serviceName.Length < 1) { - _httpRequest.Dispose(); - if (_httpResponse != null) + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (namedValueId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); + } + if (namedValueId != null) + { + if (namedValueId.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("namedValueId", namedValueId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListValue", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + _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 == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -996,19 +1235,6 @@ internal PropertyOperations(ApiManagementClient client) throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1017,7 +1243,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Updates the specific property. + /// Creates or updates a NamedValue. /// /// /// The name of the resource group. @@ -1025,16 +1251,15 @@ internal PropertyOperations(ApiManagementClient client) /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. /// /// - /// Update parameters. + /// Create parameters. /// /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. /// /// /// Headers that will be added to request. @@ -1045,6 +1270,9 @@ internal PropertyOperations(ApiManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1054,7 +1282,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, PropertyUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1079,28 +1307,28 @@ internal PropertyOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); } } - if (propId == null) + if (namedValueId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "propId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); } - if (propId != null) + if (namedValueId != null) { - if (propId.Length > 256) + if (namedValueId.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "propId", 256); + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); } - if (!System.Text.RegularExpressions.Regex.IsMatch(propId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "propId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); } } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (ifMatch == null) + if (parameters != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); + parameters.Validate(); } if (Client.ApiVersion == null) { @@ -1119,18 +1347,18 @@ internal PropertyOperations(ApiManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("propId", propId); + tracingParameters.Add("namedValueId", namedValueId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{propId}", System.Uri.EscapeDataString(propId)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1144,7 +1372,7 @@ internal PropertyOperations(ApiManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1209,7 +1437,7 @@ internal PropertyOperations(ApiManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1239,13 +1467,62 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1254,7 +1531,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Deletes specific property from the API Management service instance. + /// Updates the specific NamedValue. /// /// /// The name of the resource group. @@ -1262,8 +1539,11 @@ internal PropertyOperations(ApiManagementClient client) /// /// The name of the API Management service. /// - /// - /// Identifier of the property. + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. /// /// /// ETag of the Entity. ETag should match the current entity state from the @@ -1279,6 +1559,9 @@ internal PropertyOperations(ApiManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1288,7 +1571,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string serviceName, string propId, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1313,21 +1596,25 @@ internal PropertyOperations(ApiManagementClient client) throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); } } - if (propId == null) + if (namedValueId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "propId"); + throw new ValidationException(ValidationRules.CannotBeNull, "namedValueId"); } - if (propId != null) + if (namedValueId != null) { - if (propId.Length > 256) + if (namedValueId.Length > 256) { - throw new ValidationException(ValidationRules.MaxLength, "propId", 256); + throw new ValidationException(ValidationRules.MaxLength, "namedValueId", 256); } - if (!System.Text.RegularExpressions.Regex.IsMatch(propId, "^[^*#&+:<>?]+$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(namedValueId, "^[^*#&+:<>?]+$")) { - throw new ValidationException(ValidationRules.Pattern, "propId", "^[^*#&+:<>?]+$"); + throw new ValidationException(ValidationRules.Pattern, "namedValueId", "^[^*#&+:<>?]+$"); } } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } if (ifMatch == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ifMatch"); @@ -1349,17 +1636,18 @@ internal PropertyOperations(ApiManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("propId", propId); + tracingParameters.Add("namedValueId", namedValueId); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("ifMatch", ifMatch); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); - _url = _url.Replace("{propId}", System.Uri.EscapeDataString(propId)); + _url = _url.Replace("{namedValueId}", System.Uri.EscapeDataString(namedValueId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1373,7 +1661,7 @@ internal PropertyOperations(ApiManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1412,6 +1700,12 @@ internal PropertyOperations(ApiManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1432,7 +1726,7 @@ internal PropertyOperations(ApiManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1462,13 +1756,44 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1477,7 +1802,7 @@ internal PropertyOperations(ApiManagementClient client) } /// - /// Lists a collection of properties defined within a service instance. + /// Lists a collection of NamedValues defined within a service instance. /// /// /// @@ -1504,7 +1829,7 @@ internal PropertyOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByServiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1613,7 +1938,7 @@ internal PropertyOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1626,7 +1951,7 @@ internal PropertyOperations(ApiManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperationsExtensions.cs new file mode 100644 index 000000000000..a19f1d28a260 --- /dev/null +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/NamedValueOperationsExtensions.cs @@ -0,0 +1,547 @@ +// +// 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.ApiManagement +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Azure.OData; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NamedValueOperations. + /// + public static partial class NamedValueOperationsExtensions + { + /// + /// Lists a collection of NamedValues defined within a service instance. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// OData parameters to apply to the operation. + /// + public static IPage ListByService(this INamedValueOperations operations, string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery)) + { + return operations.ListByServiceAsync(resourceGroupName, serviceName, odataQuery).GetAwaiter().GetResult(); + } + + /// + /// Lists a collection of NamedValues defined within a service instance. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServiceAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the entity state (Etag) version of the NamedValue specified by its + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + public static NamedValueGetEntityTagHeaders GetEntityTag(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId) + { + return operations.GetEntityTagAsync(resourceGroupName, serviceName, namedValueId).GetAwaiter().GetResult(); + } + + /// + /// Gets the entity state (Etag) version of the NamedValue specified by its + /// identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// The cancellation token. + /// + public static async Task GetEntityTagAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + + /// + /// Gets the details of the NamedValue specified by its identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + public static NamedValueContract Get(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId) + { + return operations.GetAsync(resourceGroupName, serviceName, namedValueId).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of the NamedValue specified by its identifier. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Create parameters. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + public static NamedValueContract CreateOrUpdate(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Create parameters. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the specific NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static NamedValueContract Update(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch) + { + return operations.UpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the specific NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes specific NamedValue from the API Management service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static void Delete(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, string ifMatch) + { + operations.DeleteAsync(resourceGroupName, serviceName, namedValueId, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Deletes specific NamedValue from the API Management service instance. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the secret value of the NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + public static PropertyValueContract ListValue(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId) + { + return operations.ListValueAsync(resourceGroupName, serviceName, namedValueId).GetAwaiter().GetResult(); + } + + /// + /// Gets the secret value of the NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// The cancellation token. + /// + public static async Task ListValueAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListValueWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Create parameters. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + public static NamedValueContract BeginCreateOrUpdate(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string)) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Create parameters. + /// + /// + /// ETag of the Entity. Not required when creating an entity, but required when + /// updating an entity. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueCreateContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the specific NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + public static NamedValueContract BeginUpdate(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch) + { + return operations.BeginUpdateAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the specific NamedValue. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the NamedValue. + /// + /// + /// Update parameters. + /// + /// + /// ETag of the Entity. ETag should match the current entity state from the + /// header response of the GET request or it should be * for unconditional + /// update. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this INamedValueOperations operations, string resourceGroupName, string serviceName, string namedValueId, NamedValueUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, namedValueId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists a collection of NamedValues defined within a service instance. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByServiceNext(this INamedValueOperations operations, string nextPageLink) + { + return operations.ListByServiceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists a collection of NamedValues defined within a service instance. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByServiceNextAsync(this INamedValueOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperations.cs index 00fa604e0e8d..ee799d548175 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperations.cs @@ -1476,6 +1476,232 @@ internal OpenIdConnectProviderOperations(ApiManagementClient client) return _result; } + /// + /// Gets the client secret details of the OpenID Connect Provider. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the OpenID Connect Provider. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string opid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (opid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "opid"); + } + if (opid != null) + { + if (opid.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "opid", 256); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(opid, "^[^*#&+:<>?]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "opid", "^[^*#&+:<>?]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("opid", opid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{opid}", System.Uri.EscapeDataString(opid)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + /// /// Lists of all the OpenId Connect Providers. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperationsExtensions.cs index 56dea6d28810..268c0ff85988 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/OpenIdConnectProviderOperationsExtensions.cs @@ -336,6 +336,52 @@ public static void Delete(this IOpenIdConnectProviderOperations operations, stri (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, opid, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the client secret details of the OpenID Connect Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the OpenID Connect Provider. + /// + public static ClientSecretContract ListSecrets(this IOpenIdConnectProviderOperations operations, string resourceGroupName, string serviceName, string opid) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName, opid).GetAwaiter().GetResult(); + } + + /// + /// Gets the client secret details of the OpenID Connect Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Identifier of the OpenID Connect Provider. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this IOpenIdConnectProviderOperations operations, string resourceGroupName, string serviceName, string opid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, opid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists of all the OpenId Connect Providers. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperations.cs similarity index 91% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperations.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperations.cs index 4444f81aa8ab..5508d93ebe1a 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.ApiManagement using System.Threading.Tasks; /// - /// PolicySnippetOperations operations. + /// PolicyDescriptionOperations operations. /// - internal partial class PolicySnippetOperations : IServiceOperations, IPolicySnippetOperations + internal partial class PolicyDescriptionOperations : IServiceOperations, IPolicyDescriptionOperations { /// - /// Initializes a new instance of the PolicySnippetOperations class. + /// Initializes a new instance of the PolicyDescriptionOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class PolicySnippetOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PolicySnippetOperations(ApiManagementClient client) + internal PolicyDescriptionOperations(ApiManagementClient client) { if (client == null) { @@ -51,7 +51,7 @@ internal PolicySnippetOperations(ApiManagementClient client) public ApiManagementClient Client { get; private set; } /// - /// Lists all policy snippets. + /// Lists all policy descriptions. /// /// /// The name of the resource group. @@ -84,7 +84,7 @@ internal PolicySnippetOperations(ApiManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByServiceWithHttpMessagesAsync(string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -132,7 +132,7 @@ internal PolicySnippetOperations(ApiManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -233,7 +233,7 @@ internal PolicySnippetOperations(ApiManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -246,7 +246,7 @@ internal PolicySnippetOperations(ApiManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperationsExtensions.cs similarity index 75% rename from sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperationsExtensions.cs rename to sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperationsExtensions.cs index e3e66f50024f..d150de8f8b94 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicySnippetOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PolicyDescriptionOperationsExtensions.cs @@ -17,12 +17,12 @@ namespace Microsoft.Azure.Management.ApiManagement using System.Threading.Tasks; /// - /// Extension methods for PolicySnippetOperations. + /// Extension methods for PolicyDescriptionOperations. /// - public static partial class PolicySnippetOperationsExtensions + public static partial class PolicyDescriptionOperationsExtensions { /// - /// Lists all policy snippets. + /// Lists all policy descriptions. /// /// /// The operations group for this extension method. @@ -37,13 +37,13 @@ public static partial class PolicySnippetOperationsExtensions /// Policy scope. Possible values include: 'Tenant', 'Product', 'Api', /// 'Operation', 'All' /// - public static PolicySnippetsCollection ListByService(this IPolicySnippetOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?)) + public static PolicyDescriptionCollection ListByService(this IPolicyDescriptionOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?)) { return operations.ListByServiceAsync(resourceGroupName, serviceName, scope).GetAwaiter().GetResult(); } /// - /// Lists all policy snippets. + /// Lists all policy descriptions. /// /// /// The operations group for this extension method. @@ -61,7 +61,7 @@ public static partial class PolicySnippetOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByServiceAsync(this IPolicySnippetOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByServiceAsync(this IPolicyDescriptionOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract? scope = default(PolicyScopeContract?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, scope, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperationsExtensions.cs deleted file mode 100644 index 87d2026aa96f..000000000000 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/PropertyOperationsExtensions.cs +++ /dev/null @@ -1,376 +0,0 @@ -// -// 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.ApiManagement -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PropertyOperations. - /// - public static partial class PropertyOperationsExtensions - { - /// - /// Lists a collection of properties defined within a service instance. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage ListByService(this IPropertyOperations operations, string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListByServiceAsync(resourceGroupName, serviceName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Lists a collection of properties defined within a service instance. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByServiceAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the entity state (Etag) version of the property specified by its - /// identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - public static PropertyGetEntityTagHeaders GetEntityTag(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId) - { - return operations.GetEntityTagAsync(resourceGroupName, serviceName, propId).GetAwaiter().GetResult(); - } - - /// - /// Gets the entity state (Etag) version of the property specified by its - /// identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// The cancellation token. - /// - public static async Task GetEntityTagAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, propId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Gets the details of the property specified by its identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - public static PropertyContract Get(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId) - { - return operations.GetAsync(resourceGroupName, serviceName, propId).GetAwaiter().GetResult(); - } - - /// - /// Gets the details of the property specified by its identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, propId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a property. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// Create parameters. - /// - /// - /// ETag of the Entity. Not required when creating an entity, but required when - /// updating an entity. - /// - public static PropertyContract CreateOrUpdate(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, PropertyContract parameters, string ifMatch = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, serviceName, propId, parameters, ifMatch).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a property. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// Create parameters. - /// - /// - /// ETag of the Entity. Not required when creating an entity, but required when - /// updating an entity. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, PropertyContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, propId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the specific property. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// Update parameters. - /// - /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. - /// - public static void Update(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, PropertyUpdateParameters parameters, string ifMatch) - { - operations.UpdateAsync(resourceGroupName, serviceName, propId, parameters, ifMatch).GetAwaiter().GetResult(); - } - - /// - /// Updates the specific property. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// Update parameters. - /// - /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, PropertyUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, propId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes specific property from the API Management service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. - /// - public static void Delete(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, string ifMatch) - { - operations.DeleteAsync(resourceGroupName, serviceName, propId, ifMatch).GetAwaiter().GetResult(); - } - - /// - /// Deletes specific property from the API Management service instance. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the API Management service. - /// - /// - /// Identifier of the property. - /// - /// - /// ETag of the Entity. ETag should match the current entity state from the - /// header response of the GET request or it should be * for unconditional - /// update. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IPropertyOperations operations, string resourceGroupName, string serviceName, string propId, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, propId, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists a collection of properties defined within a service instance. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByServiceNext(this IPropertyOperations operations, string nextPageLink) - { - return operations.ListByServiceNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists a collection of properties defined within a service instance. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByServiceNextAsync(this IPropertyOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SdkInfo_ApiManagementClient.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SdkInfo_ApiManagementClient.cs index b7ffcbc2c5ec..a8ad0fe0a64d 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SdkInfo_ApiManagementClient.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SdkInfo_ApiManagementClient.cs @@ -19,67 +19,67 @@ public static IEnumerable> ApiInfo_ApiManagementCl { return new Tuple[] { - new Tuple("ApiManagement", "Api", "2019-01-01"), - new Tuple("ApiManagement", "ApiDiagnostic", "2019-01-01"), - new Tuple("ApiManagement", "ApiExport", "2019-01-01"), - new Tuple("ApiManagement", "ApiIssue", "2019-01-01"), - new Tuple("ApiManagement", "ApiIssueAttachment", "2019-01-01"), - new Tuple("ApiManagement", "ApiIssueComment", "2019-01-01"), - new Tuple("ApiManagement", "ApiManagementOperations", "2019-01-01"), - new Tuple("ApiManagement", "ApiManagementService", "2019-01-01"), - new Tuple("ApiManagement", "ApiManagementServiceSkus", "2019-01-01"), - new Tuple("ApiManagement", "ApiOperation", "2019-01-01"), - new Tuple("ApiManagement", "ApiOperationPolicy", "2019-01-01"), - new Tuple("ApiManagement", "ApiPolicy", "2019-01-01"), - new Tuple("ApiManagement", "ApiProduct", "2019-01-01"), - new Tuple("ApiManagement", "ApiRelease", "2019-01-01"), - new Tuple("ApiManagement", "ApiRevision", "2019-01-01"), - new Tuple("ApiManagement", "ApiSchema", "2019-01-01"), - new Tuple("ApiManagement", "ApiTagDescription", "2019-01-01"), - new Tuple("ApiManagement", "ApiVersionSet", "2019-01-01"), - new Tuple("ApiManagement", "AuthorizationServer", "2019-01-01"), - new Tuple("ApiManagement", "Backend", "2019-01-01"), - new Tuple("ApiManagement", "Cache", "2019-01-01"), - new Tuple("ApiManagement", "Certificate", "2019-01-01"), - new Tuple("ApiManagement", "DelegationSettings", "2019-01-01"), - new Tuple("ApiManagement", "Diagnostic", "2019-01-01"), - new Tuple("ApiManagement", "EmailTemplate", "2019-01-01"), - new Tuple("ApiManagement", "Group", "2019-01-01"), - new Tuple("ApiManagement", "GroupUser", "2019-01-01"), - new Tuple("ApiManagement", "IdentityProvider", "2019-01-01"), - new Tuple("ApiManagement", "Issue", "2019-01-01"), - new Tuple("ApiManagement", "Logger", "2019-01-01"), - new Tuple("ApiManagement", "NetworkStatus", "2019-01-01"), - new Tuple("ApiManagement", "Notification", "2019-01-01"), - new Tuple("ApiManagement", "NotificationRecipientEmail", "2019-01-01"), - new Tuple("ApiManagement", "NotificationRecipientUser", "2019-01-01"), - new Tuple("ApiManagement", "OpenIdConnectProvider", "2019-01-01"), - new Tuple("ApiManagement", "Operation", "2019-01-01"), - new Tuple("ApiManagement", "Policy", "2019-01-01"), - new Tuple("ApiManagement", "PolicySnippet", "2019-01-01"), - new Tuple("ApiManagement", "Product", "2019-01-01"), - new Tuple("ApiManagement", "ProductApi", "2019-01-01"), - new Tuple("ApiManagement", "ProductGroup", "2019-01-01"), - new Tuple("ApiManagement", "ProductPolicy", "2019-01-01"), - new Tuple("ApiManagement", "ProductSubscriptions", "2019-01-01"), - new Tuple("ApiManagement", "Property", "2019-01-01"), - new Tuple("ApiManagement", "QuotaByCounterKeys", "2019-01-01"), - new Tuple("ApiManagement", "QuotaByPeriodKeys", "2019-01-01"), - new Tuple("ApiManagement", "Region", "2019-01-01"), - new Tuple("ApiManagement", "Reports", "2019-01-01"), - new Tuple("ApiManagement", "SignInSettings", "2019-01-01"), - new Tuple("ApiManagement", "SignUpSettings", "2019-01-01"), - new Tuple("ApiManagement", "Subscription", "2019-01-01"), - new Tuple("ApiManagement", "Tag", "2019-01-01"), - new Tuple("ApiManagement", "TagResource", "2019-01-01"), - new Tuple("ApiManagement", "TenantAccess", "2019-01-01"), - new Tuple("ApiManagement", "TenantAccessGit", "2019-01-01"), - new Tuple("ApiManagement", "TenantConfiguration", "2019-01-01"), - new Tuple("ApiManagement", "User", "2019-01-01"), - new Tuple("ApiManagement", "UserConfirmationPassword", "2019-01-01"), - new Tuple("ApiManagement", "UserGroup", "2019-01-01"), - new Tuple("ApiManagement", "UserIdentities", "2019-01-01"), - new Tuple("ApiManagement", "UserSubscription", "2019-01-01"), + new Tuple("ApiManagement", "Api", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiDiagnostic", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiExport", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiIssue", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiIssueAttachment", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiIssueComment", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiManagementOperations", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiManagementService", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiManagementServiceSkus", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiOperation", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiOperationPolicy", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiPolicy", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiProduct", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiRelease", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiRevision", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiSchema", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiTagDescription", "2019-12-01-preview"), + new Tuple("ApiManagement", "ApiVersionSet", "2019-12-01-preview"), + new Tuple("ApiManagement", "AuthorizationServer", "2019-12-01-preview"), + new Tuple("ApiManagement", "Backend", "2019-12-01-preview"), + new Tuple("ApiManagement", "Cache", "2019-12-01-preview"), + new Tuple("ApiManagement", "Certificate", "2019-12-01-preview"), + new Tuple("ApiManagement", "DelegationSettings", "2019-12-01-preview"), + new Tuple("ApiManagement", "Diagnostic", "2019-12-01-preview"), + new Tuple("ApiManagement", "EmailTemplate", "2019-12-01-preview"), + new Tuple("ApiManagement", "Group", "2019-12-01-preview"), + new Tuple("ApiManagement", "GroupUser", "2019-12-01-preview"), + new Tuple("ApiManagement", "IdentityProvider", "2019-12-01-preview"), + new Tuple("ApiManagement", "Issue", "2019-12-01-preview"), + new Tuple("ApiManagement", "Logger", "2019-12-01-preview"), + new Tuple("ApiManagement", "NamedValue", "2019-12-01-preview"), + new Tuple("ApiManagement", "NetworkStatus", "2019-12-01-preview"), + new Tuple("ApiManagement", "Notification", "2019-12-01-preview"), + new Tuple("ApiManagement", "NotificationRecipientEmail", "2019-12-01-preview"), + new Tuple("ApiManagement", "NotificationRecipientUser", "2019-12-01-preview"), + new Tuple("ApiManagement", "OpenIdConnectProvider", "2019-12-01-preview"), + new Tuple("ApiManagement", "Operation", "2019-12-01-preview"), + new Tuple("ApiManagement", "Policy", "2019-12-01-preview"), + new Tuple("ApiManagement", "PolicyDescription", "2019-12-01-preview"), + new Tuple("ApiManagement", "Product", "2019-12-01-preview"), + new Tuple("ApiManagement", "ProductApi", "2019-12-01-preview"), + new Tuple("ApiManagement", "ProductGroup", "2019-12-01-preview"), + new Tuple("ApiManagement", "ProductPolicy", "2019-12-01-preview"), + new Tuple("ApiManagement", "ProductSubscriptions", "2019-12-01-preview"), + new Tuple("ApiManagement", "QuotaByCounterKeys", "2019-12-01-preview"), + new Tuple("ApiManagement", "QuotaByPeriodKeys", "2019-12-01-preview"), + new Tuple("ApiManagement", "Region", "2019-12-01-preview"), + new Tuple("ApiManagement", "Reports", "2019-12-01-preview"), + new Tuple("ApiManagement", "SignInSettings", "2019-12-01-preview"), + new Tuple("ApiManagement", "SignUpSettings", "2019-12-01-preview"), + new Tuple("ApiManagement", "Subscription", "2019-12-01-preview"), + new Tuple("ApiManagement", "Tag", "2019-12-01-preview"), + new Tuple("ApiManagement", "TagResource", "2019-12-01-preview"), + new Tuple("ApiManagement", "TenantAccess", "2019-12-01-preview"), + new Tuple("ApiManagement", "TenantAccessGit", "2019-12-01-preview"), + new Tuple("ApiManagement", "TenantConfiguration", "2019-12-01-preview"), + new Tuple("ApiManagement", "User", "2019-12-01-preview"), + new Tuple("ApiManagement", "UserConfirmationPassword", "2019-12-01-preview"), + new Tuple("ApiManagement", "UserGroup", "2019-12-01-preview"), + new Tuple("ApiManagement", "UserIdentities", "2019-12-01-preview"), + new Tuple("ApiManagement", "UserSubscription", "2019-12-01-preview"), }.AsEnumerable(); } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperations.cs index d238054cd84b..3d9ab2b526cf 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperations.cs @@ -1917,6 +1917,233 @@ internal SubscriptionOperations(ApiManagementClient client) return _result; } + /// + /// Gets the subscription keys. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Subscription entity Identifier. The entity represents the association + /// between a user and a product in API Management. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, string sid, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (sid == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sid"); + } + if (sid != null) + { + if (sid.Length > 256) + { + throw new ValidationException(ValidationRules.MaxLength, "sid", 256); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(sid, "^[^*#&+:<>?]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "sid", "^[^*#&+:<>?]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("sid", sid); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{sid}", System.Uri.EscapeDataString(sid)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new 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; + } + /// /// Lists all subscriptions of the API Management service instance. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperationsExtensions.cs index 8ec106648b73..0f9fa47c71dc 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/SubscriptionOperationsExtensions.cs @@ -464,6 +464,54 @@ public static void RegenerateSecondaryKey(this ISubscriptionOperations operation (await operations.RegenerateSecondaryKeyWithHttpMessagesAsync(resourceGroupName, serviceName, sid, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the subscription keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Subscription entity Identifier. The entity represents the association + /// between a user and a product in API Management. + /// + public static SubscriptionKeysContract ListSecrets(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName, sid).GetAwaiter().GetResult(); + } + + /// + /// Gets the subscription keys. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// Subscription entity Identifier. The entity represents the association + /// between a user and a product in API Management. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, sid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all subscriptions of the API Management service instance. /// diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperations.cs index b53a99ec865e..ac90b302913d 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperations.cs @@ -51,7 +51,7 @@ internal TenantAccessGitOperations(ApiManagementClient client) public ApiManagementClient Client { get; private set; } /// - /// Gets the Git access configuration for the tenant. + /// Gets the Git access configuration for the tenant. Without secrets. /// /// /// The name of the resource group. @@ -648,5 +648,227 @@ internal TenantAccessGitOperations(ApiManagementClient client) return _result; } + /// + /// Gets the Git access configuration for the tenant. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string accessName = "access"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("accessName", accessName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{accessName}", System.Uri.EscapeDataString(accessName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperationsExtensions.cs index 661bec29afe0..9dfa50113aae 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessGitOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.ApiManagement public static partial class TenantAccessGitOperationsExtensions { /// - /// Gets the Git access configuration for the tenant. + /// Gets the Git access configuration for the tenant. Without secrets. /// /// /// The operations group for this extension method. @@ -39,7 +39,7 @@ public static AccessInformationContract Get(this ITenantAccessGitOperations oper } /// - /// Gets the Git access configuration for the tenant. + /// Gets the Git access configuration for the tenant. Without secrets. /// /// /// The operations group for this extension method. @@ -135,5 +135,45 @@ public static void RegenerateSecondaryKey(this ITenantAccessGitOperations operat (await operations.RegenerateSecondaryKeyWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets the Git access configuration for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + public static AccessInformationContract ListSecrets(this ITenantAccessGitOperations operations, string resourceGroupName, string serviceName) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the Git access configuration for the tenant. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this ITenantAccessGitOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperations.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperations.cs index fe15fa1826a7..f4bf5f60f90f 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperations.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperations.cs @@ -252,7 +252,7 @@ internal TenantAccessOperations(ApiManagementClient client) } /// - /// Get tenant access information details + /// Get tenant access information details without secrets. /// /// /// The name of the resource group. @@ -1069,5 +1069,227 @@ internal TenantAccessOperations(ApiManagementClient client) return _result; } + /// + /// Get tenant access information details. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// 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> ListSecretsWithHttpMessagesAsync(string resourceGroupName, string serviceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (serviceName != null) + { + if (serviceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "serviceName", 50); + } + if (serviceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "serviceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(serviceName, "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$")) + { + throw new ValidationException(ValidationRules.Pattern, "serviceName", "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string accessName = "access"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("accessName", accessName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListSecrets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{accessName}", System.Uri.EscapeDataString(accessName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // 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); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperationsExtensions.cs b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperationsExtensions.cs index 27fdddb10b6a..27595d0ee77a 100644 --- a/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperationsExtensions.cs +++ b/sdk/apimanagement/Microsoft.Azure.Management.ApiManagement/src/Generated/TenantAccessOperationsExtensions.cs @@ -62,7 +62,7 @@ public static TenantAccessGetEntityTagHeaders GetEntityTag(this ITenantAccessOpe } /// - /// Get tenant access information details + /// Get tenant access information details without secrets. /// /// /// The operations group for this extension method. @@ -79,7 +79,7 @@ public static AccessInformationContract Get(this ITenantAccessOperations operati } /// - /// Get tenant access information details + /// Get tenant access information details without secrets. /// /// /// The operations group for this extension method. @@ -228,5 +228,45 @@ public static void RegenerateSecondaryKey(this ITenantAccessOperations operation (await operations.RegenerateSecondaryKeyWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Get tenant access information details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + public static AccessInformationContract ListSecrets(this ITenantAccessOperations operations, string resourceGroupName, string serviceName) + { + return operations.ListSecretsAsync(resourceGroupName, serviceName).GetAwaiter().GetResult(); + } + + /// + /// Get tenant access information details. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the API Management service. + /// + /// + /// The cancellation token. + /// + public static async Task ListSecretsAsync(this ITenantAccessOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListSecretsWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } }