azure_mgmt_event_grid 0.17.8 → 0.17.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  3. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  4. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  5. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  6. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  7. data/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  8. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  9. data/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  10. data/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  11. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid.rb +97 -0
  12. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb +699 -0
  13. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/domains.rb +1328 -0
  14. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +153 -0
  15. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +3648 -0
  16. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb +74 -0
  17. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb +86 -0
  18. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb +69 -0
  19. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb +50 -0
  20. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain.rb +187 -0
  21. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb +20 -0
  22. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb +46 -0
  23. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb +57 -0
  24. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb +75 -0
  25. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb +20 -0
  26. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb +98 -0
  27. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb +54 -0
  28. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb +98 -0
  29. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb +17 -0
  30. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +62 -0
  31. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb +189 -0
  32. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +52 -0
  33. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +120 -0
  34. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  35. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +21 -0
  36. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +137 -0
  37. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +98 -0
  38. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_type.rb +106 -0
  39. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  40. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb +64 -0
  41. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb +59 -0
  42. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/input_schema.rb +17 -0
  43. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb +49 -0
  44. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb +15 -0
  45. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/json_field.rb +50 -0
  46. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb +67 -0
  47. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb +130 -0
  48. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb +69 -0
  49. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb +69 -0
  50. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb +77 -0
  51. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb +69 -0
  52. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb +69 -0
  53. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb +77 -0
  54. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  55. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  56. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  57. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/resource.rb +80 -0
  58. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  59. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb +57 -0
  60. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb +63 -0
  61. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb +64 -0
  62. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb +74 -0
  63. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb +75 -0
  64. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb +77 -0
  65. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb +77 -0
  66. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb +77 -0
  67. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb +77 -0
  68. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb +77 -0
  69. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic.rb +189 -0
  70. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  71. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  72. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  73. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb +150 -0
  74. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  75. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  76. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +54 -0
  77. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb +98 -0
  78. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  79. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +122 -0
  80. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  81. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/operations.rb +118 -0
  82. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/topic_types.rb +305 -0
  83. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/topics.rb +1439 -0
  84. data/lib/azure_mgmt_event_grid.rb +15 -14
  85. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +327 -319
  86. data/lib/version.rb +7 -7
  87. metadata +76 -4
@@ -0,0 +1,1439 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::EventGrid::Mgmt::V2020_04_01_preview
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class Topics
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Topics class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventGridManagementClient] reference to the EventGridManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get a topic.
26
+ #
27
+ # Get properties of a topic.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group within the
30
+ # user's subscription.
31
+ # @param topic_name [String] Name of the topic.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Topic] operation results.
36
+ #
37
+ def get(resource_group_name, topic_name, custom_headers:nil)
38
+ response = get_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Get a topic.
44
+ #
45
+ # Get properties of a topic.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group within the
48
+ # user's subscription.
49
+ # @param topic_name [String] Name of the topic.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, topic_name, custom_headers:nil)
56
+ get_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get a topic.
61
+ #
62
+ # Get properties of a topic.
63
+ #
64
+ # @param resource_group_name [String] The name of the resource group within the
65
+ # user's subscription.
66
+ # @param topic_name [String] Name of the topic.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, topic_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Create a topic.
129
+ #
130
+ # Asynchronously creates a new topic with the specified parameters.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group within the
133
+ # user's subscription.
134
+ # @param topic_name [String] Name of the topic.
135
+ # @param topic_info [Topic] Topic information.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [Topic] operation results.
140
+ #
141
+ def create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil)
142
+ response = create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group within the
148
+ # user's subscription.
149
+ # @param topic_name [String] Name of the topic.
150
+ # @param topic_info [Topic] Topic information.
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [Concurrent::Promise] promise which provides async access to http
155
+ # response.
156
+ #
157
+ def create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:nil)
158
+ # Send request
159
+ promise = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers)
160
+
161
+ promise = promise.then do |response|
162
+ # Defining deserialization method.
163
+ deserialize_method = lambda do |parsed_response|
164
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
165
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
166
+ end
167
+
168
+ # Waiting for response.
169
+ @client.get_long_running_operation_result(response, deserialize_method)
170
+ end
171
+
172
+ promise
173
+ end
174
+
175
+ #
176
+ # Delete a topic.
177
+ #
178
+ # Delete existing topic.
179
+ #
180
+ # @param resource_group_name [String] The name of the resource group within the
181
+ # user's subscription.
182
+ # @param topic_name [String] Name of the topic.
183
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
184
+ # will be added to the HTTP request.
185
+ #
186
+ def delete(resource_group_name, topic_name, custom_headers:nil)
187
+ response = delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
188
+ nil
189
+ end
190
+
191
+ #
192
+ # @param resource_group_name [String] The name of the resource group within the
193
+ # user's subscription.
194
+ # @param topic_name [String] Name of the topic.
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [Concurrent::Promise] promise which provides async access to http
199
+ # response.
200
+ #
201
+ def delete_async(resource_group_name, topic_name, custom_headers:nil)
202
+ # Send request
203
+ promise = begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers)
204
+
205
+ promise = promise.then do |response|
206
+ # Defining deserialization method.
207
+ deserialize_method = lambda do |parsed_response|
208
+ end
209
+
210
+ # Waiting for response.
211
+ @client.get_long_running_operation_result(response, deserialize_method)
212
+ end
213
+
214
+ promise
215
+ end
216
+
217
+ #
218
+ # Update a topic.
219
+ #
220
+ # Asynchronously updates a topic with the specified parameters.
221
+ #
222
+ # @param resource_group_name [String] The name of the resource group within the
223
+ # user's subscription.
224
+ # @param topic_name [String] Name of the topic.
225
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
226
+ # information.
227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
228
+ # will be added to the HTTP request.
229
+ #
230
+ # @return [Topic] operation results.
231
+ #
232
+ def update(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
233
+ response = update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value!
234
+ response.body unless response.nil?
235
+ end
236
+
237
+ #
238
+ # @param resource_group_name [String] The name of the resource group within the
239
+ # user's subscription.
240
+ # @param topic_name [String] Name of the topic.
241
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
242
+ # information.
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [Concurrent::Promise] promise which provides async access to http
247
+ # response.
248
+ #
249
+ def update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
250
+ # Send request
251
+ promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers)
252
+
253
+ promise = promise.then do |response|
254
+ # Defining deserialization method.
255
+ deserialize_method = lambda do |parsed_response|
256
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
257
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
258
+ end
259
+
260
+ # Waiting for response.
261
+ @client.get_long_running_operation_result(response, deserialize_method)
262
+ end
263
+
264
+ promise
265
+ end
266
+
267
+ #
268
+ # List topics under an Azure subscription.
269
+ #
270
+ # List all the topics under an Azure subscription.
271
+ #
272
+ # @param filter [String] The query used to filter the search results using
273
+ # OData syntax. Filtering is permitted on the 'name' property only and with
274
+ # limited number of OData operations. These operations are: the 'contains'
275
+ # function as well as the following logical operations: not, and, or, eq (for
276
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
277
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
278
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
279
+ # $filter=location eq 'westus'.
280
+ # @param top [Integer] The number of results to return per page for the list
281
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
282
+ # default number of results to be returned is 20 items per page.
283
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
284
+ # will be added to the HTTP request.
285
+ #
286
+ # @return [Array<Topic>] operation results.
287
+ #
288
+ def list_by_subscription(filter:nil, top:nil, custom_headers:nil)
289
+ first_page = list_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
290
+ first_page.get_all_items
291
+ end
292
+
293
+ #
294
+ # List topics under an Azure subscription.
295
+ #
296
+ # List all the topics under an Azure subscription.
297
+ #
298
+ # @param filter [String] The query used to filter the search results using
299
+ # OData syntax. Filtering is permitted on the 'name' property only and with
300
+ # limited number of OData operations. These operations are: the 'contains'
301
+ # function as well as the following logical operations: not, and, or, eq (for
302
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
303
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
304
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
305
+ # $filter=location eq 'westus'.
306
+ # @param top [Integer] The number of results to return per page for the list
307
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
308
+ # default number of results to be returned is 20 items per page.
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
313
+ #
314
+ def list_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil)
315
+ list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
316
+ end
317
+
318
+ #
319
+ # List topics under an Azure subscription.
320
+ #
321
+ # List all the topics under an Azure subscription.
322
+ #
323
+ # @param filter [String] The query used to filter the search results using
324
+ # OData syntax. Filtering is permitted on the 'name' property only and with
325
+ # limited number of OData operations. These operations are: the 'contains'
326
+ # function as well as the following logical operations: not, and, or, eq (for
327
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
328
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
329
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
330
+ # $filter=location eq 'westus'.
331
+ # @param top [Integer] The number of results to return per page for the list
332
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
333
+ # default number of results to be returned is 20 items per page.
334
+ # @param [Hash{String => String}] A hash of custom headers that will be added
335
+ # to the HTTP request.
336
+ #
337
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
338
+ #
339
+ def list_by_subscription_async(filter:nil, top:nil, custom_headers:nil)
340
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
342
+
343
+
344
+ request_headers = {}
345
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
346
+
347
+ # Set Headers
348
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics'
351
+
352
+ request_url = @base_url || @client.base_url
353
+
354
+ options = {
355
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
+ path_params: {'subscriptionId' => @client.subscription_id},
357
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
358
+ headers: request_headers.merge(custom_headers || {}),
359
+ base_url: request_url
360
+ }
361
+ promise = @client.make_request_async(:get, path_template, options)
362
+
363
+ promise = promise.then do |result|
364
+ http_response = result.response
365
+ status_code = http_response.status
366
+ response_content = http_response.body
367
+ unless status_code == 200
368
+ error_model = JSON.load(response_content)
369
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
370
+ end
371
+
372
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
373
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
374
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
375
+ # Deserialize Response
376
+ if status_code == 200
377
+ begin
378
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
379
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult.mapper()
380
+ result.body = @client.deserialize(result_mapper, parsed_response)
381
+ rescue Exception => e
382
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
383
+ end
384
+ end
385
+
386
+ result
387
+ end
388
+
389
+ promise.execute
390
+ end
391
+
392
+ #
393
+ # List topics under a resource group.
394
+ #
395
+ # List all the topics under a resource group.
396
+ #
397
+ # @param resource_group_name [String] The name of the resource group within the
398
+ # user's subscription.
399
+ # @param filter [String] The query used to filter the search results using
400
+ # OData syntax. Filtering is permitted on the 'name' property only and with
401
+ # limited number of OData operations. These operations are: the 'contains'
402
+ # function as well as the following logical operations: not, and, or, eq (for
403
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
404
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
405
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
406
+ # $filter=location eq 'westus'.
407
+ # @param top [Integer] The number of results to return per page for the list
408
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
409
+ # default number of results to be returned is 20 items per page.
410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
411
+ # will be added to the HTTP request.
412
+ #
413
+ # @return [Array<Topic>] operation results.
414
+ #
415
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
416
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
417
+ first_page.get_all_items
418
+ end
419
+
420
+ #
421
+ # List topics under a resource group.
422
+ #
423
+ # List all the topics under a resource group.
424
+ #
425
+ # @param resource_group_name [String] The name of the resource group within the
426
+ # user's subscription.
427
+ # @param filter [String] The query used to filter the search results using
428
+ # OData syntax. Filtering is permitted on the 'name' property only and with
429
+ # limited number of OData operations. These operations are: the 'contains'
430
+ # function as well as the following logical operations: not, and, or, eq (for
431
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
432
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
433
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
434
+ # $filter=location eq 'westus'.
435
+ # @param top [Integer] The number of results to return per page for the list
436
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
437
+ # default number of results to be returned is 20 items per page.
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
442
+ #
443
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
444
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
445
+ end
446
+
447
+ #
448
+ # List topics under a resource group.
449
+ #
450
+ # List all the topics under a resource group.
451
+ #
452
+ # @param resource_group_name [String] The name of the resource group within the
453
+ # user's subscription.
454
+ # @param filter [String] The query used to filter the search results using
455
+ # OData syntax. Filtering is permitted on the 'name' property only and with
456
+ # limited number of OData operations. These operations are: the 'contains'
457
+ # function as well as the following logical operations: not, and, or, eq (for
458
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
459
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
460
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
461
+ # $filter=location eq 'westus'.
462
+ # @param top [Integer] The number of results to return per page for the list
463
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
464
+ # default number of results to be returned is 20 items per page.
465
+ # @param [Hash{String => String}] A hash of custom headers that will be added
466
+ # to the HTTP request.
467
+ #
468
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
469
+ #
470
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
471
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
472
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
473
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
474
+
475
+
476
+ request_headers = {}
477
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
478
+
479
+ # Set Headers
480
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
481
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
482
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics'
483
+
484
+ request_url = @base_url || @client.base_url
485
+
486
+ options = {
487
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
488
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
489
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
490
+ headers: request_headers.merge(custom_headers || {}),
491
+ base_url: request_url
492
+ }
493
+ promise = @client.make_request_async(:get, path_template, options)
494
+
495
+ promise = promise.then do |result|
496
+ http_response = result.response
497
+ status_code = http_response.status
498
+ response_content = http_response.body
499
+ unless status_code == 200
500
+ error_model = JSON.load(response_content)
501
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
502
+ end
503
+
504
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
505
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
506
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
507
+ # Deserialize Response
508
+ if status_code == 200
509
+ begin
510
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
511
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult.mapper()
512
+ result.body = @client.deserialize(result_mapper, parsed_response)
513
+ rescue Exception => e
514
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
515
+ end
516
+ end
517
+
518
+ result
519
+ end
520
+
521
+ promise.execute
522
+ end
523
+
524
+ #
525
+ # List keys for a topic.
526
+ #
527
+ # List the two keys used to publish to a topic.
528
+ #
529
+ # @param resource_group_name [String] The name of the resource group within the
530
+ # user's subscription.
531
+ # @param topic_name [String] Name of the topic.
532
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
533
+ # will be added to the HTTP request.
534
+ #
535
+ # @return [TopicSharedAccessKeys] operation results.
536
+ #
537
+ def list_shared_access_keys(resource_group_name, topic_name, custom_headers:nil)
538
+ response = list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
539
+ response.body unless response.nil?
540
+ end
541
+
542
+ #
543
+ # List keys for a topic.
544
+ #
545
+ # List the two keys used to publish to a topic.
546
+ #
547
+ # @param resource_group_name [String] The name of the resource group within the
548
+ # user's subscription.
549
+ # @param topic_name [String] Name of the topic.
550
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
551
+ # will be added to the HTTP request.
552
+ #
553
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
554
+ #
555
+ def list_shared_access_keys_with_http_info(resource_group_name, topic_name, custom_headers:nil)
556
+ list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
557
+ end
558
+
559
+ #
560
+ # List keys for a topic.
561
+ #
562
+ # List the two keys used to publish to a topic.
563
+ #
564
+ # @param resource_group_name [String] The name of the resource group within the
565
+ # user's subscription.
566
+ # @param topic_name [String] Name of the topic.
567
+ # @param [Hash{String => String}] A hash of custom headers that will be added
568
+ # to the HTTP request.
569
+ #
570
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
571
+ #
572
+ def list_shared_access_keys_async(resource_group_name, topic_name, custom_headers:nil)
573
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
574
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
575
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
576
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
577
+
578
+
579
+ request_headers = {}
580
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
581
+
582
+ # Set Headers
583
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
584
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
585
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys'
586
+
587
+ request_url = @base_url || @client.base_url
588
+
589
+ options = {
590
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
591
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
592
+ query_params: {'api-version' => @client.api_version},
593
+ headers: request_headers.merge(custom_headers || {}),
594
+ base_url: request_url
595
+ }
596
+ promise = @client.make_request_async(:post, path_template, options)
597
+
598
+ promise = promise.then do |result|
599
+ http_response = result.response
600
+ status_code = http_response.status
601
+ response_content = http_response.body
602
+ unless status_code == 200
603
+ error_model = JSON.load(response_content)
604
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
605
+ end
606
+
607
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
608
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
609
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
610
+ # Deserialize Response
611
+ if status_code == 200
612
+ begin
613
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
614
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys.mapper()
615
+ result.body = @client.deserialize(result_mapper, parsed_response)
616
+ rescue Exception => e
617
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
618
+ end
619
+ end
620
+
621
+ result
622
+ end
623
+
624
+ promise.execute
625
+ end
626
+
627
+ #
628
+ # Regenerate key for a topic.
629
+ #
630
+ # Regenerate a shared access key for a topic.
631
+ #
632
+ # @param resource_group_name [String] The name of the resource group within the
633
+ # user's subscription.
634
+ # @param topic_name [String] Name of the topic.
635
+ # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to
636
+ # regenerate key.
637
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
638
+ # will be added to the HTTP request.
639
+ #
640
+ # @return [TopicSharedAccessKeys] operation results.
641
+ #
642
+ def regenerate_key(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil)
643
+ response = regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:custom_headers).value!
644
+ response.body unless response.nil?
645
+ end
646
+
647
+ #
648
+ # Regenerate key for a topic.
649
+ #
650
+ # Regenerate a shared access key for a topic.
651
+ #
652
+ # @param resource_group_name [String] The name of the resource group within the
653
+ # user's subscription.
654
+ # @param topic_name [String] Name of the topic.
655
+ # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to
656
+ # regenerate key.
657
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
658
+ # will be added to the HTTP request.
659
+ #
660
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
661
+ #
662
+ def regenerate_key_with_http_info(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil)
663
+ regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:custom_headers).value!
664
+ end
665
+
666
+ #
667
+ # Regenerate key for a topic.
668
+ #
669
+ # Regenerate a shared access key for a topic.
670
+ #
671
+ # @param resource_group_name [String] The name of the resource group within the
672
+ # user's subscription.
673
+ # @param topic_name [String] Name of the topic.
674
+ # @param regenerate_key_request [TopicRegenerateKeyRequest] Request body to
675
+ # regenerate key.
676
+ # @param [Hash{String => String}] A hash of custom headers that will be added
677
+ # to the HTTP request.
678
+ #
679
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
680
+ #
681
+ def regenerate_key_async(resource_group_name, topic_name, regenerate_key_request, custom_headers:nil)
682
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
683
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
684
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
685
+ fail ArgumentError, 'regenerate_key_request is nil' if regenerate_key_request.nil?
686
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
687
+
688
+
689
+ request_headers = {}
690
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
691
+
692
+ # Set Headers
693
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
694
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
695
+
696
+ # Serialize Request
697
+ request_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicRegenerateKeyRequest.mapper()
698
+ request_content = @client.serialize(request_mapper, regenerate_key_request)
699
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
700
+
701
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey'
702
+
703
+ request_url = @base_url || @client.base_url
704
+
705
+ options = {
706
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
707
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
708
+ query_params: {'api-version' => @client.api_version},
709
+ body: request_content,
710
+ headers: request_headers.merge(custom_headers || {}),
711
+ base_url: request_url
712
+ }
713
+ promise = @client.make_request_async(:post, path_template, options)
714
+
715
+ promise = promise.then do |result|
716
+ http_response = result.response
717
+ status_code = http_response.status
718
+ response_content = http_response.body
719
+ unless status_code == 200
720
+ error_model = JSON.load(response_content)
721
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
722
+ end
723
+
724
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
725
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
726
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
727
+ # Deserialize Response
728
+ if status_code == 200
729
+ begin
730
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
731
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicSharedAccessKeys.mapper()
732
+ result.body = @client.deserialize(result_mapper, parsed_response)
733
+ rescue Exception => e
734
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
735
+ end
736
+ end
737
+
738
+ result
739
+ end
740
+
741
+ promise.execute
742
+ end
743
+
744
+ #
745
+ # List topic event types.
746
+ #
747
+ # List event types for a topic.
748
+ #
749
+ # @param resource_group_name [String] The name of the resource group within the
750
+ # user's subscription.
751
+ # @param provider_namespace [String] Namespace of the provider of the topic.
752
+ # @param resource_type_name [String] Name of the topic type.
753
+ # @param resource_name [String] Name of the topic.
754
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
755
+ # will be added to the HTTP request.
756
+ #
757
+ # @return [EventTypesListResult] operation results.
758
+ #
759
+ def list_event_types(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil)
760
+ response = list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:custom_headers).value!
761
+ response.body unless response.nil?
762
+ end
763
+
764
+ #
765
+ # List topic event types.
766
+ #
767
+ # List event types for a topic.
768
+ #
769
+ # @param resource_group_name [String] The name of the resource group within the
770
+ # user's subscription.
771
+ # @param provider_namespace [String] Namespace of the provider of the topic.
772
+ # @param resource_type_name [String] Name of the topic type.
773
+ # @param resource_name [String] Name of the topic.
774
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
775
+ # will be added to the HTTP request.
776
+ #
777
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
778
+ #
779
+ def list_event_types_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil)
780
+ list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:custom_headers).value!
781
+ end
782
+
783
+ #
784
+ # List topic event types.
785
+ #
786
+ # List event types for a topic.
787
+ #
788
+ # @param resource_group_name [String] The name of the resource group within the
789
+ # user's subscription.
790
+ # @param provider_namespace [String] Namespace of the provider of the topic.
791
+ # @param resource_type_name [String] Name of the topic type.
792
+ # @param resource_name [String] Name of the topic.
793
+ # @param [Hash{String => String}] A hash of custom headers that will be added
794
+ # to the HTTP request.
795
+ #
796
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
797
+ #
798
+ def list_event_types_async(resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers:nil)
799
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
800
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
801
+ fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil?
802
+ fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil?
803
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
804
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
805
+
806
+
807
+ request_headers = {}
808
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
809
+
810
+ # Set Headers
811
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
812
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
813
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes'
814
+
815
+ request_url = @base_url || @client.base_url
816
+
817
+ options = {
818
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
819
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name},
820
+ query_params: {'api-version' => @client.api_version},
821
+ headers: request_headers.merge(custom_headers || {}),
822
+ base_url: request_url
823
+ }
824
+ promise = @client.make_request_async(:get, path_template, options)
825
+
826
+ promise = promise.then do |result|
827
+ http_response = result.response
828
+ status_code = http_response.status
829
+ response_content = http_response.body
830
+ unless status_code == 200
831
+ error_model = JSON.load(response_content)
832
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
833
+ end
834
+
835
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
836
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
837
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
838
+ # Deserialize Response
839
+ if status_code == 200
840
+ begin
841
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
842
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::EventTypesListResult.mapper()
843
+ result.body = @client.deserialize(result_mapper, parsed_response)
844
+ rescue Exception => e
845
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
846
+ end
847
+ end
848
+
849
+ result
850
+ end
851
+
852
+ promise.execute
853
+ end
854
+
855
+ #
856
+ # Create a topic.
857
+ #
858
+ # Asynchronously creates a new topic with the specified parameters.
859
+ #
860
+ # @param resource_group_name [String] The name of the resource group within the
861
+ # user's subscription.
862
+ # @param topic_name [String] Name of the topic.
863
+ # @param topic_info [Topic] Topic information.
864
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
865
+ # will be added to the HTTP request.
866
+ #
867
+ # @return [Topic] operation results.
868
+ #
869
+ def begin_create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil)
870
+ response = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
871
+ response.body unless response.nil?
872
+ end
873
+
874
+ #
875
+ # Create a topic.
876
+ #
877
+ # Asynchronously creates a new topic with the specified parameters.
878
+ #
879
+ # @param resource_group_name [String] The name of the resource group within the
880
+ # user's subscription.
881
+ # @param topic_name [String] Name of the topic.
882
+ # @param topic_info [Topic] Topic information.
883
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
884
+ # will be added to the HTTP request.
885
+ #
886
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
887
+ #
888
+ def begin_create_or_update_with_http_info(resource_group_name, topic_name, topic_info, custom_headers:nil)
889
+ begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
890
+ end
891
+
892
+ #
893
+ # Create a topic.
894
+ #
895
+ # Asynchronously creates a new topic with the specified parameters.
896
+ #
897
+ # @param resource_group_name [String] The name of the resource group within the
898
+ # user's subscription.
899
+ # @param topic_name [String] Name of the topic.
900
+ # @param topic_info [Topic] Topic information.
901
+ # @param [Hash{String => String}] A hash of custom headers that will be added
902
+ # to the HTTP request.
903
+ #
904
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
905
+ #
906
+ def begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:nil)
907
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
908
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
909
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
910
+ fail ArgumentError, 'topic_info is nil' if topic_info.nil?
911
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
912
+
913
+
914
+ request_headers = {}
915
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
916
+
917
+ # Set Headers
918
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
919
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
920
+
921
+ # Serialize Request
922
+ request_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
923
+ request_content = @client.serialize(request_mapper, topic_info)
924
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
925
+
926
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
927
+
928
+ request_url = @base_url || @client.base_url
929
+
930
+ options = {
931
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
932
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
933
+ query_params: {'api-version' => @client.api_version},
934
+ body: request_content,
935
+ headers: request_headers.merge(custom_headers || {}),
936
+ base_url: request_url
937
+ }
938
+ promise = @client.make_request_async(:put, path_template, options)
939
+
940
+ promise = promise.then do |result|
941
+ http_response = result.response
942
+ status_code = http_response.status
943
+ response_content = http_response.body
944
+ unless status_code == 201
945
+ error_model = JSON.load(response_content)
946
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
947
+ end
948
+
949
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
950
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
951
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
952
+ # Deserialize Response
953
+ if status_code == 201
954
+ begin
955
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
956
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
957
+ result.body = @client.deserialize(result_mapper, parsed_response)
958
+ rescue Exception => e
959
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
960
+ end
961
+ end
962
+
963
+ result
964
+ end
965
+
966
+ promise.execute
967
+ end
968
+
969
+ #
970
+ # Delete a topic.
971
+ #
972
+ # Delete existing topic.
973
+ #
974
+ # @param resource_group_name [String] The name of the resource group within the
975
+ # user's subscription.
976
+ # @param topic_name [String] Name of the topic.
977
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
978
+ # will be added to the HTTP request.
979
+ #
980
+ #
981
+ def begin_delete(resource_group_name, topic_name, custom_headers:nil)
982
+ response = begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
983
+ nil
984
+ end
985
+
986
+ #
987
+ # Delete a topic.
988
+ #
989
+ # Delete existing topic.
990
+ #
991
+ # @param resource_group_name [String] The name of the resource group within the
992
+ # user's subscription.
993
+ # @param topic_name [String] Name of the topic.
994
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
995
+ # will be added to the HTTP request.
996
+ #
997
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
998
+ #
999
+ def begin_delete_with_http_info(resource_group_name, topic_name, custom_headers:nil)
1000
+ begin_delete_async(resource_group_name, topic_name, custom_headers:custom_headers).value!
1001
+ end
1002
+
1003
+ #
1004
+ # Delete a topic.
1005
+ #
1006
+ # Delete existing topic.
1007
+ #
1008
+ # @param resource_group_name [String] The name of the resource group within the
1009
+ # user's subscription.
1010
+ # @param topic_name [String] Name of the topic.
1011
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1012
+ # to the HTTP request.
1013
+ #
1014
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1015
+ #
1016
+ def begin_delete_async(resource_group_name, topic_name, custom_headers:nil)
1017
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1018
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1019
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
1020
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1021
+
1022
+
1023
+ request_headers = {}
1024
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1025
+
1026
+ # Set Headers
1027
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1028
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1029
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1030
+
1031
+ request_url = @base_url || @client.base_url
1032
+
1033
+ options = {
1034
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1035
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
1036
+ query_params: {'api-version' => @client.api_version},
1037
+ headers: request_headers.merge(custom_headers || {}),
1038
+ base_url: request_url
1039
+ }
1040
+ promise = @client.make_request_async(:delete, path_template, options)
1041
+
1042
+ promise = promise.then do |result|
1043
+ http_response = result.response
1044
+ status_code = http_response.status
1045
+ response_content = http_response.body
1046
+ unless status_code == 202 || status_code == 204
1047
+ error_model = JSON.load(response_content)
1048
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1049
+ end
1050
+
1051
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1052
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1053
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1054
+
1055
+ result
1056
+ end
1057
+
1058
+ promise.execute
1059
+ end
1060
+
1061
+ #
1062
+ # Update a topic.
1063
+ #
1064
+ # Asynchronously updates a topic with the specified parameters.
1065
+ #
1066
+ # @param resource_group_name [String] The name of the resource group within the
1067
+ # user's subscription.
1068
+ # @param topic_name [String] Name of the topic.
1069
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
1070
+ # information.
1071
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1072
+ # will be added to the HTTP request.
1073
+ #
1074
+ # @return [Topic] operation results.
1075
+ #
1076
+ def begin_update(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
1077
+ response = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value!
1078
+ response.body unless response.nil?
1079
+ end
1080
+
1081
+ #
1082
+ # Update a topic.
1083
+ #
1084
+ # Asynchronously updates a topic with the specified parameters.
1085
+ #
1086
+ # @param resource_group_name [String] The name of the resource group within the
1087
+ # user's subscription.
1088
+ # @param topic_name [String] Name of the topic.
1089
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
1090
+ # information.
1091
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1092
+ # will be added to the HTTP request.
1093
+ #
1094
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1095
+ #
1096
+ def begin_update_with_http_info(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
1097
+ begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers).value!
1098
+ end
1099
+
1100
+ #
1101
+ # Update a topic.
1102
+ #
1103
+ # Asynchronously updates a topic with the specified parameters.
1104
+ #
1105
+ # @param resource_group_name [String] The name of the resource group within the
1106
+ # user's subscription.
1107
+ # @param topic_name [String] Name of the topic.
1108
+ # @param topic_update_parameters [TopicUpdateParameters] Topic update
1109
+ # information.
1110
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1111
+ # to the HTTP request.
1112
+ #
1113
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1114
+ #
1115
+ def begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
1116
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1117
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1118
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
1119
+ fail ArgumentError, 'topic_update_parameters is nil' if topic_update_parameters.nil?
1120
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1121
+
1122
+
1123
+ request_headers = {}
1124
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1125
+
1126
+ # Set Headers
1127
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1128
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1129
+
1130
+ # Serialize Request
1131
+ request_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicUpdateParameters.mapper()
1132
+ request_content = @client.serialize(request_mapper, topic_update_parameters)
1133
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1134
+
1135
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1136
+
1137
+ request_url = @base_url || @client.base_url
1138
+
1139
+ options = {
1140
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1141
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicName' => topic_name},
1142
+ query_params: {'api-version' => @client.api_version},
1143
+ body: request_content,
1144
+ headers: request_headers.merge(custom_headers || {}),
1145
+ base_url: request_url
1146
+ }
1147
+ promise = @client.make_request_async(:patch, path_template, options)
1148
+
1149
+ promise = promise.then do |result|
1150
+ http_response = result.response
1151
+ status_code = http_response.status
1152
+ response_content = http_response.body
1153
+ unless status_code == 201
1154
+ error_model = JSON.load(response_content)
1155
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1156
+ end
1157
+
1158
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1159
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1160
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1161
+ # Deserialize Response
1162
+ if status_code == 201
1163
+ begin
1164
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1165
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::Topic.mapper()
1166
+ result.body = @client.deserialize(result_mapper, parsed_response)
1167
+ rescue Exception => e
1168
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1169
+ end
1170
+ end
1171
+
1172
+ result
1173
+ end
1174
+
1175
+ promise.execute
1176
+ end
1177
+
1178
+ #
1179
+ # List topics under an Azure subscription.
1180
+ #
1181
+ # List all the topics under an Azure subscription.
1182
+ #
1183
+ # @param next_page_link [String] The NextLink from the previous successful call
1184
+ # to List operation.
1185
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1186
+ # will be added to the HTTP request.
1187
+ #
1188
+ # @return [TopicsListResult] operation results.
1189
+ #
1190
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1191
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1192
+ response.body unless response.nil?
1193
+ end
1194
+
1195
+ #
1196
+ # List topics under an Azure subscription.
1197
+ #
1198
+ # List all the topics under an Azure subscription.
1199
+ #
1200
+ # @param next_page_link [String] The NextLink from the previous successful call
1201
+ # to List operation.
1202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1203
+ # will be added to the HTTP request.
1204
+ #
1205
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1206
+ #
1207
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1208
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1209
+ end
1210
+
1211
+ #
1212
+ # List topics under an Azure subscription.
1213
+ #
1214
+ # List all the topics under an Azure subscription.
1215
+ #
1216
+ # @param next_page_link [String] The NextLink from the previous successful call
1217
+ # to List operation.
1218
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1219
+ # to the HTTP request.
1220
+ #
1221
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1222
+ #
1223
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1224
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1225
+
1226
+
1227
+ request_headers = {}
1228
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1229
+
1230
+ # Set Headers
1231
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1232
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1233
+ path_template = '{nextLink}'
1234
+
1235
+ request_url = @base_url || @client.base_url
1236
+
1237
+ options = {
1238
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1239
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1240
+ headers: request_headers.merge(custom_headers || {}),
1241
+ base_url: request_url
1242
+ }
1243
+ promise = @client.make_request_async(:get, path_template, options)
1244
+
1245
+ promise = promise.then do |result|
1246
+ http_response = result.response
1247
+ status_code = http_response.status
1248
+ response_content = http_response.body
1249
+ unless status_code == 200
1250
+ error_model = JSON.load(response_content)
1251
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1252
+ end
1253
+
1254
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1255
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1256
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1257
+ # Deserialize Response
1258
+ if status_code == 200
1259
+ begin
1260
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1261
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult.mapper()
1262
+ result.body = @client.deserialize(result_mapper, parsed_response)
1263
+ rescue Exception => e
1264
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1265
+ end
1266
+ end
1267
+
1268
+ result
1269
+ end
1270
+
1271
+ promise.execute
1272
+ end
1273
+
1274
+ #
1275
+ # List topics under a resource group.
1276
+ #
1277
+ # List all the topics under a resource group.
1278
+ #
1279
+ # @param next_page_link [String] The NextLink from the previous successful call
1280
+ # to List operation.
1281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1282
+ # will be added to the HTTP request.
1283
+ #
1284
+ # @return [TopicsListResult] operation results.
1285
+ #
1286
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1287
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1288
+ response.body unless response.nil?
1289
+ end
1290
+
1291
+ #
1292
+ # List topics under a resource group.
1293
+ #
1294
+ # List all the topics under a resource group.
1295
+ #
1296
+ # @param next_page_link [String] The NextLink from the previous successful call
1297
+ # to List operation.
1298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1299
+ # will be added to the HTTP request.
1300
+ #
1301
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1302
+ #
1303
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1304
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1305
+ end
1306
+
1307
+ #
1308
+ # List topics under a resource group.
1309
+ #
1310
+ # List all the topics under a resource group.
1311
+ #
1312
+ # @param next_page_link [String] The NextLink from the previous successful call
1313
+ # to List operation.
1314
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1315
+ # to the HTTP request.
1316
+ #
1317
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1318
+ #
1319
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1320
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1321
+
1322
+
1323
+ request_headers = {}
1324
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1325
+
1326
+ # Set Headers
1327
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1328
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1329
+ path_template = '{nextLink}'
1330
+
1331
+ request_url = @base_url || @client.base_url
1332
+
1333
+ options = {
1334
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1335
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1336
+ headers: request_headers.merge(custom_headers || {}),
1337
+ base_url: request_url
1338
+ }
1339
+ promise = @client.make_request_async(:get, path_template, options)
1340
+
1341
+ promise = promise.then do |result|
1342
+ http_response = result.response
1343
+ status_code = http_response.status
1344
+ response_content = http_response.body
1345
+ unless status_code == 200
1346
+ error_model = JSON.load(response_content)
1347
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1348
+ end
1349
+
1350
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1351
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1352
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1353
+ # Deserialize Response
1354
+ if status_code == 200
1355
+ begin
1356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1357
+ result_mapper = Azure::EventGrid::Mgmt::V2020_04_01_preview::Models::TopicsListResult.mapper()
1358
+ result.body = @client.deserialize(result_mapper, parsed_response)
1359
+ rescue Exception => e
1360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1361
+ end
1362
+ end
1363
+
1364
+ result
1365
+ end
1366
+
1367
+ promise.execute
1368
+ end
1369
+
1370
+ #
1371
+ # List topics under an Azure subscription.
1372
+ #
1373
+ # List all the topics under an Azure subscription.
1374
+ #
1375
+ # @param filter [String] The query used to filter the search results using
1376
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1377
+ # limited number of OData operations. These operations are: the 'contains'
1378
+ # function as well as the following logical operations: not, and, or, eq (for
1379
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1380
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1381
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1382
+ # $filter=location eq 'westus'.
1383
+ # @param top [Integer] The number of results to return per page for the list
1384
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1385
+ # default number of results to be returned is 20 items per page.
1386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1387
+ # will be added to the HTTP request.
1388
+ #
1389
+ # @return [TopicsListResult] which provide lazy access to pages of the
1390
+ # response.
1391
+ #
1392
+ def list_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil)
1393
+ response = list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
1394
+ unless response.nil?
1395
+ page = response.body
1396
+ page.next_method = Proc.new do |next_page_link|
1397
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1398
+ end
1399
+ page
1400
+ end
1401
+ end
1402
+
1403
+ #
1404
+ # List topics under a resource group.
1405
+ #
1406
+ # List all the topics under a resource group.
1407
+ #
1408
+ # @param resource_group_name [String] The name of the resource group within the
1409
+ # user's subscription.
1410
+ # @param filter [String] The query used to filter the search results using
1411
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1412
+ # limited number of OData operations. These operations are: the 'contains'
1413
+ # function as well as the following logical operations: not, and, or, eq (for
1414
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1415
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1416
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1417
+ # $filter=location eq 'westus'.
1418
+ # @param top [Integer] The number of results to return per page for the list
1419
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1420
+ # default number of results to be returned is 20 items per page.
1421
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1422
+ # will be added to the HTTP request.
1423
+ #
1424
+ # @return [TopicsListResult] which provide lazy access to pages of the
1425
+ # response.
1426
+ #
1427
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1428
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
1429
+ unless response.nil?
1430
+ page = response.body
1431
+ page.next_method = Proc.new do |next_page_link|
1432
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1433
+ end
1434
+ page
1435
+ end
1436
+ end
1437
+
1438
+ end
1439
+ end