azure_mgmt_event_grid 0.20.1 → 0.20.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  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/event_grid_management_client.rb +1 -1
  12. data/lib/2020-06-01/generated/azure_mgmt_event_grid.rb +108 -0
  13. data/lib/2020-06-01/generated/azure_mgmt_event_grid/domain_topics.rb +699 -0
  14. data/lib/2020-06-01/generated/azure_mgmt_event_grid/domains.rb +1328 -0
  15. data/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +161 -0
  16. data/lib/2020-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb +3648 -0
  17. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb +74 -0
  18. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb +86 -0
  19. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb +69 -0
  20. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/connection_state.rb +69 -0
  21. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb +50 -0
  22. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain.rb +212 -0
  23. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb +20 -0
  24. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb +46 -0
  25. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb +57 -0
  26. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb +75 -0
  27. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb +20 -0
  28. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb +98 -0
  29. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb +91 -0
  30. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb +98 -0
  31. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb +17 -0
  32. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +62 -0
  33. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb +189 -0
  34. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +52 -0
  35. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +120 -0
  36. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  37. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +21 -0
  38. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +137 -0
  39. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +98 -0
  40. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_type.rb +106 -0
  41. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  42. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb +64 -0
  43. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb +59 -0
  44. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema.rb +17 -0
  45. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb +49 -0
  46. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/ip_action_type.rb +15 -0
  47. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field.rb +50 -0
  48. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_field_with_default.rb +67 -0
  49. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb +130 -0
  50. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb +69 -0
  51. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb +69 -0
  52. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb +77 -0
  53. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb +69 -0
  54. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb +69 -0
  55. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb +77 -0
  56. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  57. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  58. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  59. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb +18 -0
  60. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint.rb +46 -0
  61. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb +121 -0
  62. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb +100 -0
  63. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resource.rb +128 -0
  64. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb +99 -0
  65. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/public_network_access.rb +16 -0
  66. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource.rb +80 -0
  67. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb +20 -0
  68. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  69. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb +57 -0
  70. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb +63 -0
  71. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb +64 -0
  72. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb +74 -0
  73. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb +75 -0
  74. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb +77 -0
  75. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb +77 -0
  76. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb +77 -0
  77. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb +77 -0
  78. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb +77 -0
  79. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic.rb +213 -0
  80. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  81. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  82. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  83. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb +150 -0
  84. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  85. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  86. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +91 -0
  87. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb +98 -0
  88. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  89. data/lib/2020-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +122 -0
  90. data/lib/2020-06-01/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  91. data/lib/2020-06-01/generated/azure_mgmt_event_grid/operations.rb +118 -0
  92. data/lib/2020-06-01/generated/azure_mgmt_event_grid/private_endpoint_connections.rb +791 -0
  93. data/lib/2020-06-01/generated/azure_mgmt_event_grid/private_link_resources.rb +423 -0
  94. data/lib/2020-06-01/generated/azure_mgmt_event_grid/topic_types.rb +305 -0
  95. data/lib/2020-06-01/generated/azure_mgmt_event_grid/topics.rb +1439 -0
  96. data/lib/azure_mgmt_event_grid.rb +1 -0
  97. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +184 -360
  98. data/lib/version.rb +1 -1
  99. metadata +86 -2
@@ -0,0 +1,423 @@
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_06_01
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class PrivateLinkResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResources 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 private link resource.
26
+ #
27
+ # Get properties of a private link resource.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group within the
30
+ # user's subscription.
31
+ # @param parent_type [String] The type of the parent resource. This can be
32
+ # either \'topics\' or \'domains\'.
33
+ # @param parent_name [String] The name of the parent resource (namely, either,
34
+ # the topic name or domain name).
35
+ # @param private_link_resource_name [String] The name of private link resource.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [PrivateLinkResource] operation results.
40
+ #
41
+ def get(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil)
42
+ response = get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Get a private link resource.
48
+ #
49
+ # Get properties of a private link resource.
50
+ #
51
+ # @param resource_group_name [String] The name of the resource group within the
52
+ # user's subscription.
53
+ # @param parent_type [String] The type of the parent resource. This can be
54
+ # either \'topics\' or \'domains\'.
55
+ # @param parent_name [String] The name of the parent resource (namely, either,
56
+ # the topic name or domain name).
57
+ # @param private_link_resource_name [String] The name of private link resource.
58
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
59
+ # will be added to the HTTP request.
60
+ #
61
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
+ #
63
+ def get_with_http_info(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil)
64
+ get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:custom_headers).value!
65
+ end
66
+
67
+ #
68
+ # Get a private link resource.
69
+ #
70
+ # Get properties of a private link resource.
71
+ #
72
+ # @param resource_group_name [String] The name of the resource group within the
73
+ # user's subscription.
74
+ # @param parent_type [String] The type of the parent resource. This can be
75
+ # either \'topics\' or \'domains\'.
76
+ # @param parent_name [String] The name of the parent resource (namely, either,
77
+ # the topic name or domain name).
78
+ # @param private_link_resource_name [String] The name of private link resource.
79
+ # @param [Hash{String => String}] A hash of custom headers that will be added
80
+ # to the HTTP request.
81
+ #
82
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
+ #
84
+ def get_async(resource_group_name, parent_type, parent_name, private_link_resource_name, custom_headers:nil)
85
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
87
+ fail ArgumentError, 'parent_type is nil' if parent_type.nil?
88
+ fail ArgumentError, 'parent_name is nil' if parent_name.nil?
89
+ fail ArgumentError, 'private_link_resource_name is nil' if private_link_resource_name.nil?
90
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
91
+
92
+
93
+ request_headers = {}
94
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
95
+
96
+ # Set Headers
97
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
98
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
99
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources/{privateLinkResourceName}'
100
+
101
+ request_url = @base_url || @client.base_url
102
+
103
+ options = {
104
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
105
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name,'privateLinkResourceName' => private_link_resource_name},
106
+ query_params: {'api-version' => @client.api_version},
107
+ headers: request_headers.merge(custom_headers || {}),
108
+ base_url: request_url
109
+ }
110
+ promise = @client.make_request_async(:get, path_template, options)
111
+
112
+ promise = promise.then do |result|
113
+ http_response = result.response
114
+ status_code = http_response.status
115
+ response_content = http_response.body
116
+ unless status_code == 200
117
+ error_model = JSON.load(response_content)
118
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
119
+ end
120
+
121
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
122
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
123
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
124
+ # Deserialize Response
125
+ if status_code == 200
126
+ begin
127
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
128
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResource.mapper()
129
+ result.body = @client.deserialize(result_mapper, parsed_response)
130
+ rescue Exception => e
131
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
132
+ end
133
+ end
134
+
135
+ result
136
+ end
137
+
138
+ promise.execute
139
+ end
140
+
141
+ #
142
+ # List private link resources under specific topic or domain.
143
+ #
144
+ # List all the private link resources under a topic or domain.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group within the
147
+ # user's subscription.
148
+ # @param parent_type [String] The type of the parent resource. This can be
149
+ # either \'topics\' or \'domains\'.
150
+ # @param parent_name [String] The name of the parent resource (namely, either,
151
+ # the topic name or domain name).
152
+ # @param filter [String] The query used to filter the search results using
153
+ # OData syntax. Filtering is permitted on the 'name' property only and with
154
+ # limited number of OData operations. These operations are: the 'contains'
155
+ # function as well as the following logical operations: not, and, or, eq (for
156
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
157
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
158
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
159
+ # $filter=location eq 'westus'.
160
+ # @param top [Integer] The number of results to return per page for the list
161
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
162
+ # default number of results to be returned is 20 items per page.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [Array<PrivateLinkResource>] operation results.
167
+ #
168
+ def list_by_resource(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil)
169
+ first_page = list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers)
170
+ first_page.get_all_items
171
+ end
172
+
173
+ #
174
+ # List private link resources under specific topic or domain.
175
+ #
176
+ # List all the private link resources under a topic or domain.
177
+ #
178
+ # @param resource_group_name [String] The name of the resource group within the
179
+ # user's subscription.
180
+ # @param parent_type [String] The type of the parent resource. This can be
181
+ # either \'topics\' or \'domains\'.
182
+ # @param parent_name [String] The name of the parent resource (namely, either,
183
+ # the topic name or domain name).
184
+ # @param filter [String] The query used to filter the search results using
185
+ # OData syntax. Filtering is permitted on the 'name' property only and with
186
+ # limited number of OData operations. These operations are: the 'contains'
187
+ # function as well as the following logical operations: not, and, or, eq (for
188
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
189
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
190
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
191
+ # $filter=location eq 'westus'.
192
+ # @param top [Integer] The number of results to return per page for the list
193
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
194
+ # default number of results to be returned is 20 items per page.
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
199
+ #
200
+ def list_by_resource_with_http_info(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil)
201
+ list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value!
202
+ end
203
+
204
+ #
205
+ # List private link resources under specific topic or domain.
206
+ #
207
+ # List all the private link resources under a topic or domain.
208
+ #
209
+ # @param resource_group_name [String] The name of the resource group within the
210
+ # user's subscription.
211
+ # @param parent_type [String] The type of the parent resource. This can be
212
+ # either \'topics\' or \'domains\'.
213
+ # @param parent_name [String] The name of the parent resource (namely, either,
214
+ # the topic name or domain name).
215
+ # @param filter [String] The query used to filter the search results using
216
+ # OData syntax. Filtering is permitted on the 'name' property only and with
217
+ # limited number of OData operations. These operations are: the 'contains'
218
+ # function as well as the following logical operations: not, and, or, eq (for
219
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
220
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
221
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
222
+ # $filter=location eq 'westus'.
223
+ # @param top [Integer] The number of results to return per page for the list
224
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
225
+ # default number of results to be returned is 20 items per page.
226
+ # @param [Hash{String => String}] A hash of custom headers that will be added
227
+ # to the HTTP request.
228
+ #
229
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
230
+ #
231
+ def list_by_resource_async(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil)
232
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
233
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
234
+ fail ArgumentError, 'parent_type is nil' if parent_type.nil?
235
+ fail ArgumentError, 'parent_name is nil' if parent_name.nil?
236
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
237
+
238
+
239
+ request_headers = {}
240
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
241
+
242
+ # Set Headers
243
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
244
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
245
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateLinkResources'
246
+
247
+ request_url = @base_url || @client.base_url
248
+
249
+ options = {
250
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
251
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'parentType' => parent_type,'parentName' => parent_name},
252
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
253
+ headers: request_headers.merge(custom_headers || {}),
254
+ base_url: request_url
255
+ }
256
+ promise = @client.make_request_async(:get, path_template, options)
257
+
258
+ promise = promise.then do |result|
259
+ http_response = result.response
260
+ status_code = http_response.status
261
+ response_content = http_response.body
262
+ unless status_code == 200
263
+ error_model = JSON.load(response_content)
264
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
265
+ end
266
+
267
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
268
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
269
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
270
+ # Deserialize Response
271
+ if status_code == 200
272
+ begin
273
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
274
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult.mapper()
275
+ result.body = @client.deserialize(result_mapper, parsed_response)
276
+ rescue Exception => e
277
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
278
+ end
279
+ end
280
+
281
+ result
282
+ end
283
+
284
+ promise.execute
285
+ end
286
+
287
+ #
288
+ # List private link resources under specific topic or domain.
289
+ #
290
+ # List all the private link resources under a topic or domain.
291
+ #
292
+ # @param next_page_link [String] The NextLink from the previous successful call
293
+ # to List operation.
294
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
295
+ # will be added to the HTTP request.
296
+ #
297
+ # @return [PrivateLinkResourcesListResult] operation results.
298
+ #
299
+ def list_by_resource_next(next_page_link, custom_headers:nil)
300
+ response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
301
+ response.body unless response.nil?
302
+ end
303
+
304
+ #
305
+ # List private link resources under specific topic or domain.
306
+ #
307
+ # List all the private link resources under a topic or domain.
308
+ #
309
+ # @param next_page_link [String] The NextLink from the previous successful call
310
+ # to List operation.
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
315
+ #
316
+ def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil)
317
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
318
+ end
319
+
320
+ #
321
+ # List private link resources under specific topic or domain.
322
+ #
323
+ # List all the private link resources under a topic or domain.
324
+ #
325
+ # @param next_page_link [String] The NextLink from the previous successful call
326
+ # to List operation.
327
+ # @param [Hash{String => String}] A hash of custom headers that will be added
328
+ # to the HTTP request.
329
+ #
330
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
331
+ #
332
+ def list_by_resource_next_async(next_page_link, custom_headers:nil)
333
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
334
+
335
+
336
+ request_headers = {}
337
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
338
+
339
+ # Set Headers
340
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
341
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
342
+ path_template = '{nextLink}'
343
+
344
+ request_url = @base_url || @client.base_url
345
+
346
+ options = {
347
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
348
+ skip_encoding_path_params: {'nextLink' => next_page_link},
349
+ headers: request_headers.merge(custom_headers || {}),
350
+ base_url: request_url
351
+ }
352
+ promise = @client.make_request_async(:get, path_template, options)
353
+
354
+ promise = promise.then do |result|
355
+ http_response = result.response
356
+ status_code = http_response.status
357
+ response_content = http_response.body
358
+ unless status_code == 200
359
+ error_model = JSON.load(response_content)
360
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
361
+ end
362
+
363
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
364
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
365
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
366
+ # Deserialize Response
367
+ if status_code == 200
368
+ begin
369
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
370
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::PrivateLinkResourcesListResult.mapper()
371
+ result.body = @client.deserialize(result_mapper, parsed_response)
372
+ rescue Exception => e
373
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
374
+ end
375
+ end
376
+
377
+ result
378
+ end
379
+
380
+ promise.execute
381
+ end
382
+
383
+ #
384
+ # List private link resources under specific topic or domain.
385
+ #
386
+ # List all the private link resources under a topic or domain.
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group within the
389
+ # user's subscription.
390
+ # @param parent_type [String] The type of the parent resource. This can be
391
+ # either \'topics\' or \'domains\'.
392
+ # @param parent_name [String] The name of the parent resource (namely, either,
393
+ # the topic name or domain name).
394
+ # @param filter [String] The query used to filter the search results using
395
+ # OData syntax. Filtering is permitted on the 'name' property only and with
396
+ # limited number of OData operations. These operations are: the 'contains'
397
+ # function as well as the following logical operations: not, and, or, eq (for
398
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
399
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
400
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
401
+ # $filter=location eq 'westus'.
402
+ # @param top [Integer] The number of results to return per page for the list
403
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
404
+ # default number of results to be returned is 20 items per page.
405
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
406
+ # will be added to the HTTP request.
407
+ #
408
+ # @return [PrivateLinkResourcesListResult] which provide lazy access to pages
409
+ # of the response.
410
+ #
411
+ def list_by_resource_as_lazy(resource_group_name, parent_type, parent_name, filter:nil, top:nil, custom_headers:nil)
412
+ response = list_by_resource_async(resource_group_name, parent_type, parent_name, filter:filter, top:top, custom_headers:custom_headers).value!
413
+ unless response.nil?
414
+ page = response.body
415
+ page.next_method = Proc.new do |next_page_link|
416
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers)
417
+ end
418
+ page
419
+ end
420
+ end
421
+
422
+ end
423
+ end
@@ -0,0 +1,305 @@
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_06_01
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class TopicTypes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the TopicTypes 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
+ # List topic types.
26
+ #
27
+ # List all registered topic types.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [TopicTypesListResult] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ response = list_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # List topic types.
41
+ #
42
+ # List all registered topic types.
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # List topic types.
55
+ #
56
+ # List all registered topic types.
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'providers/Microsoft.EventGrid/topicTypes'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypesListResult.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ #
115
+ # Get a topic type.
116
+ #
117
+ # Get information about a topic type.
118
+ #
119
+ # @param topic_type_name [String] Name of the topic type.
120
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
121
+ # will be added to the HTTP request.
122
+ #
123
+ # @return [TopicTypeInfo] operation results.
124
+ #
125
+ def get(topic_type_name, custom_headers:nil)
126
+ response = get_async(topic_type_name, custom_headers:custom_headers).value!
127
+ response.body unless response.nil?
128
+ end
129
+
130
+ #
131
+ # Get a topic type.
132
+ #
133
+ # Get information about a topic type.
134
+ #
135
+ # @param topic_type_name [String] Name of the topic type.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
140
+ #
141
+ def get_with_http_info(topic_type_name, custom_headers:nil)
142
+ get_async(topic_type_name, custom_headers:custom_headers).value!
143
+ end
144
+
145
+ #
146
+ # Get a topic type.
147
+ #
148
+ # Get information about a topic type.
149
+ #
150
+ # @param topic_type_name [String] Name of the topic type.
151
+ # @param [Hash{String => String}] A hash of custom headers that will be added
152
+ # to the HTTP request.
153
+ #
154
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
155
+ #
156
+ def get_async(topic_type_name, custom_headers:nil)
157
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
158
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
159
+
160
+
161
+ request_headers = {}
162
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
163
+
164
+ # Set Headers
165
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
166
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
167
+ path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'
168
+
169
+ request_url = @base_url || @client.base_url
170
+
171
+ options = {
172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
173
+ path_params: {'topicTypeName' => topic_type_name},
174
+ query_params: {'api-version' => @client.api_version},
175
+ headers: request_headers.merge(custom_headers || {}),
176
+ base_url: request_url
177
+ }
178
+ promise = @client.make_request_async(:get, path_template, options)
179
+
180
+ promise = promise.then do |result|
181
+ http_response = result.response
182
+ status_code = http_response.status
183
+ response_content = http_response.body
184
+ unless status_code == 200
185
+ error_model = JSON.load(response_content)
186
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
187
+ end
188
+
189
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
190
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
191
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
192
+ # Deserialize Response
193
+ if status_code == 200
194
+ begin
195
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
196
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::TopicTypeInfo.mapper()
197
+ result.body = @client.deserialize(result_mapper, parsed_response)
198
+ rescue Exception => e
199
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
200
+ end
201
+ end
202
+
203
+ result
204
+ end
205
+
206
+ promise.execute
207
+ end
208
+
209
+ #
210
+ # List event types.
211
+ #
212
+ # List event types for a topic type.
213
+ #
214
+ # @param topic_type_name [String] Name of the topic type.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [EventTypesListResult] operation results.
219
+ #
220
+ def list_event_types(topic_type_name, custom_headers:nil)
221
+ response = list_event_types_async(topic_type_name, custom_headers:custom_headers).value!
222
+ response.body unless response.nil?
223
+ end
224
+
225
+ #
226
+ # List event types.
227
+ #
228
+ # List event types for a topic type.
229
+ #
230
+ # @param topic_type_name [String] Name of the topic type.
231
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
232
+ # will be added to the HTTP request.
233
+ #
234
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
235
+ #
236
+ def list_event_types_with_http_info(topic_type_name, custom_headers:nil)
237
+ list_event_types_async(topic_type_name, custom_headers:custom_headers).value!
238
+ end
239
+
240
+ #
241
+ # List event types.
242
+ #
243
+ # List event types for a topic type.
244
+ #
245
+ # @param topic_type_name [String] Name of the topic type.
246
+ # @param [Hash{String => String}] A hash of custom headers that will be added
247
+ # to the HTTP request.
248
+ #
249
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
250
+ #
251
+ def list_event_types_async(topic_type_name, custom_headers:nil)
252
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
253
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
254
+
255
+
256
+ request_headers = {}
257
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
258
+
259
+ # Set Headers
260
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
261
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
262
+ path_template = 'providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'
263
+
264
+ request_url = @base_url || @client.base_url
265
+
266
+ options = {
267
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
268
+ path_params: {'topicTypeName' => topic_type_name},
269
+ query_params: {'api-version' => @client.api_version},
270
+ headers: request_headers.merge(custom_headers || {}),
271
+ base_url: request_url
272
+ }
273
+ promise = @client.make_request_async(:get, path_template, options)
274
+
275
+ promise = promise.then do |result|
276
+ http_response = result.response
277
+ status_code = http_response.status
278
+ response_content = http_response.body
279
+ unless status_code == 200
280
+ error_model = JSON.load(response_content)
281
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
282
+ end
283
+
284
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
285
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
286
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
287
+ # Deserialize Response
288
+ if status_code == 200
289
+ begin
290
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
291
+ result_mapper = Azure::EventGrid::Mgmt::V2020_06_01::Models::EventTypesListResult.mapper()
292
+ result.body = @client.deserialize(result_mapper, parsed_response)
293
+ rescue Exception => e
294
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
295
+ end
296
+ end
297
+
298
+ result
299
+ end
300
+
301
+ promise.execute
302
+ end
303
+
304
+ end
305
+ end