From fef6a5436167758454a9eb965ed1d7b3f8eb061b Mon Sep 17 00:00:00 2001 From: Ashraf Hamad Date: Mon, 6 Apr 2020 20:01:24 -0700 Subject: [PATCH] Regenerate EventGrid .NET SDK to reflect new swagger bug fixes for 20-04-01-preview (#10974) * Regenerate EventGrid .NET SDK to reflect new swagger bug fixes for 2020-04-01-preview * address CR comments Co-authored-by: Ashraf Hamad --- .../eventgrid_resource-manager.txt | 6 +- .../src/Generated/EventChannelsOperations.cs | 156 +++++++------ .../EventChannelsOperationsExtensions.cs | 49 +++++ .../Generated/EventGridManagementClient.cs | 4 +- .../src/Generated/IEventChannelsOperations.cs | 28 +++ ...artnerTopicEventSubscriptionsOperations.cs | 43 +++- .../IPrivateEndpointConnectionsOperations.cs | 10 +- ...SystemTopicEventSubscriptionsOperations.cs | 43 +++- .../src/Generated/Models/ConnectionState.cs | 2 +- .../src/Generated/Models/EventChannel.cs | 11 +- .../Generated/Models/EventChannelFilter.cs | 106 +++++++++ .../PartnerRegistrationUpdateParameters.cs | 11 +- .../Models/PrivateEndpointConnection.cs | 3 - .../Models/SkuDefinitionsForResourceType.cs | 65 ------ ...SkuDefinitionsForResourceTypeListResult.cs | 66 ------ .../src/Generated/Models/Topic.cs | 3 - ...artnerTopicEventSubscriptionsOperations.cs | 206 +++++++++++++++++- ...cEventSubscriptionsOperationsExtensions.cs | 78 ++++++- .../PrivateEndpointConnectionsOperations.cs | 23 +- ...EndpointConnectionsOperationsExtensions.cs | 28 ++- .../SdkInfo_EventGridManagementClient.cs | 4 +- ...SystemTopicEventSubscriptionsOperations.cs | 206 +++++++++++++++++- ...cEventSubscriptionsOperationsExtensions.cs | 78 ++++++- ...icrosoft.Azure.Management.EventGrid.csproj | 2 +- .../src/Properties/AssemblyInfo.cs | 2 +- 25 files changed, 987 insertions(+), 246 deletions(-) create mode 100644 sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannelFilter.cs delete mode 100644 sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceType.cs delete mode 100644 sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceTypeListResult.cs diff --git a/eng/mgmt/mgmtmetadata/eventgrid_resource-manager.txt b/eng/mgmt/mgmtmetadata/eventgrid_resource-manager.txt index 26b81790d4ae..290729f0a8db 100644 --- a/eng/mgmt/mgmtmetadata/eventgrid_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/eventgrid_resource-manager.txt @@ -3,12 +3,12 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\jedi2\net2\azure-sdk-for-net\sdk -2020-03-09 03:35:46 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\jedi2\newNet2\azure-sdk-for-net\sdk +2020-04-02 17:31:55 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 72a64f207b7a0549a698ca1e54a19e611d0bc906 +Commit: 06403e7bc48245ed97958874a6c11a8e58b15943 AutoRest information Requested version: latest Bootstrapper version: autorest@3.0.6187 diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperations.cs index dd8e82ea76f1..fa951df45f26 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperations.cs @@ -492,6 +492,45 @@ internal EventChannelsOperations(EventGridManagementClient client) /// Name of the event channel. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string eventChannelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, partnerNamespaceName, eventChannelName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List event channels. + /// + /// + /// List all the event channels in a partner namespace. + /// + /// + /// The name of the resource group within the user's subscription. + /// + /// + /// Name of the partner namespace. + /// + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// + /// /// Headers that will be added to request. /// /// @@ -500,6 +539,9 @@ internal EventChannelsOperations(EventGridManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -509,7 +551,7 @@ internal EventChannelsOperations(EventGridManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string eventChannelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByPartnerNamespaceWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -523,10 +565,6 @@ internal EventChannelsOperations(EventGridManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "partnerNamespaceName"); } - if (eventChannelName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "eventChannelName"); - } string apiVersion = "2020-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -537,23 +575,31 @@ internal EventChannelsOperations(EventGridManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("partnerNamespaceName", partnerNamespaceName); - tracingParameters.Add("eventChannelName", eventChannelName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByPartnerNamespace", 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.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{partnerNamespaceName}", System.Uri.EscapeDataString(partnerNamespaceName)); - _url = _url.Replace("{eventChannelName}", System.Uri.EscapeDataString(eventChannelName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -561,7 +607,7 @@ internal EventChannelsOperations(EventGridManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -612,7 +658,7 @@ internal EventChannelsOperations(EventGridManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -647,13 +693,31 @@ internal EventChannelsOperations(EventGridManagementClient 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); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -662,10 +726,10 @@ internal EventChannelsOperations(EventGridManagementClient client) } /// - /// List event channels. + /// Delete an event channel. /// /// - /// List all the event channels in a partner namespace. + /// Delete existing event channel. /// /// /// The name of the resource group within the user's subscription. @@ -673,19 +737,8 @@ internal EventChannelsOperations(EventGridManagementClient client) /// /// Name of the partner namespace. /// - /// - /// The query used to filter the search results using OData syntax. Filtering - /// is permitted on the 'name' property only and with limited number of OData - /// operations. These operations are: the 'contains' function as well as the - /// following logical operations: not, and, or, eq (for equal), and ne (for not - /// equal). No arithmetic operations are supported. The following is a valid - /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. - /// The following is not a valid filter example: $filter=location eq 'westus'. - /// - /// - /// The number of results to return per page for the list operation. Valid - /// range for top parameter is 1 to 100. If not specified, the default number - /// of results to be returned is 20 items per page. + /// + /// Name of the event channel. /// /// /// Headers that will be added to request. @@ -696,9 +749,6 @@ internal EventChannelsOperations(EventGridManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -708,7 +758,7 @@ internal EventChannelsOperations(EventGridManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByPartnerNamespaceWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string eventChannelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -722,6 +772,10 @@ internal EventChannelsOperations(EventGridManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "partnerNamespaceName"); } + if (eventChannelName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "eventChannelName"); + } string apiVersion = "2020-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -732,31 +786,23 @@ internal EventChannelsOperations(EventGridManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("partnerNamespaceName", partnerNamespaceName); + tracingParameters.Add("eventChannelName", eventChannelName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("filter", filter); - tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByPartnerNamespace", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{partnerNamespaceName}", System.Uri.EscapeDataString(partnerNamespaceName)); + _url = _url.Replace("{eventChannelName}", System.Uri.EscapeDataString(eventChannelName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - if (top != null) - { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -764,7 +810,7 @@ internal EventChannelsOperations(EventGridManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -815,7 +861,7 @@ internal EventChannelsOperations(EventGridManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -850,31 +896,13 @@ internal EventChannelsOperations(EventGridManagementClient 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); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperationsExtensions.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperationsExtensions.cs index ef2ea7974595..69bb2a0d215e 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperationsExtensions.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventChannelsOperationsExtensions.cs @@ -254,6 +254,55 @@ public static void Delete(this IEventChannelsOperations operations, string resou } } + /// + /// Delete an event channel. + /// + /// + /// Delete existing event channel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. + /// + /// + /// Name of the partner namespace. + /// + /// + /// Name of the event channel. + /// + public static void BeginDelete(this IEventChannelsOperations operations, string resourceGroupName, string partnerNamespaceName, string eventChannelName) + { + operations.BeginDeleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName).GetAwaiter().GetResult(); + } + + /// + /// Delete an event channel. + /// + /// + /// Delete existing event channel. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. + /// + /// + /// Name of the partner namespace. + /// + /// + /// Name of the event channel. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IEventChannelsOperations operations, string resourceGroupName, string partnerNamespaceName, string eventChannelName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, partnerNamespaceName, eventChannelName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// List event channels. /// diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventGridManagementClient.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventGridManagementClient.cs index 412b9b439527..9a220916c078 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventGridManagementClient.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/EventGridManagementClient.cs @@ -446,10 +446,10 @@ private void Initialize() }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("inputSchemaMappingType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("inputSchemaMappingType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("endpointType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("endpointType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("operatorType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("operatorType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("endpointType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("endpointType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("endpointType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("endpointType")); CustomInitialize(); diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IEventChannelsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IEventChannelsOperations.cs index 92dfdbe23381..e15cbd6411c7 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IEventChannelsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IEventChannelsOperations.cs @@ -162,6 +162,34 @@ public partial interface IEventChannelsOperations /// Task>> ListByPartnerNamespaceWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Delete an event channel. + /// + /// + /// Delete existing event channel. + /// + /// + /// The name of the resource group within the user's subscription. + /// + /// + /// Name of the partner namespace. + /// + /// + /// Name of the event channel. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string partnerNamespaceName, string eventChannelName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List event channels. /// /// diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPartnerTopicEventSubscriptionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPartnerTopicEventSubscriptionsOperations.cs index 553230da0c91..cca41c983ec4 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPartnerTopicEventSubscriptionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPartnerTopicEventSubscriptionsOperations.cs @@ -207,6 +207,22 @@ public partial interface IPartnerTopicEventSubscriptionsOperations /// /// Name of the partner topic. /// + /// + /// The query used to filter the search results using OData syntax. + /// Filtering is permitted on the 'name' property only and with limited + /// number of OData operations. These operations are: the 'contains' + /// function as well as the following logical operations: not, and, or, + /// eq (for equal), and ne (for not equal). No arithmetic operations + /// are supported. The following is a valid filter example: + /// $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + /// following is not a valid filter example: $filter=location eq + /// 'westus'. + /// + /// + /// The number of results to return per page for the list operation. + /// Valid range for top parameter is 1 to 100. If not specified, the + /// default number of results to be returned is 20 items per page. + /// /// /// The headers that will be added to request. /// @@ -222,7 +238,7 @@ public partial interface IPartnerTopicEventSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByPartnerTopicWithHttpMessagesAsync(string resourceGroupName, string partnerTopicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByPartnerTopicWithHttpMessagesAsync(string resourceGroupName, string partnerTopicName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update an event subscription of a partner topic. /// @@ -328,5 +344,30 @@ public partial interface IPartnerTopicEventSubscriptionsOperations /// Thrown when a required parameter is null /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string partnerTopicName, string eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List event subscriptions of a partner topic. + /// + /// + /// List event subscriptions that belong to a specific partner topic. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByPartnerTopicNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPrivateEndpointConnectionsOperations.cs index 13ae8f83c926..b4101f850684 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -80,6 +80,9 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// The headers that will be added to request. /// @@ -95,7 +98,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete a specific private endpoint connection. /// @@ -200,6 +203,9 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// The headers that will be added to request. /// @@ -215,7 +221,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete a specific private endpoint connection. /// diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/ISystemTopicEventSubscriptionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/ISystemTopicEventSubscriptionsOperations.cs index ab3332d5993e..a27356df6593 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/ISystemTopicEventSubscriptionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/ISystemTopicEventSubscriptionsOperations.cs @@ -207,6 +207,22 @@ public partial interface ISystemTopicEventSubscriptionsOperations /// /// Name of the system topic. /// + /// + /// The query used to filter the search results using OData syntax. + /// Filtering is permitted on the 'name' property only and with limited + /// number of OData operations. These operations are: the 'contains' + /// function as well as the following logical operations: not, and, or, + /// eq (for equal), and ne (for not equal). No arithmetic operations + /// are supported. The following is a valid filter example: + /// $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + /// following is not a valid filter example: $filter=location eq + /// 'westus'. + /// + /// + /// The number of results to return per page for the list operation. + /// Valid range for top parameter is 1 to 100. If not specified, the + /// default number of results to be returned is 20 items per page. + /// /// /// The headers that will be added to request. /// @@ -222,7 +238,7 @@ public partial interface ISystemTopicEventSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListBySystemTopicWithHttpMessagesAsync(string resourceGroupName, string systemTopicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySystemTopicWithHttpMessagesAsync(string resourceGroupName, string systemTopicName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update an event subscription for a system topic. /// @@ -328,5 +344,30 @@ public partial interface ISystemTopicEventSubscriptionsOperations /// Thrown when a required parameter is null /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string systemTopicName, string eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List event subscriptions of a system topic. + /// + /// + /// List event subscriptions that belong to a specific system topic. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListBySystemTopicNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/ConnectionState.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/ConnectionState.cs index 0e03fa8338df..5ff8982ae612 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/ConnectionState.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/ConnectionState.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.EventGrid.Models using System.Linq; /// - /// ConnectionState Information. + /// ConnectionState information. /// public partial class ConnectionState { diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannel.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannel.cs index f79f22330530..9a2ef0e09a97 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannel.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannel.cs @@ -43,12 +43,15 @@ public EventChannel() /// Provisioning state of the event /// channel. Possible values include: 'Creating', 'Updating', /// 'Deleting', 'Succeeded', 'Canceled', 'Failed' - public EventChannel(string id = default(string), string name = default(string), string type = default(string), EventChannelSource source = default(EventChannelSource), EventChannelDestination destination = default(EventChannelDestination), string provisioningState = default(string)) + /// Information about the filter for the event + /// channel. + public EventChannel(string id = default(string), string name = default(string), string type = default(string), EventChannelSource source = default(EventChannelSource), EventChannelDestination destination = default(EventChannelDestination), string provisioningState = default(string), EventChannelFilter filter = default(EventChannelFilter)) : base(id, name, type) { Source = source; Destination = destination; ProvisioningState = provisioningState; + Filter = filter; CustomInit(); } @@ -78,5 +81,11 @@ public EventChannel() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets information about the filter for the event channel. + /// + [JsonProperty(PropertyName = "properties.filter")] + public EventChannelFilter Filter { get; set; } + } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannelFilter.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannelFilter.cs new file mode 100644 index 000000000000..1b8362cc2552 --- /dev/null +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/EventChannelFilter.cs @@ -0,0 +1,106 @@ +// +// 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.EventGrid.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Filter for the Event Channel. + /// + public partial class EventChannelFilter + { + /// + /// Initializes a new instance of the EventChannelFilter class. + /// + public EventChannelFilter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EventChannelFilter class. + /// + /// An optional string to filter events + /// for an event channel based on a resource path prefix. + /// The format of this depends on the publisher of the events. Wildcard + /// characters are not supported in this path. + /// An optional string to filter events + /// for an event channel based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// A list of applicable event types + /// that need to be part of the event channel. If it is desired to + /// subscribe to all default event types, set the IncludedEventTypes to + /// null. + /// Specifies if the + /// SubjectBeginsWith and SubjectEndsWith properties of the filter + /// should be compared in a case sensitive manner. + /// An array of advanced filters that are + /// used for filtering event channels. + public EventChannelFilter(string subjectBeginsWith = default(string), string subjectEndsWith = default(string), IList includedEventTypes = default(IList), bool? isSubjectCaseSensitive = default(bool?), IList advancedFilters = default(IList)) + { + SubjectBeginsWith = subjectBeginsWith; + SubjectEndsWith = subjectEndsWith; + IncludedEventTypes = includedEventTypes; + IsSubjectCaseSensitive = isSubjectCaseSensitive; + AdvancedFilters = advancedFilters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an optional string to filter events for an event + /// channel based on a resource path prefix. + /// The format of this depends on the publisher of the events. Wildcard + /// characters are not supported in this path. + /// + [JsonProperty(PropertyName = "subjectBeginsWith")] + public string SubjectBeginsWith { get; set; } + + /// + /// Gets or sets an optional string to filter events for an event + /// channel based on a resource path suffix. + /// Wildcard characters are not supported in this path. + /// + [JsonProperty(PropertyName = "subjectEndsWith")] + public string SubjectEndsWith { get; set; } + + /// + /// Gets or sets a list of applicable event types that need to be part + /// of the event channel. If it is desired to subscribe to all default + /// event types, set the IncludedEventTypes to null. + /// + [JsonProperty(PropertyName = "includedEventTypes")] + public IList IncludedEventTypes { get; set; } + + /// + /// Gets or sets specifies if the SubjectBeginsWith and SubjectEndsWith + /// properties of the filter + /// should be compared in a case sensitive manner. + /// + [JsonProperty(PropertyName = "isSubjectCaseSensitive")] + public bool? IsSubjectCaseSensitive { get; set; } + + /// + /// Gets or sets an array of advanced filters that are used for + /// filtering event channels. + /// + [JsonProperty(PropertyName = "advancedFilters")] + public IList AdvancedFilters { get; set; } + + } +} diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PartnerRegistrationUpdateParameters.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PartnerRegistrationUpdateParameters.cs index 796934007a6d..5574b3a872f0 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PartnerRegistrationUpdateParameters.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PartnerRegistrationUpdateParameters.cs @@ -33,6 +33,8 @@ public PartnerRegistrationUpdateParameters() /// Initializes a new instance of the /// PartnerRegistrationUpdateParameters class. /// + /// Tags of the partner registration + /// resource. /// Name of the partner topic /// type. /// Display name of the @@ -50,8 +52,9 @@ public PartnerRegistrationUpdateParameters() /// partner namespaces is always permitted under the same Azure /// subscription as the one used /// for creating the partner registration. - public PartnerRegistrationUpdateParameters(string partnerTopicTypeName = default(string), string partnerTopicTypeDisplayName = default(string), string partnerTopicTypeDescription = default(string), string setupUri = default(string), string logoUri = default(string), IList authorizedAzureSubscriptionIds = default(IList)) + public PartnerRegistrationUpdateParameters(IDictionary tags = default(IDictionary), string partnerTopicTypeName = default(string), string partnerTopicTypeDisplayName = default(string), string partnerTopicTypeDescription = default(string), string setupUri = default(string), string logoUri = default(string), IList authorizedAzureSubscriptionIds = default(IList)) { + Tags = tags; PartnerTopicTypeName = partnerTopicTypeName; PartnerTopicTypeDisplayName = partnerTopicTypeDisplayName; PartnerTopicTypeDescription = partnerTopicTypeDescription; @@ -66,6 +69,12 @@ public PartnerRegistrationUpdateParameters() /// partial void CustomInit(); + /// + /// Gets or sets tags of the partner registration resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + /// /// Gets or sets name of the partner topic type. /// diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PrivateEndpointConnection.cs index 6ddaacf84cdd..e066ae3539d6 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/PrivateEndpointConnection.cs @@ -17,9 +17,6 @@ namespace Microsoft.Azure.Management.EventGrid.Models using System.Collections.Generic; using System.Linq; - /// - /// PrivateEndpointConnection resource information. - /// [Rest.Serialization.JsonTransformation] public partial class PrivateEndpointConnection : Resource { diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceType.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceType.cs deleted file mode 100644 index 9431e9f200b4..000000000000 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceType.cs +++ /dev/null @@ -1,65 +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.EventGrid.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Describes an EventGrid Resource Sku Definition. - /// - public partial class SkuDefinitionsForResourceType - { - /// - /// Initializes a new instance of the SkuDefinitionsForResourceType - /// class. - /// - public SkuDefinitionsForResourceType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SkuDefinitionsForResourceType - /// class. - /// - /// The Resource Type applicable for the - /// Sku. - /// The Sku pricing tiers for the resource - /// type. - public SkuDefinitionsForResourceType(string resourceType = default(string), IList skus = default(IList)) - { - ResourceType = resourceType; - Skus = skus; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Resource Type applicable for the Sku. - /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } - - /// - /// Gets or sets the Sku pricing tiers for the resource type. - /// - [JsonProperty(PropertyName = "skus")] - public IList Skus { get; set; } - - } -} diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceTypeListResult.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceTypeListResult.cs deleted file mode 100644 index b131b4f40770..000000000000 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/SkuDefinitionsForResourceTypeListResult.cs +++ /dev/null @@ -1,66 +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.EventGrid.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// List collection of Sku Definitions for each Resource Type. - /// - public partial class SkuDefinitionsForResourceTypeListResult - { - /// - /// Initializes a new instance of the - /// SkuDefinitionsForResourceTypeListResult class. - /// - public SkuDefinitionsForResourceTypeListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SkuDefinitionsForResourceTypeListResult class. - /// - /// A collection of Sku Definitions for each - /// Resource Type. - /// A link for the next page of Sku - /// Definitions. - public SkuDefinitionsForResourceTypeListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a collection of Sku Definitions for each Resource - /// Type. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Gets or sets a link for the next page of Sku Definitions. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - - } -} diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/Topic.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/Topic.cs index 65bd2e1af5b8..7ab54836de84 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/Topic.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/Models/Topic.cs @@ -40,8 +40,6 @@ public Topic() /// Name of the resource /// Type of the resource /// Tags of the resource. - /// List of private endpoint - /// connections. /// Provisioning state of the topic. /// Possible values include: 'Creating', 'Updating', 'Deleting', /// 'Succeeded', 'Canceled', 'Failed' @@ -89,7 +87,6 @@ public Topic() partial void CustomInit(); /// - /// Gets or sets list of private endpoint connections. /// [JsonProperty(PropertyName = "properties.privateEndpointConnections")] public IList PrivateEndpointConnections { get; set; } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperations.cs index 3b789ababdf2..4f7ba218525d 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperations.cs @@ -577,6 +577,20 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie /// /// Name of the partner topic. /// + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// /// /// Headers that will be added to request. /// @@ -598,7 +612,7 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie /// /// A response object containing the response body and response headers. /// - public async Task>> ListByPartnerTopicWithHttpMessagesAsync(string resourceGroupName, string partnerTopicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByPartnerTopicWithHttpMessagesAsync(string resourceGroupName, string partnerTopicName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -623,6 +637,8 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("partnerTopicName", partnerTopicName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByPartnerTopic", tracingParameters); } @@ -637,6 +653,14 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -730,7 +754,7 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie 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")) @@ -743,7 +767,7 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie _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) { @@ -1396,5 +1420,181 @@ internal PartnerTopicEventSubscriptionsOperations(EventGridManagementClient clie return _result; } + /// + /// List event subscriptions of a partner topic. + /// + /// + /// List event subscriptions that belong to a specific partner topic. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByPartnerTopicNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByPartnerTopicNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperationsExtensions.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperationsExtensions.cs index 6c6f2298d52b..9a7a46255f1f 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperationsExtensions.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PartnerTopicEventSubscriptionsOperationsExtensions.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.EventGrid using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -333,9 +331,23 @@ public static EventSubscriptionFullUrl GetFullUrl(this IPartnerTopicEventSubscri /// /// Name of the partner topic. /// - public static IEnumerable ListByPartnerTopic(this IPartnerTopicEventSubscriptionsOperations operations, string resourceGroupName, string partnerTopicName) + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// + public static IPage ListByPartnerTopic(this IPartnerTopicEventSubscriptionsOperations operations, string resourceGroupName, string partnerTopicName, string filter = default(string), int? top = default(int?)) { - return operations.ListByPartnerTopicAsync(resourceGroupName, partnerTopicName).GetAwaiter().GetResult(); + return operations.ListByPartnerTopicAsync(resourceGroupName, partnerTopicName, filter, top).GetAwaiter().GetResult(); } /// @@ -353,12 +365,26 @@ public static IEnumerable ListByPartnerTopic(this IPartnerTop /// /// Name of the partner topic. /// + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// /// /// The cancellation token. /// - public static async Task> ListByPartnerTopicAsync(this IPartnerTopicEventSubscriptionsOperations operations, string resourceGroupName, string partnerTopicName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByPartnerTopicAsync(this IPartnerTopicEventSubscriptionsOperations operations, string resourceGroupName, string partnerTopicName, string filter = default(string), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByPartnerTopicWithHttpMessagesAsync(resourceGroupName, partnerTopicName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByPartnerTopicWithHttpMessagesAsync(resourceGroupName, partnerTopicName, filter, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -547,5 +573,45 @@ public static EventSubscription BeginUpdate(this IPartnerTopicEventSubscriptions } } + /// + /// List event subscriptions of a partner topic. + /// + /// + /// List event subscriptions that belong to a specific partner topic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByPartnerTopicNext(this IPartnerTopicEventSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListByPartnerTopicNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List event subscriptions of a partner topic. + /// + /// + /// List event subscriptions that belong to a specific partner topic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPartnerTopicNextAsync(this IPartnerTopicEventSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPartnerTopicNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperations.cs index 7ff2763c2569..45e4325fd6e9 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -287,16 +287,19 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -585,6 +588,9 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// Headers that will be added to request. /// @@ -606,7 +612,7 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -628,6 +634,10 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } + if (privateEndpointConnection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnection"); + } string apiVersion = "2020-04-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -640,6 +650,7 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) tracingParameters.Add("parentType", parentType); tracingParameters.Add("parentName", parentName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); + tracingParameters.Add("privateEndpointConnection", privateEndpointConnection); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -695,6 +706,12 @@ internal PrivateEndpointConnectionsOperations(EventGridManagementClient client) // Serialize Request string _requestContent = null; + if(privateEndpointConnection != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(privateEndpointConnection, 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) { diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs index 4303b876c847..4de3470ab479 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -106,9 +106,12 @@ public static PrivateEndpointConnection Get(this IPrivateEndpointConnectionsOper /// /// The name of the private endpoint connection connection. /// - public static PrivateEndpointConnection Update(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName) + /// + /// The private endpoint connection object to update. + /// + public static PrivateEndpointConnection Update(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection) { - return operations.UpdateAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult(); } /// @@ -134,12 +137,15 @@ public static PrivateEndpointConnection Update(this IPrivateEndpointConnectionsO /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -311,9 +317,12 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, /// /// The name of the private endpoint connection connection. /// - public static PrivateEndpointConnection BeginUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName) + /// + /// The private endpoint connection object to update. + /// + public static PrivateEndpointConnection BeginUpdate(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection) { - return operations.BeginUpdateAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection).GetAwaiter().GetResult(); } /// @@ -339,12 +348,15 @@ public static PrivateEndpointConnection BeginUpdate(this IPrivateEndpointConnect /// /// The name of the private endpoint connection connection. /// + /// + /// The private endpoint connection object to update. + /// /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string parentType, string parentName, string privateEndpointConnectionName, PrivateEndpointConnection privateEndpointConnection, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SdkInfo_EventGridManagementClient.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SdkInfo_EventGridManagementClient.cs index e1613a58463b..ec5607ccd92b 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SdkInfo_EventGridManagementClient.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SdkInfo_EventGridManagementClient.cs @@ -26,10 +26,10 @@ public static IEnumerable> ApiInfo_EventGridManage // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "latest"; public static readonly String AutoRestBootStrapperVersion = "autorest@3.0.6187"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\jedi2\\net2\\azure-sdk-for-net\\sdk"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\jedi2\\newNet2\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "72a64f207b7a0549a698ca1e54a19e611d0bc906"; + public static readonly String GithubCommidId = "2ed98f188ac999acee5128bf171f030a8c07bd76"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperations.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperations.cs index 89fda1865cd1..694a8b9a039e 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperations.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperations.cs @@ -576,6 +576,20 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien /// /// Name of the system topic. /// + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// /// /// Headers that will be added to request. /// @@ -597,7 +611,7 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySystemTopicWithHttpMessagesAsync(string resourceGroupName, string systemTopicName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySystemTopicWithHttpMessagesAsync(string resourceGroupName, string systemTopicName, string filter = default(string), int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -622,6 +636,8 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("systemTopicName", systemTopicName); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); + tracingParameters.Add("top", top); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListBySystemTopic", tracingParameters); } @@ -636,6 +652,14 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -729,7 +753,7 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien 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")) @@ -742,7 +766,7 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien _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) { @@ -1394,5 +1418,181 @@ internal SystemTopicEventSubscriptionsOperations(EventGridManagementClient clien return _result; } + /// + /// List event subscriptions of a system topic. + /// + /// + /// List event subscriptions that belong to a specific system topic. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySystemTopicNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySystemTopicNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperationsExtensions.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperationsExtensions.cs index 393f5ef5a9a6..27721055b6da 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperationsExtensions.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Generated/SystemTopicEventSubscriptionsOperationsExtensions.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.EventGrid using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -331,9 +329,23 @@ public static EventSubscriptionFullUrl GetFullUrl(this ISystemTopicEventSubscrip /// /// Name of the system topic. /// - public static IEnumerable ListBySystemTopic(this ISystemTopicEventSubscriptionsOperations operations, string resourceGroupName, string systemTopicName) + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// + public static IPage ListBySystemTopic(this ISystemTopicEventSubscriptionsOperations operations, string resourceGroupName, string systemTopicName, string filter = default(string), int? top = default(int?)) { - return operations.ListBySystemTopicAsync(resourceGroupName, systemTopicName).GetAwaiter().GetResult(); + return operations.ListBySystemTopicAsync(resourceGroupName, systemTopicName, filter, top).GetAwaiter().GetResult(); } /// @@ -351,12 +363,26 @@ public static IEnumerable ListBySystemTopic(this ISystemTopic /// /// Name of the system topic. /// + /// + /// The query used to filter the search results using OData syntax. Filtering + /// is permitted on the 'name' property only and with limited number of OData + /// operations. These operations are: the 'contains' function as well as the + /// following logical operations: not, and, or, eq (for equal), and ne (for not + /// equal). No arithmetic operations are supported. The following is a valid + /// filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. + /// The following is not a valid filter example: $filter=location eq 'westus'. + /// + /// + /// The number of results to return per page for the list operation. Valid + /// range for top parameter is 1 to 100. If not specified, the default number + /// of results to be returned is 20 items per page. + /// /// /// The cancellation token. /// - public static async Task> ListBySystemTopicAsync(this ISystemTopicEventSubscriptionsOperations operations, string resourceGroupName, string systemTopicName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListBySystemTopicAsync(this ISystemTopicEventSubscriptionsOperations operations, string resourceGroupName, string systemTopicName, string filter = default(string), int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListBySystemTopicWithHttpMessagesAsync(resourceGroupName, systemTopicName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListBySystemTopicWithHttpMessagesAsync(resourceGroupName, systemTopicName, filter, top, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -543,5 +569,45 @@ public static EventSubscription BeginUpdate(this ISystemTopicEventSubscriptionsO } } + /// + /// List event subscriptions of a system topic. + /// + /// + /// List event subscriptions that belong to a specific system topic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySystemTopicNext(this ISystemTopicEventSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListBySystemTopicNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List event subscriptions of a system topic. + /// + /// + /// List event subscriptions that belong to a specific system topic. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySystemTopicNextAsync(this ISystemTopicEventSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySystemTopicNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Microsoft.Azure.Management.EventGrid.csproj b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Microsoft.Azure.Management.EventGrid.csproj index 8c42a0c008ff..d352dd177e7c 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Microsoft.Azure.Management.EventGrid.csproj +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Microsoft.Azure.Management.EventGrid.csproj @@ -6,7 +6,7 @@ Microsoft.Azure.Management.EventGrid Provides developers with a library to create and manage all Azure EventGrid resources. - 5.3.0-preview + 5.3.1-preview Microsoft.Azure.Management.EventGrid Microsoft Azure EventGrid Management;Event Grid;Event Grid management; This corresponds to the 2020-04-01-Preview API version which includes the following new functionality: Support for IP Filtering when publishing events to Domains and Topics, Partner topics, system topics, SKU, MSI and private link support. diff --git a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Properties/AssemblyInfo.cs b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Properties/AssemblyInfo.cs index 13408d9662dc..2982daf9eca3 100644 --- a/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Properties/AssemblyInfo.cs +++ b/sdk/eventgrid/Microsoft.Azure.Management.EventGrid/src/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides developers with a library to create and manage all Azure EventGrid resources.")] [assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.3.0.0")] +[assembly: AssemblyFileVersion("5.3.1.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")]