azure_mgmt_event_grid 0.17.5 → 0.17.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) 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-06-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +28 -0
  4. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/operations.rb +2 -0
  5. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  6. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/topics.rb +16 -0
  7. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  8. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +28 -0
  9. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/operations.rb +2 -0
  10. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  11. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/topics.rb +18 -0
  12. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  13. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb +28 -0
  14. data/lib/2018-01-01/generated/azure_mgmt_event_grid/operations.rb +2 -0
  15. data/lib/2018-01-01/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  16. data/lib/2018-01-01/generated/azure_mgmt_event_grid/topics.rb +18 -0
  17. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  18. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +28 -0
  19. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/operations.rb +2 -0
  20. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  21. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/topics.rb +18 -0
  22. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb +4 -0
  23. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/domains.rb +16 -0
  24. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  25. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +30 -0
  26. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/operations.rb +2 -0
  27. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  28. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/topics.rb +18 -0
  29. data/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  30. data/lib/2019-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb +28 -0
  31. data/lib/2019-01-01/generated/azure_mgmt_event_grid/operations.rb +2 -0
  32. data/lib/2019-01-01/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  33. data/lib/2019-01-01/generated/azure_mgmt_event_grid/topics.rb +18 -0
  34. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domain_topics.rb +10 -0
  35. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/domains.rb +20 -0
  36. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  37. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +50 -0
  38. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/operations.rb +2 -0
  39. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topic_types.rb +6 -0
  40. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb +22 -0
  41. data/lib/2019-06-01/generated/azure_mgmt_event_grid.rb +87 -0
  42. data/lib/2019-06-01/generated/azure_mgmt_event_grid/domain_topics.rb +699 -0
  43. data/lib/2019-06-01/generated/azure_mgmt_event_grid/domains.rb +1328 -0
  44. data/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +153 -0
  45. data/lib/2019-06-01/generated/azure_mgmt_event_grid/event_subscriptions.rb +3648 -0
  46. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/advanced_filter.rb +74 -0
  47. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb +69 -0
  48. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb +50 -0
  49. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain.rb +112 -0
  50. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb +20 -0
  51. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb +46 -0
  52. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb +57 -0
  53. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_topic.rb +75 -0
  54. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb +20 -0
  55. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb +98 -0
  56. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb +54 -0
  57. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/domains_list_result.rb +98 -0
  58. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +62 -0
  59. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription.rb +176 -0
  60. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +50 -0
  61. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +120 -0
  62. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  63. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +21 -0
  64. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +124 -0
  65. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +98 -0
  66. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_type.rb +106 -0
  67. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  68. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb +64 -0
  69. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb +69 -0
  70. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb +69 -0
  71. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb +77 -0
  72. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb +69 -0
  73. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb +69 -0
  74. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb +77 -0
  75. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  76. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  77. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  78. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/resource.rb +80 -0
  79. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  80. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/retry_policy.rb +57 -0
  81. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb +63 -0
  82. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb +74 -0
  83. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb +75 -0
  84. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb +77 -0
  85. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb +77 -0
  86. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb +77 -0
  87. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb +77 -0
  88. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb +77 -0
  89. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic.rb +112 -0
  90. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  91. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  92. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  93. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_type_info.rb +139 -0
  94. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  95. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  96. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +54 -0
  97. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/topics_list_result.rb +98 -0
  98. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  99. data/lib/2019-06-01/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +75 -0
  100. data/lib/2019-06-01/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  101. data/lib/2019-06-01/generated/azure_mgmt_event_grid/operations.rb +118 -0
  102. data/lib/2019-06-01/generated/azure_mgmt_event_grid/topic_types.rb +305 -0
  103. data/lib/2019-06-01/generated/azure_mgmt_event_grid/topics.rb +1439 -0
  104. data/lib/azure_mgmt_event_grid.rb +1 -0
  105. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +135 -159
  106. data/lib/version.rb +1 -1
  107. metadata +68 -5
@@ -0,0 +1,153 @@
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::V2019_06_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class EventGridManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials that uniquely identify a
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Version of the API to be used with the client request.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Domains] domains
41
+ attr_reader :domains
42
+
43
+ # @return [DomainTopics] domain_topics
44
+ attr_reader :domain_topics
45
+
46
+ # @return [EventSubscriptions] event_subscriptions
47
+ attr_reader :event_subscriptions
48
+
49
+ # @return [Operations] operations
50
+ attr_reader :operations
51
+
52
+ # @return [Topics] topics
53
+ attr_reader :topics
54
+
55
+ # @return [TopicTypes] topic_types
56
+ attr_reader :topic_types
57
+
58
+ #
59
+ # Creates initializes a new instance of the EventGridManagementClient class.
60
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
61
+ # @param base_url [String] the base URI of the service.
62
+ # @param options [Array] filters to be applied to the HTTP requests.
63
+ #
64
+ def initialize(credentials = nil, base_url = nil, options = nil)
65
+ super(credentials, options)
66
+ @base_url = base_url || 'https://management.azure.com'
67
+
68
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
69
+ @credentials = credentials
70
+
71
+ @domains = Domains.new(self)
72
+ @domain_topics = DomainTopics.new(self)
73
+ @event_subscriptions = EventSubscriptions.new(self)
74
+ @operations = Operations.new(self)
75
+ @topics = Topics.new(self)
76
+ @topic_types = TopicTypes.new(self)
77
+ @api_version = '2019-06-01'
78
+ @accept_language = 'en-US'
79
+ @long_running_operation_retry_timeout = 30
80
+ @generate_client_request_id = true
81
+ add_telemetry
82
+ end
83
+
84
+ #
85
+ # Makes a request and returns the body of the response.
86
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
87
+ # @param path [String] the path, relative to {base_url}.
88
+ # @param options [Hash{String=>String}] specifying any request options like :body.
89
+ # @return [Hash{String=>String}] containing the body of the response.
90
+ # Example:
91
+ #
92
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
93
+ # path = "/path"
94
+ # options = {
95
+ # body: request_content,
96
+ # query_params: {'api-version' => '2016-02-01'}
97
+ # }
98
+ # result = @client.make_request(:put, path, options)
99
+ #
100
+ def make_request(method, path, options = {})
101
+ result = make_request_with_http_info(method, path, options)
102
+ result.body unless result.nil?
103
+ end
104
+
105
+ #
106
+ # Makes a request and returns the operation response.
107
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
108
+ # @param path [String] the path, relative to {base_url}.
109
+ # @param options [Hash{String=>String}] specifying any request options like :body.
110
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
111
+ #
112
+ def make_request_with_http_info(method, path, options = {})
113
+ result = make_request_async(method, path, options).value!
114
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
115
+ result
116
+ end
117
+
118
+ #
119
+ # Makes a request asynchronously.
120
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
121
+ # @param path [String] the path, relative to {base_url}.
122
+ # @param options [Hash{String=>String}] specifying any request options like :body.
123
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
124
+ #
125
+ def make_request_async(method, path, options = {})
126
+ fail ArgumentError, 'method is nil' if method.nil?
127
+ fail ArgumentError, 'path is nil' if path.nil?
128
+
129
+ request_url = options[:base_url] || @base_url
130
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
131
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
132
+ end
133
+
134
+ request_headers = @request_headers
135
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
136
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
137
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
138
+
139
+ super(request_url, method, path, options)
140
+ end
141
+
142
+
143
+ private
144
+ #
145
+ # Adds telemetry information.
146
+ #
147
+ def add_telemetry
148
+ sdk_information = 'azure_mgmt_event_grid'
149
+ sdk_information = "#{sdk_information}/0.17.6"
150
+ add_user_agent_information(sdk_information)
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,3648 @@
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::V2019_06_01
7
+ #
8
+ # Azure EventGrid Management Client
9
+ #
10
+ class EventSubscriptions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the EventSubscriptions 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 an event subscription.
26
+ #
27
+ # Get properties of an event subscription.
28
+ #
29
+ # @param scope [String] The scope of the event subscription. The scope can be a
30
+ # subscription, or a resource group, or a top level resource belonging to a
31
+ # resource provider namespace, or an EventGrid topic. For example, use
32
+ # '/subscriptions/{subscriptionId}/' for a subscription,
33
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
34
+ # resource group, and
35
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
36
+ # for a resource, and
37
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
38
+ # for an EventGrid topic.
39
+ # @param event_subscription_name [String] Name of the event subscription.
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [EventSubscription] operation results.
44
+ #
45
+ def get(scope, event_subscription_name, custom_headers:nil)
46
+ response = get_async(scope, event_subscription_name, custom_headers:custom_headers).value!
47
+ response.body unless response.nil?
48
+ end
49
+
50
+ #
51
+ # Get an event subscription.
52
+ #
53
+ # Get properties of an event subscription.
54
+ #
55
+ # @param scope [String] The scope of the event subscription. The scope can be a
56
+ # subscription, or a resource group, or a top level resource belonging to a
57
+ # resource provider namespace, or an EventGrid topic. For example, use
58
+ # '/subscriptions/{subscriptionId}/' for a subscription,
59
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
60
+ # resource group, and
61
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
62
+ # for a resource, and
63
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
64
+ # for an EventGrid topic.
65
+ # @param event_subscription_name [String] Name of the event subscription.
66
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
67
+ # will be added to the HTTP request.
68
+ #
69
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
70
+ #
71
+ def get_with_http_info(scope, event_subscription_name, custom_headers:nil)
72
+ get_async(scope, event_subscription_name, custom_headers:custom_headers).value!
73
+ end
74
+
75
+ #
76
+ # Get an event subscription.
77
+ #
78
+ # Get properties of an event subscription.
79
+ #
80
+ # @param scope [String] The scope of the event subscription. The scope can be a
81
+ # subscription, or a resource group, or a top level resource belonging to a
82
+ # resource provider namespace, or an EventGrid topic. For example, use
83
+ # '/subscriptions/{subscriptionId}/' for a subscription,
84
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
85
+ # resource group, and
86
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
87
+ # for a resource, and
88
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
89
+ # for an EventGrid topic.
90
+ # @param event_subscription_name [String] Name of the event subscription.
91
+ # @param [Hash{String => String}] A hash of custom headers that will be added
92
+ # to the HTTP request.
93
+ #
94
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
95
+ #
96
+ def get_async(scope, event_subscription_name, custom_headers:nil)
97
+ fail ArgumentError, 'scope is nil' if scope.nil?
98
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
99
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
100
+
101
+
102
+ request_headers = {}
103
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
104
+
105
+ # Set Headers
106
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
108
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
109
+
110
+ request_url = @base_url || @client.base_url
111
+
112
+ options = {
113
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
114
+ path_params: {'eventSubscriptionName' => event_subscription_name},
115
+ skip_encoding_path_params: {'scope' => scope},
116
+ query_params: {'api-version' => @client.api_version},
117
+ headers: request_headers.merge(custom_headers || {}),
118
+ base_url: request_url
119
+ }
120
+ promise = @client.make_request_async(:get, path_template, options)
121
+
122
+ promise = promise.then do |result|
123
+ http_response = result.response
124
+ status_code = http_response.status
125
+ response_content = http_response.body
126
+ unless status_code == 200
127
+ error_model = JSON.load(response_content)
128
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
129
+ end
130
+
131
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
132
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
133
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
134
+ # Deserialize Response
135
+ if status_code == 200
136
+ begin
137
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
138
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
139
+ result.body = @client.deserialize(result_mapper, parsed_response)
140
+ rescue Exception => e
141
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
142
+ end
143
+ end
144
+
145
+ result
146
+ end
147
+
148
+ promise.execute
149
+ end
150
+
151
+ #
152
+ # Create or update an event subscription.
153
+ #
154
+ # Asynchronously creates a new event subscription or updates an existing event
155
+ # subscription based on the specified scope.
156
+ #
157
+ # @param scope [String] The identifier of the resource to which the event
158
+ # subscription needs to be created or updated. The scope can be a subscription,
159
+ # or a resource group, or a top level resource belonging to a resource provider
160
+ # namespace, or an EventGrid topic. For example, use
161
+ # '/subscriptions/{subscriptionId}/' for a subscription,
162
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
163
+ # resource group, and
164
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
165
+ # for a resource, and
166
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
167
+ # for an EventGrid topic.
168
+ # @param event_subscription_name [String] Name of the event subscription. Event
169
+ # subscription names must be between 3 and 64 characters in length and should
170
+ # use alphanumeric letters only.
171
+ # @param event_subscription_info [EventSubscription] Event subscription
172
+ # properties containing the destination and filter information.
173
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
174
+ # will be added to the HTTP request.
175
+ #
176
+ # @return [EventSubscription] operation results.
177
+ #
178
+ def create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
179
+ response = create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
180
+ response.body unless response.nil?
181
+ end
182
+
183
+ #
184
+ # @param scope [String] The identifier of the resource to which the event
185
+ # subscription needs to be created or updated. The scope can be a subscription,
186
+ # or a resource group, or a top level resource belonging to a resource provider
187
+ # namespace, or an EventGrid topic. For example, use
188
+ # '/subscriptions/{subscriptionId}/' for a subscription,
189
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
190
+ # resource group, and
191
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
192
+ # for a resource, and
193
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
194
+ # for an EventGrid topic.
195
+ # @param event_subscription_name [String] Name of the event subscription. Event
196
+ # subscription names must be between 3 and 64 characters in length and should
197
+ # use alphanumeric letters only.
198
+ # @param event_subscription_info [EventSubscription] Event subscription
199
+ # properties containing the destination and filter information.
200
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
201
+ # will be added to the HTTP request.
202
+ #
203
+ # @return [Concurrent::Promise] promise which provides async access to http
204
+ # response.
205
+ #
206
+ def create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
207
+ # Send request
208
+ promise = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers)
209
+
210
+ promise = promise.then do |response|
211
+ # Defining deserialization method.
212
+ deserialize_method = lambda do |parsed_response|
213
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
214
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
215
+ end
216
+
217
+ # Waiting for response.
218
+ @client.get_long_running_operation_result(response, deserialize_method)
219
+ end
220
+
221
+ promise
222
+ end
223
+
224
+ #
225
+ # Delete an event subscription.
226
+ #
227
+ # Delete an existing event subscription.
228
+ #
229
+ # @param scope [String] The scope of the event subscription. The scope can be a
230
+ # subscription, or a resource group, or a top level resource belonging to a
231
+ # resource provider namespace, or an EventGrid topic. For example, use
232
+ # '/subscriptions/{subscriptionId}/' for a subscription,
233
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
234
+ # resource group, and
235
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
236
+ # for a resource, and
237
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
238
+ # for an EventGrid topic.
239
+ # @param event_subscription_name [String] Name of the event subscription.
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ def delete(scope, event_subscription_name, custom_headers:nil)
244
+ response = delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
245
+ nil
246
+ end
247
+
248
+ #
249
+ # @param scope [String] The scope of the event subscription. The scope can be a
250
+ # subscription, or a resource group, or a top level resource belonging to a
251
+ # resource provider namespace, or an EventGrid topic. For example, use
252
+ # '/subscriptions/{subscriptionId}/' for a subscription,
253
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
254
+ # resource group, and
255
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
256
+ # for a resource, and
257
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
258
+ # for an EventGrid topic.
259
+ # @param event_subscription_name [String] Name of the event subscription.
260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
+ # will be added to the HTTP request.
262
+ #
263
+ # @return [Concurrent::Promise] promise which provides async access to http
264
+ # response.
265
+ #
266
+ def delete_async(scope, event_subscription_name, custom_headers:nil)
267
+ # Send request
268
+ promise = begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers)
269
+
270
+ promise = promise.then do |response|
271
+ # Defining deserialization method.
272
+ deserialize_method = lambda do |parsed_response|
273
+ end
274
+
275
+ # Waiting for response.
276
+ @client.get_long_running_operation_result(response, deserialize_method)
277
+ end
278
+
279
+ promise
280
+ end
281
+
282
+ #
283
+ # Update an event subscription.
284
+ #
285
+ # Asynchronously updates an existing event subscription.
286
+ #
287
+ # @param scope [String] The scope of existing event subscription. The scope can
288
+ # be a subscription, or a resource group, or a top level resource belonging to
289
+ # a resource provider namespace, or an EventGrid topic. For example, use
290
+ # '/subscriptions/{subscriptionId}/' for a subscription,
291
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
292
+ # resource group, and
293
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
294
+ # for a resource, and
295
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
296
+ # for an EventGrid topic.
297
+ # @param event_subscription_name [String] Name of the event subscription to be
298
+ # updated.
299
+ # @param event_subscription_update_parameters
300
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
301
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
302
+ # will be added to the HTTP request.
303
+ #
304
+ # @return [EventSubscription] operation results.
305
+ #
306
+ def update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
307
+ response = update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
308
+ response.body unless response.nil?
309
+ end
310
+
311
+ #
312
+ # @param scope [String] The scope of existing event subscription. The scope can
313
+ # be a subscription, or a resource group, or a top level resource belonging to
314
+ # a resource provider namespace, or an EventGrid topic. For example, use
315
+ # '/subscriptions/{subscriptionId}/' for a subscription,
316
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
317
+ # resource group, and
318
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
319
+ # for a resource, and
320
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
321
+ # for an EventGrid topic.
322
+ # @param event_subscription_name [String] Name of the event subscription to be
323
+ # updated.
324
+ # @param event_subscription_update_parameters
325
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [Concurrent::Promise] promise which provides async access to http
330
+ # response.
331
+ #
332
+ def update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
333
+ # Send request
334
+ promise = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers)
335
+
336
+ promise = promise.then do |response|
337
+ # Defining deserialization method.
338
+ deserialize_method = lambda do |parsed_response|
339
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
340
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
341
+ end
342
+
343
+ # Waiting for response.
344
+ @client.get_long_running_operation_result(response, deserialize_method)
345
+ end
346
+
347
+ promise
348
+ end
349
+
350
+ #
351
+ # Get full URL of an event subscription.
352
+ #
353
+ # Get the full endpoint URL for an event subscription.
354
+ #
355
+ # @param scope [String] The scope of the event subscription. The scope can be a
356
+ # subscription, or a resource group, or a top level resource belonging to a
357
+ # resource provider namespace, or an EventGrid topic. For example, use
358
+ # '/subscriptions/{subscriptionId}/' for a subscription,
359
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
360
+ # resource group, and
361
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
362
+ # for a resource, and
363
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
364
+ # for an EventGrid topic.
365
+ # @param event_subscription_name [String] Name of the event subscription.
366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
367
+ # will be added to the HTTP request.
368
+ #
369
+ # @return [EventSubscriptionFullUrl] operation results.
370
+ #
371
+ def get_full_url(scope, event_subscription_name, custom_headers:nil)
372
+ response = get_full_url_async(scope, event_subscription_name, custom_headers:custom_headers).value!
373
+ response.body unless response.nil?
374
+ end
375
+
376
+ #
377
+ # Get full URL of an event subscription.
378
+ #
379
+ # Get the full endpoint URL for an event subscription.
380
+ #
381
+ # @param scope [String] The scope of the event subscription. The scope can be a
382
+ # subscription, or a resource group, or a top level resource belonging to a
383
+ # resource provider namespace, or an EventGrid topic. For example, use
384
+ # '/subscriptions/{subscriptionId}/' for a subscription,
385
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
386
+ # resource group, and
387
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
388
+ # for a resource, and
389
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
390
+ # for an EventGrid topic.
391
+ # @param event_subscription_name [String] Name of the event subscription.
392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
+ # will be added to the HTTP request.
394
+ #
395
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
396
+ #
397
+ def get_full_url_with_http_info(scope, event_subscription_name, custom_headers:nil)
398
+ get_full_url_async(scope, event_subscription_name, custom_headers:custom_headers).value!
399
+ end
400
+
401
+ #
402
+ # Get full URL of an event subscription.
403
+ #
404
+ # Get the full endpoint URL for an event subscription.
405
+ #
406
+ # @param scope [String] The scope of the event subscription. The scope can be a
407
+ # subscription, or a resource group, or a top level resource belonging to a
408
+ # resource provider namespace, or an EventGrid topic. For example, use
409
+ # '/subscriptions/{subscriptionId}/' for a subscription,
410
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
411
+ # resource group, and
412
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
413
+ # for a resource, and
414
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
415
+ # for an EventGrid topic.
416
+ # @param event_subscription_name [String] Name of the event subscription.
417
+ # @param [Hash{String => String}] A hash of custom headers that will be added
418
+ # to the HTTP request.
419
+ #
420
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
421
+ #
422
+ def get_full_url_async(scope, event_subscription_name, custom_headers:nil)
423
+ fail ArgumentError, 'scope is nil' if scope.nil?
424
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
425
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
426
+
427
+
428
+ request_headers = {}
429
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
430
+
431
+ # Set Headers
432
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
433
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
434
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl'
435
+
436
+ request_url = @base_url || @client.base_url
437
+
438
+ options = {
439
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
440
+ path_params: {'eventSubscriptionName' => event_subscription_name},
441
+ skip_encoding_path_params: {'scope' => scope},
442
+ query_params: {'api-version' => @client.api_version},
443
+ headers: request_headers.merge(custom_headers || {}),
444
+ base_url: request_url
445
+ }
446
+ promise = @client.make_request_async(:post, path_template, options)
447
+
448
+ promise = promise.then do |result|
449
+ http_response = result.response
450
+ status_code = http_response.status
451
+ response_content = http_response.body
452
+ unless status_code == 200
453
+ error_model = JSON.load(response_content)
454
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
455
+ end
456
+
457
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
458
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
459
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
460
+ # Deserialize Response
461
+ if status_code == 200
462
+ begin
463
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
464
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionFullUrl.mapper()
465
+ result.body = @client.deserialize(result_mapper, parsed_response)
466
+ rescue Exception => e
467
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
468
+ end
469
+ end
470
+
471
+ result
472
+ end
473
+
474
+ promise.execute
475
+ end
476
+
477
+ #
478
+ # Get an aggregated list of all global event subscriptions under an Azure
479
+ # subscription.
480
+ #
481
+ # List all aggregated global event subscriptions under a specific Azure
482
+ # subscription.
483
+ #
484
+ # @param filter [String] The query used to filter the search results using
485
+ # OData syntax. Filtering is permitted on the 'name' property only and with
486
+ # limited number of OData operations. These operations are: the 'contains'
487
+ # function as well as the following logical operations: not, and, or, eq (for
488
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
489
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
490
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
491
+ # $filter=location eq 'westus'.
492
+ # @param top [Integer] The number of results to return per page for the list
493
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
494
+ # default number of results to be returned is 20 items per page.
495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
+ # will be added to the HTTP request.
497
+ #
498
+ # @return [Array<EventSubscription>] operation results.
499
+ #
500
+ def list_global_by_subscription(filter:nil, top:nil, custom_headers:nil)
501
+ first_page = list_global_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
502
+ first_page.get_all_items
503
+ end
504
+
505
+ #
506
+ # Get an aggregated list of all global event subscriptions under an Azure
507
+ # subscription.
508
+ #
509
+ # List all aggregated global event subscriptions under a specific Azure
510
+ # subscription.
511
+ #
512
+ # @param filter [String] The query used to filter the search results using
513
+ # OData syntax. Filtering is permitted on the 'name' property only and with
514
+ # limited number of OData operations. These operations are: the 'contains'
515
+ # function as well as the following logical operations: not, and, or, eq (for
516
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
517
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
518
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
519
+ # $filter=location eq 'westus'.
520
+ # @param top [Integer] The number of results to return per page for the list
521
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
522
+ # default number of results to be returned is 20 items per page.
523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
524
+ # will be added to the HTTP request.
525
+ #
526
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
527
+ #
528
+ def list_global_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil)
529
+ list_global_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
530
+ end
531
+
532
+ #
533
+ # Get an aggregated list of all global event subscriptions under an Azure
534
+ # subscription.
535
+ #
536
+ # List all aggregated global event subscriptions under a specific Azure
537
+ # subscription.
538
+ #
539
+ # @param filter [String] The query used to filter the search results using
540
+ # OData syntax. Filtering is permitted on the 'name' property only and with
541
+ # limited number of OData operations. These operations are: the 'contains'
542
+ # function as well as the following logical operations: not, and, or, eq (for
543
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
544
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
545
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
546
+ # $filter=location eq 'westus'.
547
+ # @param top [Integer] The number of results to return per page for the list
548
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
549
+ # default number of results to be returned is 20 items per page.
550
+ # @param [Hash{String => String}] A hash of custom headers that will be added
551
+ # to the HTTP request.
552
+ #
553
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
554
+ #
555
+ def list_global_by_subscription_async(filter:nil, top:nil, custom_headers:nil)
556
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
557
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
558
+
559
+
560
+ request_headers = {}
561
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
562
+
563
+ # Set Headers
564
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions'
567
+
568
+ request_url = @base_url || @client.base_url
569
+
570
+ options = {
571
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
572
+ path_params: {'subscriptionId' => @client.subscription_id},
573
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
574
+ headers: request_headers.merge(custom_headers || {}),
575
+ base_url: request_url
576
+ }
577
+ promise = @client.make_request_async(:get, path_template, options)
578
+
579
+ promise = promise.then do |result|
580
+ http_response = result.response
581
+ status_code = http_response.status
582
+ response_content = http_response.body
583
+ unless status_code == 200
584
+ error_model = JSON.load(response_content)
585
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
586
+ end
587
+
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
590
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
591
+ # Deserialize Response
592
+ if status_code == 200
593
+ begin
594
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
595
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
596
+ result.body = @client.deserialize(result_mapper, parsed_response)
597
+ rescue Exception => e
598
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
599
+ end
600
+ end
601
+
602
+ result
603
+ end
604
+
605
+ promise.execute
606
+ end
607
+
608
+ #
609
+ # List all global event subscriptions for a topic type.
610
+ #
611
+ # List all global event subscriptions under an Azure subscription for a topic
612
+ # type.
613
+ #
614
+ # @param topic_type_name [String] Name of the topic type.
615
+ # @param filter [String] The query used to filter the search results using
616
+ # OData syntax. Filtering is permitted on the 'name' property only and with
617
+ # limited number of OData operations. These operations are: the 'contains'
618
+ # function as well as the following logical operations: not, and, or, eq (for
619
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
620
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
621
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
622
+ # $filter=location eq 'westus'.
623
+ # @param top [Integer] The number of results to return per page for the list
624
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
625
+ # default number of results to be returned is 20 items per page.
626
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
627
+ # will be added to the HTTP request.
628
+ #
629
+ # @return [Array<EventSubscription>] operation results.
630
+ #
631
+ def list_global_by_subscription_for_topic_type(topic_type_name, filter:nil, top:nil, custom_headers:nil)
632
+ first_page = list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:filter, top:top, custom_headers:custom_headers)
633
+ first_page.get_all_items
634
+ end
635
+
636
+ #
637
+ # List all global event subscriptions for a topic type.
638
+ #
639
+ # List all global event subscriptions under an Azure subscription for a topic
640
+ # type.
641
+ #
642
+ # @param topic_type_name [String] Name of the topic type.
643
+ # @param filter [String] The query used to filter the search results using
644
+ # OData syntax. Filtering is permitted on the 'name' property only and with
645
+ # limited number of OData operations. These operations are: the 'contains'
646
+ # function as well as the following logical operations: not, and, or, eq (for
647
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
648
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
649
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
650
+ # $filter=location eq 'westus'.
651
+ # @param top [Integer] The number of results to return per page for the list
652
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
653
+ # default number of results to be returned is 20 items per page.
654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
655
+ # will be added to the HTTP request.
656
+ #
657
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
658
+ #
659
+ def list_global_by_subscription_for_topic_type_with_http_info(topic_type_name, filter:nil, top:nil, custom_headers:nil)
660
+ list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
661
+ end
662
+
663
+ #
664
+ # List all global event subscriptions for a topic type.
665
+ #
666
+ # List all global event subscriptions under an Azure subscription for a topic
667
+ # type.
668
+ #
669
+ # @param topic_type_name [String] Name of the topic type.
670
+ # @param filter [String] The query used to filter the search results using
671
+ # OData syntax. Filtering is permitted on the 'name' property only and with
672
+ # limited number of OData operations. These operations are: the 'contains'
673
+ # function as well as the following logical operations: not, and, or, eq (for
674
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
675
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
676
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
677
+ # $filter=location eq 'westus'.
678
+ # @param top [Integer] The number of results to return per page for the list
679
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
680
+ # default number of results to be returned is 20 items per page.
681
+ # @param [Hash{String => String}] A hash of custom headers that will be added
682
+ # to the HTTP request.
683
+ #
684
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
685
+ #
686
+ def list_global_by_subscription_for_topic_type_async(topic_type_name, filter:nil, top:nil, custom_headers:nil)
687
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
688
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
689
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
690
+
691
+
692
+ request_headers = {}
693
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
694
+
695
+ # Set Headers
696
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
697
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
698
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'
699
+
700
+ request_url = @base_url || @client.base_url
701
+
702
+ options = {
703
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
704
+ path_params: {'subscriptionId' => @client.subscription_id,'topicTypeName' => topic_type_name},
705
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
706
+ headers: request_headers.merge(custom_headers || {}),
707
+ base_url: request_url
708
+ }
709
+ promise = @client.make_request_async(:get, path_template, options)
710
+
711
+ promise = promise.then do |result|
712
+ http_response = result.response
713
+ status_code = http_response.status
714
+ response_content = http_response.body
715
+ unless status_code == 200
716
+ error_model = JSON.load(response_content)
717
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
718
+ end
719
+
720
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
721
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
722
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
723
+ # Deserialize Response
724
+ if status_code == 200
725
+ begin
726
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
727
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
728
+ result.body = @client.deserialize(result_mapper, parsed_response)
729
+ rescue Exception => e
730
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
731
+ end
732
+ end
733
+
734
+ result
735
+ end
736
+
737
+ promise.execute
738
+ end
739
+
740
+ #
741
+ # List all global event subscriptions under an Azure subscription and resource
742
+ # group.
743
+ #
744
+ # List all global event subscriptions under a specific Azure subscription and
745
+ # resource group.
746
+ #
747
+ # @param resource_group_name [String] The name of the resource group within the
748
+ # user's subscription.
749
+ # @param filter [String] The query used to filter the search results using
750
+ # OData syntax. Filtering is permitted on the 'name' property only and with
751
+ # limited number of OData operations. These operations are: the 'contains'
752
+ # function as well as the following logical operations: not, and, or, eq (for
753
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
754
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
755
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
756
+ # $filter=location eq 'westus'.
757
+ # @param top [Integer] The number of results to return per page for the list
758
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
759
+ # default number of results to be returned is 20 items per page.
760
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
761
+ # will be added to the HTTP request.
762
+ #
763
+ # @return [Array<EventSubscription>] operation results.
764
+ #
765
+ def list_global_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
766
+ first_page = list_global_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
767
+ first_page.get_all_items
768
+ end
769
+
770
+ #
771
+ # List all global event subscriptions under an Azure subscription and resource
772
+ # group.
773
+ #
774
+ # List all global event subscriptions under a specific Azure subscription and
775
+ # resource group.
776
+ #
777
+ # @param resource_group_name [String] The name of the resource group within the
778
+ # user's subscription.
779
+ # @param filter [String] The query used to filter the search results using
780
+ # OData syntax. Filtering is permitted on the 'name' property only and with
781
+ # limited number of OData operations. These operations are: the 'contains'
782
+ # function as well as the following logical operations: not, and, or, eq (for
783
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
784
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
785
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
786
+ # $filter=location eq 'westus'.
787
+ # @param top [Integer] The number of results to return per page for the list
788
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
789
+ # default number of results to be returned is 20 items per page.
790
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
791
+ # will be added to the HTTP request.
792
+ #
793
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
794
+ #
795
+ def list_global_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
796
+ list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
797
+ end
798
+
799
+ #
800
+ # List all global event subscriptions under an Azure subscription and resource
801
+ # group.
802
+ #
803
+ # List all global event subscriptions under a specific Azure subscription and
804
+ # resource group.
805
+ #
806
+ # @param resource_group_name [String] The name of the resource group within the
807
+ # user's subscription.
808
+ # @param filter [String] The query used to filter the search results using
809
+ # OData syntax. Filtering is permitted on the 'name' property only and with
810
+ # limited number of OData operations. These operations are: the 'contains'
811
+ # function as well as the following logical operations: not, and, or, eq (for
812
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
813
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
814
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
815
+ # $filter=location eq 'westus'.
816
+ # @param top [Integer] The number of results to return per page for the list
817
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
818
+ # default number of results to be returned is 20 items per page.
819
+ # @param [Hash{String => String}] A hash of custom headers that will be added
820
+ # to the HTTP request.
821
+ #
822
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
823
+ #
824
+ def list_global_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
825
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
826
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
827
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
828
+
829
+
830
+ request_headers = {}
831
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
832
+
833
+ # Set Headers
834
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
835
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
836
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions'
837
+
838
+ request_url = @base_url || @client.base_url
839
+
840
+ options = {
841
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
842
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
843
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
844
+ headers: request_headers.merge(custom_headers || {}),
845
+ base_url: request_url
846
+ }
847
+ promise = @client.make_request_async(:get, path_template, options)
848
+
849
+ promise = promise.then do |result|
850
+ http_response = result.response
851
+ status_code = http_response.status
852
+ response_content = http_response.body
853
+ unless status_code == 200
854
+ error_model = JSON.load(response_content)
855
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
856
+ end
857
+
858
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
859
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
860
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
861
+ # Deserialize Response
862
+ if status_code == 200
863
+ begin
864
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
865
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
866
+ result.body = @client.deserialize(result_mapper, parsed_response)
867
+ rescue Exception => e
868
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
869
+ end
870
+ end
871
+
872
+ result
873
+ end
874
+
875
+ promise.execute
876
+ end
877
+
878
+ #
879
+ # List all global event subscriptions under a resource group for a topic type.
880
+ #
881
+ # List all global event subscriptions under a resource group for a specific
882
+ # topic type.
883
+ #
884
+ # @param resource_group_name [String] The name of the resource group within the
885
+ # user's subscription.
886
+ # @param topic_type_name [String] Name of the topic type.
887
+ # @param filter [String] The query used to filter the search results using
888
+ # OData syntax. Filtering is permitted on the 'name' property only and with
889
+ # limited number of OData operations. These operations are: the 'contains'
890
+ # function as well as the following logical operations: not, and, or, eq (for
891
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
892
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
893
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
894
+ # $filter=location eq 'westus'.
895
+ # @param top [Integer] The number of results to return per page for the list
896
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
897
+ # default number of results to be returned is 20 items per page.
898
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
899
+ # will be added to the HTTP request.
900
+ #
901
+ # @return [Array<EventSubscription>] operation results.
902
+ #
903
+ def list_global_by_resource_group_for_topic_type(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil)
904
+ first_page = list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers)
905
+ first_page.get_all_items
906
+ end
907
+
908
+ #
909
+ # List all global event subscriptions under a resource group for a topic type.
910
+ #
911
+ # List all global event subscriptions under a resource group for a specific
912
+ # topic type.
913
+ #
914
+ # @param resource_group_name [String] The name of the resource group within the
915
+ # user's subscription.
916
+ # @param topic_type_name [String] Name of the topic type.
917
+ # @param filter [String] The query used to filter the search results using
918
+ # OData syntax. Filtering is permitted on the 'name' property only and with
919
+ # limited number of OData operations. These operations are: the 'contains'
920
+ # function as well as the following logical operations: not, and, or, eq (for
921
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
922
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
923
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
924
+ # $filter=location eq 'westus'.
925
+ # @param top [Integer] The number of results to return per page for the list
926
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
927
+ # default number of results to be returned is 20 items per page.
928
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
929
+ # will be added to the HTTP request.
930
+ #
931
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
932
+ #
933
+ def list_global_by_resource_group_for_topic_type_with_http_info(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil)
934
+ list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
935
+ end
936
+
937
+ #
938
+ # List all global event subscriptions under a resource group for a topic type.
939
+ #
940
+ # List all global event subscriptions under a resource group for a specific
941
+ # topic type.
942
+ #
943
+ # @param resource_group_name [String] The name of the resource group within the
944
+ # user's subscription.
945
+ # @param topic_type_name [String] Name of the topic type.
946
+ # @param filter [String] The query used to filter the search results using
947
+ # OData syntax. Filtering is permitted on the 'name' property only and with
948
+ # limited number of OData operations. These operations are: the 'contains'
949
+ # function as well as the following logical operations: not, and, or, eq (for
950
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
951
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
952
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
953
+ # $filter=location eq 'westus'.
954
+ # @param top [Integer] The number of results to return per page for the list
955
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
956
+ # default number of results to be returned is 20 items per page.
957
+ # @param [Hash{String => String}] A hash of custom headers that will be added
958
+ # to the HTTP request.
959
+ #
960
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
961
+ #
962
+ def list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil)
963
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
964
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
965
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
966
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
967
+
968
+
969
+ request_headers = {}
970
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
971
+
972
+ # Set Headers
973
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
974
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
975
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'
976
+
977
+ request_url = @base_url || @client.base_url
978
+
979
+ options = {
980
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
981
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'topicTypeName' => topic_type_name},
982
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
983
+ headers: request_headers.merge(custom_headers || {}),
984
+ base_url: request_url
985
+ }
986
+ promise = @client.make_request_async(:get, path_template, options)
987
+
988
+ promise = promise.then do |result|
989
+ http_response = result.response
990
+ status_code = http_response.status
991
+ response_content = http_response.body
992
+ unless status_code == 200
993
+ error_model = JSON.load(response_content)
994
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
995
+ end
996
+
997
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
998
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
999
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1000
+ # Deserialize Response
1001
+ if status_code == 200
1002
+ begin
1003
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1004
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1005
+ result.body = @client.deserialize(result_mapper, parsed_response)
1006
+ rescue Exception => e
1007
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1008
+ end
1009
+ end
1010
+
1011
+ result
1012
+ end
1013
+
1014
+ promise.execute
1015
+ end
1016
+
1017
+ #
1018
+ # List all regional event subscriptions under an Azure subscription.
1019
+ #
1020
+ # List all event subscriptions from the given location under a specific Azure
1021
+ # subscription.
1022
+ #
1023
+ # @param location [String] Name of the location.
1024
+ # @param filter [String] The query used to filter the search results using
1025
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1026
+ # limited number of OData operations. These operations are: the 'contains'
1027
+ # function as well as the following logical operations: not, and, or, eq (for
1028
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1029
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1030
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1031
+ # $filter=location eq 'westus'.
1032
+ # @param top [Integer] The number of results to return per page for the list
1033
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1034
+ # default number of results to be returned is 20 items per page.
1035
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1036
+ # will be added to the HTTP request.
1037
+ #
1038
+ # @return [Array<EventSubscription>] operation results.
1039
+ #
1040
+ def list_regional_by_subscription(location, filter:nil, top:nil, custom_headers:nil)
1041
+ first_page = list_regional_by_subscription_as_lazy(location, filter:filter, top:top, custom_headers:custom_headers)
1042
+ first_page.get_all_items
1043
+ end
1044
+
1045
+ #
1046
+ # List all regional event subscriptions under an Azure subscription.
1047
+ #
1048
+ # List all event subscriptions from the given location under a specific Azure
1049
+ # subscription.
1050
+ #
1051
+ # @param location [String] Name of the location.
1052
+ # @param filter [String] The query used to filter the search results using
1053
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1054
+ # limited number of OData operations. These operations are: the 'contains'
1055
+ # function as well as the following logical operations: not, and, or, eq (for
1056
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1057
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1058
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1059
+ # $filter=location eq 'westus'.
1060
+ # @param top [Integer] The number of results to return per page for the list
1061
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1062
+ # default number of results to be returned is 20 items per page.
1063
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1064
+ # will be added to the HTTP request.
1065
+ #
1066
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1067
+ #
1068
+ def list_regional_by_subscription_with_http_info(location, filter:nil, top:nil, custom_headers:nil)
1069
+ list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers:custom_headers).value!
1070
+ end
1071
+
1072
+ #
1073
+ # List all regional event subscriptions under an Azure subscription.
1074
+ #
1075
+ # List all event subscriptions from the given location under a specific Azure
1076
+ # subscription.
1077
+ #
1078
+ # @param location [String] Name of the location.
1079
+ # @param filter [String] The query used to filter the search results using
1080
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1081
+ # limited number of OData operations. These operations are: the 'contains'
1082
+ # function as well as the following logical operations: not, and, or, eq (for
1083
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1084
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1085
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1086
+ # $filter=location eq 'westus'.
1087
+ # @param top [Integer] The number of results to return per page for the list
1088
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1089
+ # default number of results to be returned is 20 items per page.
1090
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1091
+ # to the HTTP request.
1092
+ #
1093
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1094
+ #
1095
+ def list_regional_by_subscription_async(location, filter:nil, top:nil, custom_headers:nil)
1096
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1097
+ fail ArgumentError, 'location is nil' if location.nil?
1098
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1099
+
1100
+
1101
+ request_headers = {}
1102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1107
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'
1108
+
1109
+ request_url = @base_url || @client.base_url
1110
+
1111
+ options = {
1112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1113
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
1114
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1115
+ headers: request_headers.merge(custom_headers || {}),
1116
+ base_url: request_url
1117
+ }
1118
+ promise = @client.make_request_async(:get, path_template, options)
1119
+
1120
+ promise = promise.then do |result|
1121
+ http_response = result.response
1122
+ status_code = http_response.status
1123
+ response_content = http_response.body
1124
+ unless status_code == 200
1125
+ error_model = JSON.load(response_content)
1126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1127
+ end
1128
+
1129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1130
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1131
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1132
+ # Deserialize Response
1133
+ if status_code == 200
1134
+ begin
1135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1136
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1137
+ result.body = @client.deserialize(result_mapper, parsed_response)
1138
+ rescue Exception => e
1139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1140
+ end
1141
+ end
1142
+
1143
+ result
1144
+ end
1145
+
1146
+ promise.execute
1147
+ end
1148
+
1149
+ #
1150
+ # List all regional event subscriptions under an Azure subscription and
1151
+ # resource group.
1152
+ #
1153
+ # List all event subscriptions from the given location under a specific Azure
1154
+ # subscription and resource group.
1155
+ #
1156
+ # @param resource_group_name [String] The name of the resource group within the
1157
+ # user's subscription.
1158
+ # @param location [String] Name of the location.
1159
+ # @param filter [String] The query used to filter the search results using
1160
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1161
+ # limited number of OData operations. These operations are: the 'contains'
1162
+ # function as well as the following logical operations: not, and, or, eq (for
1163
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1164
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1165
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1166
+ # $filter=location eq 'westus'.
1167
+ # @param top [Integer] The number of results to return per page for the list
1168
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1169
+ # default number of results to be returned is 20 items per page.
1170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1171
+ # will be added to the HTTP request.
1172
+ #
1173
+ # @return [Array<EventSubscription>] operation results.
1174
+ #
1175
+ def list_regional_by_resource_group(resource_group_name, location, filter:nil, top:nil, custom_headers:nil)
1176
+ first_page = list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers)
1177
+ first_page.get_all_items
1178
+ end
1179
+
1180
+ #
1181
+ # List all regional event subscriptions under an Azure subscription and
1182
+ # resource group.
1183
+ #
1184
+ # List all event subscriptions from the given location under a specific Azure
1185
+ # subscription and resource group.
1186
+ #
1187
+ # @param resource_group_name [String] The name of the resource group within the
1188
+ # user's subscription.
1189
+ # @param location [String] Name of the location.
1190
+ # @param filter [String] The query used to filter the search results using
1191
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1192
+ # limited number of OData operations. These operations are: the 'contains'
1193
+ # function as well as the following logical operations: not, and, or, eq (for
1194
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1195
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1196
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1197
+ # $filter=location eq 'westus'.
1198
+ # @param top [Integer] The number of results to return per page for the list
1199
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1200
+ # default number of results to be returned is 20 items per page.
1201
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1202
+ # will be added to the HTTP request.
1203
+ #
1204
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1205
+ #
1206
+ def list_regional_by_resource_group_with_http_info(resource_group_name, location, filter:nil, top:nil, custom_headers:nil)
1207
+ list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers).value!
1208
+ end
1209
+
1210
+ #
1211
+ # List all regional event subscriptions under an Azure subscription and
1212
+ # resource group.
1213
+ #
1214
+ # List all event subscriptions from the given location under a specific Azure
1215
+ # subscription and resource group.
1216
+ #
1217
+ # @param resource_group_name [String] The name of the resource group within the
1218
+ # user's subscription.
1219
+ # @param location [String] Name of the location.
1220
+ # @param filter [String] The query used to filter the search results using
1221
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1222
+ # limited number of OData operations. These operations are: the 'contains'
1223
+ # function as well as the following logical operations: not, and, or, eq (for
1224
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1225
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1226
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1227
+ # $filter=location eq 'westus'.
1228
+ # @param top [Integer] The number of results to return per page for the list
1229
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1230
+ # default number of results to be returned is 20 items per page.
1231
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1232
+ # to the HTTP request.
1233
+ #
1234
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1235
+ #
1236
+ def list_regional_by_resource_group_async(resource_group_name, location, filter:nil, top:nil, custom_headers:nil)
1237
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1238
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1239
+ fail ArgumentError, 'location is nil' if location.nil?
1240
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1241
+
1242
+
1243
+ request_headers = {}
1244
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1245
+
1246
+ # Set Headers
1247
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1248
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1249
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'
1250
+
1251
+ request_url = @base_url || @client.base_url
1252
+
1253
+ options = {
1254
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1255
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location},
1256
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1257
+ headers: request_headers.merge(custom_headers || {}),
1258
+ base_url: request_url
1259
+ }
1260
+ promise = @client.make_request_async(:get, path_template, options)
1261
+
1262
+ promise = promise.then do |result|
1263
+ http_response = result.response
1264
+ status_code = http_response.status
1265
+ response_content = http_response.body
1266
+ unless status_code == 200
1267
+ error_model = JSON.load(response_content)
1268
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1269
+ end
1270
+
1271
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1272
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1273
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1274
+ # Deserialize Response
1275
+ if status_code == 200
1276
+ begin
1277
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1278
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1279
+ result.body = @client.deserialize(result_mapper, parsed_response)
1280
+ rescue Exception => e
1281
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1282
+ end
1283
+ end
1284
+
1285
+ result
1286
+ end
1287
+
1288
+ promise.execute
1289
+ end
1290
+
1291
+ #
1292
+ # List all regional event subscriptions under an Azure subscription for a topic
1293
+ # type.
1294
+ #
1295
+ # List all event subscriptions from the given location under a specific Azure
1296
+ # subscription and topic type.
1297
+ #
1298
+ # @param location [String] Name of the location.
1299
+ # @param topic_type_name [String] Name of the topic type.
1300
+ # @param filter [String] The query used to filter the search results using
1301
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1302
+ # limited number of OData operations. These operations are: the 'contains'
1303
+ # function as well as the following logical operations: not, and, or, eq (for
1304
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1305
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1306
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1307
+ # $filter=location eq 'westus'.
1308
+ # @param top [Integer] The number of results to return per page for the list
1309
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1310
+ # default number of results to be returned is 20 items per page.
1311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1312
+ # will be added to the HTTP request.
1313
+ #
1314
+ # @return [Array<EventSubscription>] operation results.
1315
+ #
1316
+ def list_regional_by_subscription_for_topic_type(location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1317
+ first_page = list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers)
1318
+ first_page.get_all_items
1319
+ end
1320
+
1321
+ #
1322
+ # List all regional event subscriptions under an Azure subscription for a topic
1323
+ # type.
1324
+ #
1325
+ # List all event subscriptions from the given location under a specific Azure
1326
+ # subscription and topic type.
1327
+ #
1328
+ # @param location [String] Name of the location.
1329
+ # @param topic_type_name [String] Name of the topic type.
1330
+ # @param filter [String] The query used to filter the search results using
1331
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1332
+ # limited number of OData operations. These operations are: the 'contains'
1333
+ # function as well as the following logical operations: not, and, or, eq (for
1334
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1335
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1336
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1337
+ # $filter=location eq 'westus'.
1338
+ # @param top [Integer] The number of results to return per page for the list
1339
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1340
+ # default number of results to be returned is 20 items per page.
1341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1342
+ # will be added to the HTTP request.
1343
+ #
1344
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1345
+ #
1346
+ def list_regional_by_subscription_for_topic_type_with_http_info(location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1347
+ list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
1348
+ end
1349
+
1350
+ #
1351
+ # List all regional event subscriptions under an Azure subscription for a topic
1352
+ # type.
1353
+ #
1354
+ # List all event subscriptions from the given location under a specific Azure
1355
+ # subscription and topic type.
1356
+ #
1357
+ # @param location [String] Name of the location.
1358
+ # @param topic_type_name [String] Name of the topic type.
1359
+ # @param filter [String] The query used to filter the search results using
1360
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1361
+ # limited number of OData operations. These operations are: the 'contains'
1362
+ # function as well as the following logical operations: not, and, or, eq (for
1363
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1364
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1365
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1366
+ # $filter=location eq 'westus'.
1367
+ # @param top [Integer] The number of results to return per page for the list
1368
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1369
+ # default number of results to be returned is 20 items per page.
1370
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1371
+ # to the HTTP request.
1372
+ #
1373
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1374
+ #
1375
+ def list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1376
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1377
+ fail ArgumentError, 'location is nil' if location.nil?
1378
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
1379
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1380
+
1381
+
1382
+ request_headers = {}
1383
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1384
+
1385
+ # Set Headers
1386
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1387
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1388
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'
1389
+
1390
+ request_url = @base_url || @client.base_url
1391
+
1392
+ options = {
1393
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1394
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location,'topicTypeName' => topic_type_name},
1395
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1396
+ headers: request_headers.merge(custom_headers || {}),
1397
+ base_url: request_url
1398
+ }
1399
+ promise = @client.make_request_async(:get, path_template, options)
1400
+
1401
+ promise = promise.then do |result|
1402
+ http_response = result.response
1403
+ status_code = http_response.status
1404
+ response_content = http_response.body
1405
+ unless status_code == 200
1406
+ error_model = JSON.load(response_content)
1407
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1408
+ end
1409
+
1410
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1411
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1412
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1413
+ # Deserialize Response
1414
+ if status_code == 200
1415
+ begin
1416
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1417
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1418
+ result.body = @client.deserialize(result_mapper, parsed_response)
1419
+ rescue Exception => e
1420
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1421
+ end
1422
+ end
1423
+
1424
+ result
1425
+ end
1426
+
1427
+ promise.execute
1428
+ end
1429
+
1430
+ #
1431
+ # List all regional event subscriptions under an Azure subscription and
1432
+ # resource group for a topic type.
1433
+ #
1434
+ # List all event subscriptions from the given location under a specific Azure
1435
+ # subscription and resource group and topic type.
1436
+ #
1437
+ # @param resource_group_name [String] The name of the resource group within the
1438
+ # user's subscription.
1439
+ # @param location [String] Name of the location.
1440
+ # @param topic_type_name [String] Name of the topic type.
1441
+ # @param filter [String] The query used to filter the search results using
1442
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1443
+ # limited number of OData operations. These operations are: the 'contains'
1444
+ # function as well as the following logical operations: not, and, or, eq (for
1445
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1446
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1447
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1448
+ # $filter=location eq 'westus'.
1449
+ # @param top [Integer] The number of results to return per page for the list
1450
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1451
+ # default number of results to be returned is 20 items per page.
1452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1453
+ # will be added to the HTTP request.
1454
+ #
1455
+ # @return [Array<EventSubscription>] operation results.
1456
+ #
1457
+ def list_regional_by_resource_group_for_topic_type(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1458
+ first_page = list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers)
1459
+ first_page.get_all_items
1460
+ end
1461
+
1462
+ #
1463
+ # List all regional event subscriptions under an Azure subscription and
1464
+ # resource group for a topic type.
1465
+ #
1466
+ # List all event subscriptions from the given location under a specific Azure
1467
+ # subscription and resource group and topic type.
1468
+ #
1469
+ # @param resource_group_name [String] The name of the resource group within the
1470
+ # user's subscription.
1471
+ # @param location [String] Name of the location.
1472
+ # @param topic_type_name [String] Name of the topic type.
1473
+ # @param filter [String] The query used to filter the search results using
1474
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1475
+ # limited number of OData operations. These operations are: the 'contains'
1476
+ # function as well as the following logical operations: not, and, or, eq (for
1477
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1478
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1479
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1480
+ # $filter=location eq 'westus'.
1481
+ # @param top [Integer] The number of results to return per page for the list
1482
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1483
+ # default number of results to be returned is 20 items per page.
1484
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1485
+ # will be added to the HTTP request.
1486
+ #
1487
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1488
+ #
1489
+ def list_regional_by_resource_group_for_topic_type_with_http_info(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1490
+ list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
1491
+ end
1492
+
1493
+ #
1494
+ # List all regional event subscriptions under an Azure subscription and
1495
+ # resource group for a topic type.
1496
+ #
1497
+ # List all event subscriptions from the given location under a specific Azure
1498
+ # subscription and resource group and topic type.
1499
+ #
1500
+ # @param resource_group_name [String] The name of the resource group within the
1501
+ # user's subscription.
1502
+ # @param location [String] Name of the location.
1503
+ # @param topic_type_name [String] Name of the topic type.
1504
+ # @param filter [String] The query used to filter the search results using
1505
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1506
+ # limited number of OData operations. These operations are: the 'contains'
1507
+ # function as well as the following logical operations: not, and, or, eq (for
1508
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1509
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1510
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1511
+ # $filter=location eq 'westus'.
1512
+ # @param top [Integer] The number of results to return per page for the list
1513
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1514
+ # default number of results to be returned is 20 items per page.
1515
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1516
+ # to the HTTP request.
1517
+ #
1518
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1519
+ #
1520
+ def list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
1521
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1522
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1523
+ fail ArgumentError, 'location is nil' if location.nil?
1524
+ fail ArgumentError, 'topic_type_name is nil' if topic_type_name.nil?
1525
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1526
+
1527
+
1528
+ request_headers = {}
1529
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1530
+
1531
+ # Set Headers
1532
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1533
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1534
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'
1535
+
1536
+ request_url = @base_url || @client.base_url
1537
+
1538
+ options = {
1539
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1540
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'location' => location,'topicTypeName' => topic_type_name},
1541
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1542
+ headers: request_headers.merge(custom_headers || {}),
1543
+ base_url: request_url
1544
+ }
1545
+ promise = @client.make_request_async(:get, path_template, options)
1546
+
1547
+ promise = promise.then do |result|
1548
+ http_response = result.response
1549
+ status_code = http_response.status
1550
+ response_content = http_response.body
1551
+ unless status_code == 200
1552
+ error_model = JSON.load(response_content)
1553
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1554
+ end
1555
+
1556
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1557
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1558
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1559
+ # Deserialize Response
1560
+ if status_code == 200
1561
+ begin
1562
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1563
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1564
+ result.body = @client.deserialize(result_mapper, parsed_response)
1565
+ rescue Exception => e
1566
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1567
+ end
1568
+ end
1569
+
1570
+ result
1571
+ end
1572
+
1573
+ promise.execute
1574
+ end
1575
+
1576
+ #
1577
+ # List all event subscriptions for a specific topic.
1578
+ #
1579
+ # List all event subscriptions that have been created for a specific topic.
1580
+ #
1581
+ # @param resource_group_name [String] The name of the resource group within the
1582
+ # user's subscription.
1583
+ # @param provider_namespace [String] Namespace of the provider of the topic.
1584
+ # @param resource_type_name [String] Name of the resource type.
1585
+ # @param resource_name [String] Name of the resource.
1586
+ # @param filter [String] The query used to filter the search results using
1587
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1588
+ # limited number of OData operations. These operations are: the 'contains'
1589
+ # function as well as the following logical operations: not, and, or, eq (for
1590
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1591
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1592
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1593
+ # $filter=location eq 'westus'.
1594
+ # @param top [Integer] The number of results to return per page for the list
1595
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1596
+ # default number of results to be returned is 20 items per page.
1597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1598
+ # will be added to the HTTP request.
1599
+ #
1600
+ # @return [Array<EventSubscription>] operation results.
1601
+ #
1602
+ def list_by_resource(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil)
1603
+ first_page = list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers)
1604
+ first_page.get_all_items
1605
+ end
1606
+
1607
+ #
1608
+ # List all event subscriptions for a specific topic.
1609
+ #
1610
+ # List all event subscriptions that have been created for a specific topic.
1611
+ #
1612
+ # @param resource_group_name [String] The name of the resource group within the
1613
+ # user's subscription.
1614
+ # @param provider_namespace [String] Namespace of the provider of the topic.
1615
+ # @param resource_type_name [String] Name of the resource type.
1616
+ # @param resource_name [String] Name of the resource.
1617
+ # @param filter [String] The query used to filter the search results using
1618
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1619
+ # limited number of OData operations. These operations are: the 'contains'
1620
+ # function as well as the following logical operations: not, and, or, eq (for
1621
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1622
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1623
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1624
+ # $filter=location eq 'westus'.
1625
+ # @param top [Integer] The number of results to return per page for the list
1626
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1627
+ # default number of results to be returned is 20 items per page.
1628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1629
+ # will be added to the HTTP request.
1630
+ #
1631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1632
+ #
1633
+ def list_by_resource_with_http_info(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil)
1634
+ list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers).value!
1635
+ end
1636
+
1637
+ #
1638
+ # List all event subscriptions for a specific topic.
1639
+ #
1640
+ # List all event subscriptions that have been created for a specific topic.
1641
+ #
1642
+ # @param resource_group_name [String] The name of the resource group within the
1643
+ # user's subscription.
1644
+ # @param provider_namespace [String] Namespace of the provider of the topic.
1645
+ # @param resource_type_name [String] Name of the resource type.
1646
+ # @param resource_name [String] Name of the resource.
1647
+ # @param filter [String] The query used to filter the search results using
1648
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1649
+ # limited number of OData operations. These operations are: the 'contains'
1650
+ # function as well as the following logical operations: not, and, or, eq (for
1651
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1652
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1653
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1654
+ # $filter=location eq 'westus'.
1655
+ # @param top [Integer] The number of results to return per page for the list
1656
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1657
+ # default number of results to be returned is 20 items per page.
1658
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1659
+ # to the HTTP request.
1660
+ #
1661
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1662
+ #
1663
+ def list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil)
1664
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1665
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1666
+ fail ArgumentError, 'provider_namespace is nil' if provider_namespace.nil?
1667
+ fail ArgumentError, 'resource_type_name is nil' if resource_type_name.nil?
1668
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1669
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1670
+
1671
+
1672
+ request_headers = {}
1673
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1674
+
1675
+ # Set Headers
1676
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1677
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1678
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions'
1679
+
1680
+ request_url = @base_url || @client.base_url
1681
+
1682
+ options = {
1683
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1684
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerNamespace' => provider_namespace,'resourceTypeName' => resource_type_name,'resourceName' => resource_name},
1685
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1686
+ headers: request_headers.merge(custom_headers || {}),
1687
+ base_url: request_url
1688
+ }
1689
+ promise = @client.make_request_async(:get, path_template, options)
1690
+
1691
+ promise = promise.then do |result|
1692
+ http_response = result.response
1693
+ status_code = http_response.status
1694
+ response_content = http_response.body
1695
+ unless status_code == 200
1696
+ error_model = JSON.load(response_content)
1697
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1698
+ end
1699
+
1700
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1701
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1702
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1703
+ # Deserialize Response
1704
+ if status_code == 200
1705
+ begin
1706
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1707
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1708
+ result.body = @client.deserialize(result_mapper, parsed_response)
1709
+ rescue Exception => e
1710
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1711
+ end
1712
+ end
1713
+
1714
+ result
1715
+ end
1716
+
1717
+ promise.execute
1718
+ end
1719
+
1720
+ #
1721
+ # List all event subscriptions for a specific domain topic.
1722
+ #
1723
+ # List all event subscriptions that have been created for a specific domain
1724
+ # topic.
1725
+ #
1726
+ # @param resource_group_name [String] The name of the resource group within the
1727
+ # user's subscription.
1728
+ # @param domain_name [String] Name of the top level domain.
1729
+ # @param topic_name [String] Name of the domain topic.
1730
+ # @param filter [String] The query used to filter the search results using
1731
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1732
+ # limited number of OData operations. These operations are: the 'contains'
1733
+ # function as well as the following logical operations: not, and, or, eq (for
1734
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1735
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1736
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1737
+ # $filter=location eq 'westus'.
1738
+ # @param top [Integer] The number of results to return per page for the list
1739
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1740
+ # default number of results to be returned is 20 items per page.
1741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1742
+ # will be added to the HTTP request.
1743
+ #
1744
+ # @return [Array<EventSubscription>] operation results.
1745
+ #
1746
+ def list_by_domain_topic(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil)
1747
+ first_page = list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers)
1748
+ first_page.get_all_items
1749
+ end
1750
+
1751
+ #
1752
+ # List all event subscriptions for a specific domain topic.
1753
+ #
1754
+ # List all event subscriptions that have been created for a specific domain
1755
+ # topic.
1756
+ #
1757
+ # @param resource_group_name [String] The name of the resource group within the
1758
+ # user's subscription.
1759
+ # @param domain_name [String] Name of the top level domain.
1760
+ # @param topic_name [String] Name of the domain topic.
1761
+ # @param filter [String] The query used to filter the search results using
1762
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1763
+ # limited number of OData operations. These operations are: the 'contains'
1764
+ # function as well as the following logical operations: not, and, or, eq (for
1765
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1766
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1767
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1768
+ # $filter=location eq 'westus'.
1769
+ # @param top [Integer] The number of results to return per page for the list
1770
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1771
+ # default number of results to be returned is 20 items per page.
1772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1773
+ # will be added to the HTTP request.
1774
+ #
1775
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1776
+ #
1777
+ def list_by_domain_topic_with_http_info(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil)
1778
+ list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers).value!
1779
+ end
1780
+
1781
+ #
1782
+ # List all event subscriptions for a specific domain topic.
1783
+ #
1784
+ # List all event subscriptions that have been created for a specific domain
1785
+ # topic.
1786
+ #
1787
+ # @param resource_group_name [String] The name of the resource group within the
1788
+ # user's subscription.
1789
+ # @param domain_name [String] Name of the top level domain.
1790
+ # @param topic_name [String] Name of the domain topic.
1791
+ # @param filter [String] The query used to filter the search results using
1792
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1793
+ # limited number of OData operations. These operations are: the 'contains'
1794
+ # function as well as the following logical operations: not, and, or, eq (for
1795
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1796
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1797
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1798
+ # $filter=location eq 'westus'.
1799
+ # @param top [Integer] The number of results to return per page for the list
1800
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1801
+ # default number of results to be returned is 20 items per page.
1802
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1803
+ # to the HTTP request.
1804
+ #
1805
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1806
+ #
1807
+ def list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil)
1808
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1809
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1810
+ fail ArgumentError, 'domain_name is nil' if domain_name.nil?
1811
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
1812
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1813
+
1814
+
1815
+ request_headers = {}
1816
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1817
+
1818
+ # Set Headers
1819
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1820
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1821
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions'
1822
+
1823
+ request_url = @base_url || @client.base_url
1824
+
1825
+ options = {
1826
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1827
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'domainName' => domain_name,'topicName' => topic_name},
1828
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
1829
+ headers: request_headers.merge(custom_headers || {}),
1830
+ base_url: request_url
1831
+ }
1832
+ promise = @client.make_request_async(:get, path_template, options)
1833
+
1834
+ promise = promise.then do |result|
1835
+ http_response = result.response
1836
+ status_code = http_response.status
1837
+ response_content = http_response.body
1838
+ unless status_code == 200
1839
+ error_model = JSON.load(response_content)
1840
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1841
+ end
1842
+
1843
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1844
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1845
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1846
+ # Deserialize Response
1847
+ if status_code == 200
1848
+ begin
1849
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1850
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
1851
+ result.body = @client.deserialize(result_mapper, parsed_response)
1852
+ rescue Exception => e
1853
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1854
+ end
1855
+ end
1856
+
1857
+ result
1858
+ end
1859
+
1860
+ promise.execute
1861
+ end
1862
+
1863
+ #
1864
+ # Create or update an event subscription.
1865
+ #
1866
+ # Asynchronously creates a new event subscription or updates an existing event
1867
+ # subscription based on the specified scope.
1868
+ #
1869
+ # @param scope [String] The identifier of the resource to which the event
1870
+ # subscription needs to be created or updated. The scope can be a subscription,
1871
+ # or a resource group, or a top level resource belonging to a resource provider
1872
+ # namespace, or an EventGrid topic. For example, use
1873
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1874
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1875
+ # resource group, and
1876
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1877
+ # for a resource, and
1878
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1879
+ # for an EventGrid topic.
1880
+ # @param event_subscription_name [String] Name of the event subscription. Event
1881
+ # subscription names must be between 3 and 64 characters in length and should
1882
+ # use alphanumeric letters only.
1883
+ # @param event_subscription_info [EventSubscription] Event subscription
1884
+ # properties containing the destination and filter information.
1885
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1886
+ # will be added to the HTTP request.
1887
+ #
1888
+ # @return [EventSubscription] operation results.
1889
+ #
1890
+ def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
1891
+ response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
1892
+ response.body unless response.nil?
1893
+ end
1894
+
1895
+ #
1896
+ # Create or update an event subscription.
1897
+ #
1898
+ # Asynchronously creates a new event subscription or updates an existing event
1899
+ # subscription based on the specified scope.
1900
+ #
1901
+ # @param scope [String] The identifier of the resource to which the event
1902
+ # subscription needs to be created or updated. The scope can be a subscription,
1903
+ # or a resource group, or a top level resource belonging to a resource provider
1904
+ # namespace, or an EventGrid topic. For example, use
1905
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1906
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1907
+ # resource group, and
1908
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1909
+ # for a resource, and
1910
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1911
+ # for an EventGrid topic.
1912
+ # @param event_subscription_name [String] Name of the event subscription. Event
1913
+ # subscription names must be between 3 and 64 characters in length and should
1914
+ # use alphanumeric letters only.
1915
+ # @param event_subscription_info [EventSubscription] Event subscription
1916
+ # properties containing the destination and filter information.
1917
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1918
+ # will be added to the HTTP request.
1919
+ #
1920
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1921
+ #
1922
+ def begin_create_or_update_with_http_info(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
1923
+ begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
1924
+ end
1925
+
1926
+ #
1927
+ # Create or update an event subscription.
1928
+ #
1929
+ # Asynchronously creates a new event subscription or updates an existing event
1930
+ # subscription based on the specified scope.
1931
+ #
1932
+ # @param scope [String] The identifier of the resource to which the event
1933
+ # subscription needs to be created or updated. The scope can be a subscription,
1934
+ # or a resource group, or a top level resource belonging to a resource provider
1935
+ # namespace, or an EventGrid topic. For example, use
1936
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1937
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1938
+ # resource group, and
1939
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1940
+ # for a resource, and
1941
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1942
+ # for an EventGrid topic.
1943
+ # @param event_subscription_name [String] Name of the event subscription. Event
1944
+ # subscription names must be between 3 and 64 characters in length and should
1945
+ # use alphanumeric letters only.
1946
+ # @param event_subscription_info [EventSubscription] Event subscription
1947
+ # properties containing the destination and filter information.
1948
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1949
+ # to the HTTP request.
1950
+ #
1951
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1952
+ #
1953
+ def begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
1954
+ fail ArgumentError, 'scope is nil' if scope.nil?
1955
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
1956
+ fail ArgumentError, 'event_subscription_info is nil' if event_subscription_info.nil?
1957
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1958
+
1959
+
1960
+ request_headers = {}
1961
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1962
+
1963
+ # Set Headers
1964
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1965
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1966
+
1967
+ # Serialize Request
1968
+ request_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
1969
+ request_content = @client.serialize(request_mapper, event_subscription_info)
1970
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1971
+
1972
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
1973
+
1974
+ request_url = @base_url || @client.base_url
1975
+
1976
+ options = {
1977
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1978
+ path_params: {'eventSubscriptionName' => event_subscription_name},
1979
+ skip_encoding_path_params: {'scope' => scope},
1980
+ query_params: {'api-version' => @client.api_version},
1981
+ body: request_content,
1982
+ headers: request_headers.merge(custom_headers || {}),
1983
+ base_url: request_url
1984
+ }
1985
+ promise = @client.make_request_async(:put, path_template, options)
1986
+
1987
+ promise = promise.then do |result|
1988
+ http_response = result.response
1989
+ status_code = http_response.status
1990
+ response_content = http_response.body
1991
+ unless status_code == 201
1992
+ error_model = JSON.load(response_content)
1993
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1994
+ end
1995
+
1996
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1997
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1998
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1999
+ # Deserialize Response
2000
+ if status_code == 201
2001
+ begin
2002
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2003
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
2004
+ result.body = @client.deserialize(result_mapper, parsed_response)
2005
+ rescue Exception => e
2006
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2007
+ end
2008
+ end
2009
+
2010
+ result
2011
+ end
2012
+
2013
+ promise.execute
2014
+ end
2015
+
2016
+ #
2017
+ # Delete an event subscription.
2018
+ #
2019
+ # Delete an existing event subscription.
2020
+ #
2021
+ # @param scope [String] The scope of the event subscription. The scope can be a
2022
+ # subscription, or a resource group, or a top level resource belonging to a
2023
+ # resource provider namespace, or an EventGrid topic. For example, use
2024
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2025
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2026
+ # resource group, and
2027
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2028
+ # for a resource, and
2029
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2030
+ # for an EventGrid topic.
2031
+ # @param event_subscription_name [String] Name of the event subscription.
2032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2033
+ # will be added to the HTTP request.
2034
+ #
2035
+ #
2036
+ def begin_delete(scope, event_subscription_name, custom_headers:nil)
2037
+ response = begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
2038
+ nil
2039
+ end
2040
+
2041
+ #
2042
+ # Delete an event subscription.
2043
+ #
2044
+ # Delete an existing event subscription.
2045
+ #
2046
+ # @param scope [String] The scope of the event subscription. The scope can be a
2047
+ # subscription, or a resource group, or a top level resource belonging to a
2048
+ # resource provider namespace, or an EventGrid topic. For example, use
2049
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2050
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2051
+ # resource group, and
2052
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2053
+ # for a resource, and
2054
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2055
+ # for an EventGrid topic.
2056
+ # @param event_subscription_name [String] Name of the event subscription.
2057
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2058
+ # will be added to the HTTP request.
2059
+ #
2060
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2061
+ #
2062
+ def begin_delete_with_http_info(scope, event_subscription_name, custom_headers:nil)
2063
+ begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
2064
+ end
2065
+
2066
+ #
2067
+ # Delete an event subscription.
2068
+ #
2069
+ # Delete an existing event subscription.
2070
+ #
2071
+ # @param scope [String] The scope of the event subscription. The scope can be a
2072
+ # subscription, or a resource group, or a top level resource belonging to a
2073
+ # resource provider namespace, or an EventGrid topic. For example, use
2074
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2075
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2076
+ # resource group, and
2077
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2078
+ # for a resource, and
2079
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2080
+ # for an EventGrid topic.
2081
+ # @param event_subscription_name [String] Name of the event subscription.
2082
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2083
+ # to the HTTP request.
2084
+ #
2085
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2086
+ #
2087
+ def begin_delete_async(scope, event_subscription_name, custom_headers:nil)
2088
+ fail ArgumentError, 'scope is nil' if scope.nil?
2089
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
2090
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2091
+
2092
+
2093
+ request_headers = {}
2094
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2095
+
2096
+ # Set Headers
2097
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2098
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2099
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
2100
+
2101
+ request_url = @base_url || @client.base_url
2102
+
2103
+ options = {
2104
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2105
+ path_params: {'eventSubscriptionName' => event_subscription_name},
2106
+ skip_encoding_path_params: {'scope' => scope},
2107
+ query_params: {'api-version' => @client.api_version},
2108
+ headers: request_headers.merge(custom_headers || {}),
2109
+ base_url: request_url
2110
+ }
2111
+ promise = @client.make_request_async(:delete, path_template, options)
2112
+
2113
+ promise = promise.then do |result|
2114
+ http_response = result.response
2115
+ status_code = http_response.status
2116
+ response_content = http_response.body
2117
+ unless status_code == 200 || status_code == 202 || status_code == 204
2118
+ error_model = JSON.load(response_content)
2119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2120
+ end
2121
+
2122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2123
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2124
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2125
+
2126
+ result
2127
+ end
2128
+
2129
+ promise.execute
2130
+ end
2131
+
2132
+ #
2133
+ # Update an event subscription.
2134
+ #
2135
+ # Asynchronously updates an existing event subscription.
2136
+ #
2137
+ # @param scope [String] The scope of existing event subscription. The scope can
2138
+ # be a subscription, or a resource group, or a top level resource belonging to
2139
+ # a resource provider namespace, or an EventGrid topic. For example, use
2140
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2141
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2142
+ # resource group, and
2143
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2144
+ # for a resource, and
2145
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2146
+ # for an EventGrid topic.
2147
+ # @param event_subscription_name [String] Name of the event subscription to be
2148
+ # updated.
2149
+ # @param event_subscription_update_parameters
2150
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2152
+ # will be added to the HTTP request.
2153
+ #
2154
+ # @return [EventSubscription] operation results.
2155
+ #
2156
+ def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2157
+ response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
2158
+ response.body unless response.nil?
2159
+ end
2160
+
2161
+ #
2162
+ # Update an event subscription.
2163
+ #
2164
+ # Asynchronously updates an existing event subscription.
2165
+ #
2166
+ # @param scope [String] The scope of existing event subscription. The scope can
2167
+ # be a subscription, or a resource group, or a top level resource belonging to
2168
+ # a resource provider namespace, or an EventGrid topic. For example, use
2169
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2170
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2171
+ # resource group, and
2172
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2173
+ # for a resource, and
2174
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2175
+ # for an EventGrid topic.
2176
+ # @param event_subscription_name [String] Name of the event subscription to be
2177
+ # updated.
2178
+ # @param event_subscription_update_parameters
2179
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2181
+ # will be added to the HTTP request.
2182
+ #
2183
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2184
+ #
2185
+ def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2186
+ begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
2187
+ end
2188
+
2189
+ #
2190
+ # Update an event subscription.
2191
+ #
2192
+ # Asynchronously updates an existing event subscription.
2193
+ #
2194
+ # @param scope [String] The scope of existing event subscription. The scope can
2195
+ # be a subscription, or a resource group, or a top level resource belonging to
2196
+ # a resource provider namespace, or an EventGrid topic. For example, use
2197
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2198
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2199
+ # resource group, and
2200
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2201
+ # for a resource, and
2202
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2203
+ # for an EventGrid topic.
2204
+ # @param event_subscription_name [String] Name of the event subscription to be
2205
+ # updated.
2206
+ # @param event_subscription_update_parameters
2207
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2208
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2209
+ # to the HTTP request.
2210
+ #
2211
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2212
+ #
2213
+ def begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2214
+ fail ArgumentError, 'scope is nil' if scope.nil?
2215
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
2216
+ fail ArgumentError, 'event_subscription_update_parameters is nil' if event_subscription_update_parameters.nil?
2217
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2218
+
2219
+
2220
+ request_headers = {}
2221
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2222
+
2223
+ # Set Headers
2224
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2225
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2226
+
2227
+ # Serialize Request
2228
+ request_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionUpdateParameters.mapper()
2229
+ request_content = @client.serialize(request_mapper, event_subscription_update_parameters)
2230
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2231
+
2232
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
2233
+
2234
+ request_url = @base_url || @client.base_url
2235
+
2236
+ options = {
2237
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2238
+ path_params: {'eventSubscriptionName' => event_subscription_name},
2239
+ skip_encoding_path_params: {'scope' => scope},
2240
+ query_params: {'api-version' => @client.api_version},
2241
+ body: request_content,
2242
+ headers: request_headers.merge(custom_headers || {}),
2243
+ base_url: request_url
2244
+ }
2245
+ promise = @client.make_request_async(:patch, path_template, options)
2246
+
2247
+ promise = promise.then do |result|
2248
+ http_response = result.response
2249
+ status_code = http_response.status
2250
+ response_content = http_response.body
2251
+ unless status_code == 201
2252
+ error_model = JSON.load(response_content)
2253
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2254
+ end
2255
+
2256
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2257
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2258
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2259
+ # Deserialize Response
2260
+ if status_code == 201
2261
+ begin
2262
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2263
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscription.mapper()
2264
+ result.body = @client.deserialize(result_mapper, parsed_response)
2265
+ rescue Exception => e
2266
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2267
+ end
2268
+ end
2269
+
2270
+ result
2271
+ end
2272
+
2273
+ promise.execute
2274
+ end
2275
+
2276
+ #
2277
+ # Get an aggregated list of all global event subscriptions under an Azure
2278
+ # subscription.
2279
+ #
2280
+ # List all aggregated global event subscriptions under a specific Azure
2281
+ # subscription.
2282
+ #
2283
+ # @param next_page_link [String] The NextLink from the previous successful call
2284
+ # to List operation.
2285
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2286
+ # will be added to the HTTP request.
2287
+ #
2288
+ # @return [EventSubscriptionsListResult] operation results.
2289
+ #
2290
+ def list_global_by_subscription_next(next_page_link, custom_headers:nil)
2291
+ response = list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2292
+ response.body unless response.nil?
2293
+ end
2294
+
2295
+ #
2296
+ # Get an aggregated list of all global event subscriptions under an Azure
2297
+ # subscription.
2298
+ #
2299
+ # List all aggregated global event subscriptions under a specific Azure
2300
+ # subscription.
2301
+ #
2302
+ # @param next_page_link [String] The NextLink from the previous successful call
2303
+ # to List operation.
2304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2305
+ # will be added to the HTTP request.
2306
+ #
2307
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2308
+ #
2309
+ def list_global_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2310
+ list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2311
+ end
2312
+
2313
+ #
2314
+ # Get an aggregated list of all global event subscriptions under an Azure
2315
+ # subscription.
2316
+ #
2317
+ # List all aggregated global event subscriptions under a specific Azure
2318
+ # subscription.
2319
+ #
2320
+ # @param next_page_link [String] The NextLink from the previous successful call
2321
+ # to List operation.
2322
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2323
+ # to the HTTP request.
2324
+ #
2325
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2326
+ #
2327
+ def list_global_by_subscription_next_async(next_page_link, custom_headers:nil)
2328
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2329
+
2330
+
2331
+ request_headers = {}
2332
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2333
+
2334
+ # Set Headers
2335
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2336
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2337
+ path_template = '{nextLink}'
2338
+
2339
+ request_url = @base_url || @client.base_url
2340
+
2341
+ options = {
2342
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2343
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2344
+ headers: request_headers.merge(custom_headers || {}),
2345
+ base_url: request_url
2346
+ }
2347
+ promise = @client.make_request_async(:get, path_template, options)
2348
+
2349
+ promise = promise.then do |result|
2350
+ http_response = result.response
2351
+ status_code = http_response.status
2352
+ response_content = http_response.body
2353
+ unless status_code == 200
2354
+ error_model = JSON.load(response_content)
2355
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2356
+ end
2357
+
2358
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2359
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2360
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2361
+ # Deserialize Response
2362
+ if status_code == 200
2363
+ begin
2364
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2365
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2366
+ result.body = @client.deserialize(result_mapper, parsed_response)
2367
+ rescue Exception => e
2368
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2369
+ end
2370
+ end
2371
+
2372
+ result
2373
+ end
2374
+
2375
+ promise.execute
2376
+ end
2377
+
2378
+ #
2379
+ # List all global event subscriptions for a topic type.
2380
+ #
2381
+ # List all global event subscriptions under an Azure subscription for a topic
2382
+ # type.
2383
+ #
2384
+ # @param next_page_link [String] The NextLink from the previous successful call
2385
+ # to List operation.
2386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2387
+ # will be added to the HTTP request.
2388
+ #
2389
+ # @return [EventSubscriptionsListResult] operation results.
2390
+ #
2391
+ def list_global_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil)
2392
+ response = list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2393
+ response.body unless response.nil?
2394
+ end
2395
+
2396
+ #
2397
+ # List all global event subscriptions for a topic type.
2398
+ #
2399
+ # List all global event subscriptions under an Azure subscription for a topic
2400
+ # type.
2401
+ #
2402
+ # @param next_page_link [String] The NextLink from the previous successful call
2403
+ # to List operation.
2404
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2405
+ # will be added to the HTTP request.
2406
+ #
2407
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2408
+ #
2409
+ def list_global_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
2410
+ list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2411
+ end
2412
+
2413
+ #
2414
+ # List all global event subscriptions for a topic type.
2415
+ #
2416
+ # List all global event subscriptions under an Azure subscription for a topic
2417
+ # type.
2418
+ #
2419
+ # @param next_page_link [String] The NextLink from the previous successful call
2420
+ # to List operation.
2421
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2422
+ # to the HTTP request.
2423
+ #
2424
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2425
+ #
2426
+ def list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil)
2427
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2428
+
2429
+
2430
+ request_headers = {}
2431
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2432
+
2433
+ # Set Headers
2434
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2435
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2436
+ path_template = '{nextLink}'
2437
+
2438
+ request_url = @base_url || @client.base_url
2439
+
2440
+ options = {
2441
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2442
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2443
+ headers: request_headers.merge(custom_headers || {}),
2444
+ base_url: request_url
2445
+ }
2446
+ promise = @client.make_request_async(:get, path_template, options)
2447
+
2448
+ promise = promise.then do |result|
2449
+ http_response = result.response
2450
+ status_code = http_response.status
2451
+ response_content = http_response.body
2452
+ unless status_code == 200
2453
+ error_model = JSON.load(response_content)
2454
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2455
+ end
2456
+
2457
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2458
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2459
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2460
+ # Deserialize Response
2461
+ if status_code == 200
2462
+ begin
2463
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2464
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2465
+ result.body = @client.deserialize(result_mapper, parsed_response)
2466
+ rescue Exception => e
2467
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2468
+ end
2469
+ end
2470
+
2471
+ result
2472
+ end
2473
+
2474
+ promise.execute
2475
+ end
2476
+
2477
+ #
2478
+ # List all global event subscriptions under an Azure subscription and resource
2479
+ # group.
2480
+ #
2481
+ # List all global event subscriptions under a specific Azure subscription and
2482
+ # resource group.
2483
+ #
2484
+ # @param next_page_link [String] The NextLink from the previous successful call
2485
+ # to List operation.
2486
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2487
+ # will be added to the HTTP request.
2488
+ #
2489
+ # @return [EventSubscriptionsListResult] operation results.
2490
+ #
2491
+ def list_global_by_resource_group_next(next_page_link, custom_headers:nil)
2492
+ response = list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2493
+ response.body unless response.nil?
2494
+ end
2495
+
2496
+ #
2497
+ # List all global event subscriptions under an Azure subscription and resource
2498
+ # group.
2499
+ #
2500
+ # List all global event subscriptions under a specific Azure subscription and
2501
+ # resource group.
2502
+ #
2503
+ # @param next_page_link [String] The NextLink from the previous successful call
2504
+ # to List operation.
2505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2506
+ # will be added to the HTTP request.
2507
+ #
2508
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2509
+ #
2510
+ def list_global_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2511
+ list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2512
+ end
2513
+
2514
+ #
2515
+ # List all global event subscriptions under an Azure subscription and resource
2516
+ # group.
2517
+ #
2518
+ # List all global event subscriptions under a specific Azure subscription and
2519
+ # resource group.
2520
+ #
2521
+ # @param next_page_link [String] The NextLink from the previous successful call
2522
+ # to List operation.
2523
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2524
+ # to the HTTP request.
2525
+ #
2526
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2527
+ #
2528
+ def list_global_by_resource_group_next_async(next_page_link, custom_headers:nil)
2529
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2530
+
2531
+
2532
+ request_headers = {}
2533
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2534
+
2535
+ # Set Headers
2536
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2537
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2538
+ path_template = '{nextLink}'
2539
+
2540
+ request_url = @base_url || @client.base_url
2541
+
2542
+ options = {
2543
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2544
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2545
+ headers: request_headers.merge(custom_headers || {}),
2546
+ base_url: request_url
2547
+ }
2548
+ promise = @client.make_request_async(:get, path_template, options)
2549
+
2550
+ promise = promise.then do |result|
2551
+ http_response = result.response
2552
+ status_code = http_response.status
2553
+ response_content = http_response.body
2554
+ unless status_code == 200
2555
+ error_model = JSON.load(response_content)
2556
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2557
+ end
2558
+
2559
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2560
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2561
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2562
+ # Deserialize Response
2563
+ if status_code == 200
2564
+ begin
2565
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2566
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2567
+ result.body = @client.deserialize(result_mapper, parsed_response)
2568
+ rescue Exception => e
2569
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2570
+ end
2571
+ end
2572
+
2573
+ result
2574
+ end
2575
+
2576
+ promise.execute
2577
+ end
2578
+
2579
+ #
2580
+ # List all global event subscriptions under a resource group for a topic type.
2581
+ #
2582
+ # List all global event subscriptions under a resource group for a specific
2583
+ # topic type.
2584
+ #
2585
+ # @param next_page_link [String] The NextLink from the previous successful call
2586
+ # to List operation.
2587
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2588
+ # will be added to the HTTP request.
2589
+ #
2590
+ # @return [EventSubscriptionsListResult] operation results.
2591
+ #
2592
+ def list_global_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil)
2593
+ response = list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2594
+ response.body unless response.nil?
2595
+ end
2596
+
2597
+ #
2598
+ # List all global event subscriptions under a resource group for a topic type.
2599
+ #
2600
+ # List all global event subscriptions under a resource group for a specific
2601
+ # topic type.
2602
+ #
2603
+ # @param next_page_link [String] The NextLink from the previous successful call
2604
+ # to List operation.
2605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2606
+ # will be added to the HTTP request.
2607
+ #
2608
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2609
+ #
2610
+ def list_global_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
2611
+ list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2612
+ end
2613
+
2614
+ #
2615
+ # List all global event subscriptions under a resource group for a topic type.
2616
+ #
2617
+ # List all global event subscriptions under a resource group for a specific
2618
+ # topic type.
2619
+ #
2620
+ # @param next_page_link [String] The NextLink from the previous successful call
2621
+ # to List operation.
2622
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2623
+ # to the HTTP request.
2624
+ #
2625
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2626
+ #
2627
+ def list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil)
2628
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2629
+
2630
+
2631
+ request_headers = {}
2632
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2633
+
2634
+ # Set Headers
2635
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2636
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2637
+ path_template = '{nextLink}'
2638
+
2639
+ request_url = @base_url || @client.base_url
2640
+
2641
+ options = {
2642
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2643
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2644
+ headers: request_headers.merge(custom_headers || {}),
2645
+ base_url: request_url
2646
+ }
2647
+ promise = @client.make_request_async(:get, path_template, options)
2648
+
2649
+ promise = promise.then do |result|
2650
+ http_response = result.response
2651
+ status_code = http_response.status
2652
+ response_content = http_response.body
2653
+ unless status_code == 200
2654
+ error_model = JSON.load(response_content)
2655
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2656
+ end
2657
+
2658
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2659
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2660
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2661
+ # Deserialize Response
2662
+ if status_code == 200
2663
+ begin
2664
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2665
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2666
+ result.body = @client.deserialize(result_mapper, parsed_response)
2667
+ rescue Exception => e
2668
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2669
+ end
2670
+ end
2671
+
2672
+ result
2673
+ end
2674
+
2675
+ promise.execute
2676
+ end
2677
+
2678
+ #
2679
+ # List all regional event subscriptions under an Azure subscription.
2680
+ #
2681
+ # List all event subscriptions from the given location under a specific Azure
2682
+ # subscription.
2683
+ #
2684
+ # @param next_page_link [String] The NextLink from the previous successful call
2685
+ # to List operation.
2686
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2687
+ # will be added to the HTTP request.
2688
+ #
2689
+ # @return [EventSubscriptionsListResult] operation results.
2690
+ #
2691
+ def list_regional_by_subscription_next(next_page_link, custom_headers:nil)
2692
+ response = list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2693
+ response.body unless response.nil?
2694
+ end
2695
+
2696
+ #
2697
+ # List all regional event subscriptions under an Azure subscription.
2698
+ #
2699
+ # List all event subscriptions from the given location under a specific Azure
2700
+ # subscription.
2701
+ #
2702
+ # @param next_page_link [String] The NextLink from the previous successful call
2703
+ # to List operation.
2704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2705
+ # will be added to the HTTP request.
2706
+ #
2707
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2708
+ #
2709
+ def list_regional_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2710
+ list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2711
+ end
2712
+
2713
+ #
2714
+ # List all regional event subscriptions under an Azure subscription.
2715
+ #
2716
+ # List all event subscriptions from the given location under a specific Azure
2717
+ # subscription.
2718
+ #
2719
+ # @param next_page_link [String] The NextLink from the previous successful call
2720
+ # to List operation.
2721
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2722
+ # to the HTTP request.
2723
+ #
2724
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2725
+ #
2726
+ def list_regional_by_subscription_next_async(next_page_link, custom_headers:nil)
2727
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2728
+
2729
+
2730
+ request_headers = {}
2731
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2732
+
2733
+ # Set Headers
2734
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2735
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2736
+ path_template = '{nextLink}'
2737
+
2738
+ request_url = @base_url || @client.base_url
2739
+
2740
+ options = {
2741
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2742
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2743
+ headers: request_headers.merge(custom_headers || {}),
2744
+ base_url: request_url
2745
+ }
2746
+ promise = @client.make_request_async(:get, path_template, options)
2747
+
2748
+ promise = promise.then do |result|
2749
+ http_response = result.response
2750
+ status_code = http_response.status
2751
+ response_content = http_response.body
2752
+ unless status_code == 200
2753
+ error_model = JSON.load(response_content)
2754
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2755
+ end
2756
+
2757
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2758
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2759
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2760
+ # Deserialize Response
2761
+ if status_code == 200
2762
+ begin
2763
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2764
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2765
+ result.body = @client.deserialize(result_mapper, parsed_response)
2766
+ rescue Exception => e
2767
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2768
+ end
2769
+ end
2770
+
2771
+ result
2772
+ end
2773
+
2774
+ promise.execute
2775
+ end
2776
+
2777
+ #
2778
+ # List all regional event subscriptions under an Azure subscription and
2779
+ # resource group.
2780
+ #
2781
+ # List all event subscriptions from the given location under a specific Azure
2782
+ # subscription and resource group.
2783
+ #
2784
+ # @param next_page_link [String] The NextLink from the previous successful call
2785
+ # to List operation.
2786
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2787
+ # will be added to the HTTP request.
2788
+ #
2789
+ # @return [EventSubscriptionsListResult] operation results.
2790
+ #
2791
+ def list_regional_by_resource_group_next(next_page_link, custom_headers:nil)
2792
+ response = list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2793
+ response.body unless response.nil?
2794
+ end
2795
+
2796
+ #
2797
+ # List all regional event subscriptions under an Azure subscription and
2798
+ # resource group.
2799
+ #
2800
+ # List all event subscriptions from the given location under a specific Azure
2801
+ # subscription and resource group.
2802
+ #
2803
+ # @param next_page_link [String] The NextLink from the previous successful call
2804
+ # to List operation.
2805
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2806
+ # will be added to the HTTP request.
2807
+ #
2808
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2809
+ #
2810
+ def list_regional_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2811
+ list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2812
+ end
2813
+
2814
+ #
2815
+ # List all regional event subscriptions under an Azure subscription and
2816
+ # resource group.
2817
+ #
2818
+ # List all event subscriptions from the given location under a specific Azure
2819
+ # subscription and resource group.
2820
+ #
2821
+ # @param next_page_link [String] The NextLink from the previous successful call
2822
+ # to List operation.
2823
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2824
+ # to the HTTP request.
2825
+ #
2826
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2827
+ #
2828
+ def list_regional_by_resource_group_next_async(next_page_link, custom_headers:nil)
2829
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2830
+
2831
+
2832
+ request_headers = {}
2833
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2834
+
2835
+ # Set Headers
2836
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2837
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2838
+ path_template = '{nextLink}'
2839
+
2840
+ request_url = @base_url || @client.base_url
2841
+
2842
+ options = {
2843
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2844
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2845
+ headers: request_headers.merge(custom_headers || {}),
2846
+ base_url: request_url
2847
+ }
2848
+ promise = @client.make_request_async(:get, path_template, options)
2849
+
2850
+ promise = promise.then do |result|
2851
+ http_response = result.response
2852
+ status_code = http_response.status
2853
+ response_content = http_response.body
2854
+ unless status_code == 200
2855
+ error_model = JSON.load(response_content)
2856
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2857
+ end
2858
+
2859
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2860
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2861
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2862
+ # Deserialize Response
2863
+ if status_code == 200
2864
+ begin
2865
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2866
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2867
+ result.body = @client.deserialize(result_mapper, parsed_response)
2868
+ rescue Exception => e
2869
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2870
+ end
2871
+ end
2872
+
2873
+ result
2874
+ end
2875
+
2876
+ promise.execute
2877
+ end
2878
+
2879
+ #
2880
+ # List all regional event subscriptions under an Azure subscription for a topic
2881
+ # type.
2882
+ #
2883
+ # List all event subscriptions from the given location under a specific Azure
2884
+ # subscription and topic type.
2885
+ #
2886
+ # @param next_page_link [String] The NextLink from the previous successful call
2887
+ # to List operation.
2888
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2889
+ # will be added to the HTTP request.
2890
+ #
2891
+ # @return [EventSubscriptionsListResult] operation results.
2892
+ #
2893
+ def list_regional_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil)
2894
+ response = list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2895
+ response.body unless response.nil?
2896
+ end
2897
+
2898
+ #
2899
+ # List all regional event subscriptions under an Azure subscription for a topic
2900
+ # type.
2901
+ #
2902
+ # List all event subscriptions from the given location under a specific Azure
2903
+ # subscription and topic type.
2904
+ #
2905
+ # @param next_page_link [String] The NextLink from the previous successful call
2906
+ # to List operation.
2907
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2908
+ # will be added to the HTTP request.
2909
+ #
2910
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2911
+ #
2912
+ def list_regional_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
2913
+ list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2914
+ end
2915
+
2916
+ #
2917
+ # List all regional event subscriptions under an Azure subscription for a topic
2918
+ # type.
2919
+ #
2920
+ # List all event subscriptions from the given location under a specific Azure
2921
+ # subscription and topic type.
2922
+ #
2923
+ # @param next_page_link [String] The NextLink from the previous successful call
2924
+ # to List operation.
2925
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2926
+ # to the HTTP request.
2927
+ #
2928
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2929
+ #
2930
+ def list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil)
2931
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2932
+
2933
+
2934
+ request_headers = {}
2935
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2936
+
2937
+ # Set Headers
2938
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2939
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2940
+ path_template = '{nextLink}'
2941
+
2942
+ request_url = @base_url || @client.base_url
2943
+
2944
+ options = {
2945
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2946
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2947
+ headers: request_headers.merge(custom_headers || {}),
2948
+ base_url: request_url
2949
+ }
2950
+ promise = @client.make_request_async(:get, path_template, options)
2951
+
2952
+ promise = promise.then do |result|
2953
+ http_response = result.response
2954
+ status_code = http_response.status
2955
+ response_content = http_response.body
2956
+ unless status_code == 200
2957
+ error_model = JSON.load(response_content)
2958
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2959
+ end
2960
+
2961
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2962
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2963
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2964
+ # Deserialize Response
2965
+ if status_code == 200
2966
+ begin
2967
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2968
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
2969
+ result.body = @client.deserialize(result_mapper, parsed_response)
2970
+ rescue Exception => e
2971
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2972
+ end
2973
+ end
2974
+
2975
+ result
2976
+ end
2977
+
2978
+ promise.execute
2979
+ end
2980
+
2981
+ #
2982
+ # List all regional event subscriptions under an Azure subscription and
2983
+ # resource group for a topic type.
2984
+ #
2985
+ # List all event subscriptions from the given location under a specific Azure
2986
+ # subscription and resource group and topic type.
2987
+ #
2988
+ # @param next_page_link [String] The NextLink from the previous successful call
2989
+ # to List operation.
2990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2991
+ # will be added to the HTTP request.
2992
+ #
2993
+ # @return [EventSubscriptionsListResult] operation results.
2994
+ #
2995
+ def list_regional_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil)
2996
+ response = list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2997
+ response.body unless response.nil?
2998
+ end
2999
+
3000
+ #
3001
+ # List all regional event subscriptions under an Azure subscription and
3002
+ # resource group for a topic type.
3003
+ #
3004
+ # List all event subscriptions from the given location under a specific Azure
3005
+ # subscription and resource group and topic type.
3006
+ #
3007
+ # @param next_page_link [String] The NextLink from the previous successful call
3008
+ # to List operation.
3009
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3010
+ # will be added to the HTTP request.
3011
+ #
3012
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3013
+ #
3014
+ def list_regional_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
3015
+ list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
3016
+ end
3017
+
3018
+ #
3019
+ # List all regional event subscriptions under an Azure subscription and
3020
+ # resource group for a topic type.
3021
+ #
3022
+ # List all event subscriptions from the given location under a specific Azure
3023
+ # subscription and resource group and topic type.
3024
+ #
3025
+ # @param next_page_link [String] The NextLink from the previous successful call
3026
+ # to List operation.
3027
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3028
+ # to the HTTP request.
3029
+ #
3030
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3031
+ #
3032
+ def list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil)
3033
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3034
+
3035
+
3036
+ request_headers = {}
3037
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3038
+
3039
+ # Set Headers
3040
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3041
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3042
+ path_template = '{nextLink}'
3043
+
3044
+ request_url = @base_url || @client.base_url
3045
+
3046
+ options = {
3047
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3048
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3049
+ headers: request_headers.merge(custom_headers || {}),
3050
+ base_url: request_url
3051
+ }
3052
+ promise = @client.make_request_async(:get, path_template, options)
3053
+
3054
+ promise = promise.then do |result|
3055
+ http_response = result.response
3056
+ status_code = http_response.status
3057
+ response_content = http_response.body
3058
+ unless status_code == 200
3059
+ error_model = JSON.load(response_content)
3060
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3061
+ end
3062
+
3063
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3064
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3065
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3066
+ # Deserialize Response
3067
+ if status_code == 200
3068
+ begin
3069
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3070
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
3071
+ result.body = @client.deserialize(result_mapper, parsed_response)
3072
+ rescue Exception => e
3073
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3074
+ end
3075
+ end
3076
+
3077
+ result
3078
+ end
3079
+
3080
+ promise.execute
3081
+ end
3082
+
3083
+ #
3084
+ # List all event subscriptions for a specific topic.
3085
+ #
3086
+ # List all event subscriptions that have been created for a specific topic.
3087
+ #
3088
+ # @param next_page_link [String] The NextLink from the previous successful call
3089
+ # to List operation.
3090
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3091
+ # will be added to the HTTP request.
3092
+ #
3093
+ # @return [EventSubscriptionsListResult] operation results.
3094
+ #
3095
+ def list_by_resource_next(next_page_link, custom_headers:nil)
3096
+ response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
3097
+ response.body unless response.nil?
3098
+ end
3099
+
3100
+ #
3101
+ # List all event subscriptions for a specific topic.
3102
+ #
3103
+ # List all event subscriptions that have been created for a specific topic.
3104
+ #
3105
+ # @param next_page_link [String] The NextLink from the previous successful call
3106
+ # to List operation.
3107
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3108
+ # will be added to the HTTP request.
3109
+ #
3110
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3111
+ #
3112
+ def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil)
3113
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
3114
+ end
3115
+
3116
+ #
3117
+ # List all event subscriptions for a specific topic.
3118
+ #
3119
+ # List all event subscriptions that have been created for a specific topic.
3120
+ #
3121
+ # @param next_page_link [String] The NextLink from the previous successful call
3122
+ # to List operation.
3123
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3124
+ # to the HTTP request.
3125
+ #
3126
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3127
+ #
3128
+ def list_by_resource_next_async(next_page_link, custom_headers:nil)
3129
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3130
+
3131
+
3132
+ request_headers = {}
3133
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3134
+
3135
+ # Set Headers
3136
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3137
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3138
+ path_template = '{nextLink}'
3139
+
3140
+ request_url = @base_url || @client.base_url
3141
+
3142
+ options = {
3143
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3144
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3145
+ headers: request_headers.merge(custom_headers || {}),
3146
+ base_url: request_url
3147
+ }
3148
+ promise = @client.make_request_async(:get, path_template, options)
3149
+
3150
+ promise = promise.then do |result|
3151
+ http_response = result.response
3152
+ status_code = http_response.status
3153
+ response_content = http_response.body
3154
+ unless status_code == 200
3155
+ error_model = JSON.load(response_content)
3156
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3157
+ end
3158
+
3159
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3160
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3161
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3162
+ # Deserialize Response
3163
+ if status_code == 200
3164
+ begin
3165
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3166
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
3167
+ result.body = @client.deserialize(result_mapper, parsed_response)
3168
+ rescue Exception => e
3169
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3170
+ end
3171
+ end
3172
+
3173
+ result
3174
+ end
3175
+
3176
+ promise.execute
3177
+ end
3178
+
3179
+ #
3180
+ # List all event subscriptions for a specific domain topic.
3181
+ #
3182
+ # List all event subscriptions that have been created for a specific domain
3183
+ # topic.
3184
+ #
3185
+ # @param next_page_link [String] The NextLink from the previous successful call
3186
+ # to List operation.
3187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3188
+ # will be added to the HTTP request.
3189
+ #
3190
+ # @return [EventSubscriptionsListResult] operation results.
3191
+ #
3192
+ def list_by_domain_topic_next(next_page_link, custom_headers:nil)
3193
+ response = list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value!
3194
+ response.body unless response.nil?
3195
+ end
3196
+
3197
+ #
3198
+ # List all event subscriptions for a specific domain topic.
3199
+ #
3200
+ # List all event subscriptions that have been created for a specific domain
3201
+ # topic.
3202
+ #
3203
+ # @param next_page_link [String] The NextLink from the previous successful call
3204
+ # to List operation.
3205
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3206
+ # will be added to the HTTP request.
3207
+ #
3208
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3209
+ #
3210
+ def list_by_domain_topic_next_with_http_info(next_page_link, custom_headers:nil)
3211
+ list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value!
3212
+ end
3213
+
3214
+ #
3215
+ # List all event subscriptions for a specific domain topic.
3216
+ #
3217
+ # List all event subscriptions that have been created for a specific domain
3218
+ # topic.
3219
+ #
3220
+ # @param next_page_link [String] The NextLink from the previous successful call
3221
+ # to List operation.
3222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3223
+ # to the HTTP request.
3224
+ #
3225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3226
+ #
3227
+ def list_by_domain_topic_next_async(next_page_link, custom_headers:nil)
3228
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3229
+
3230
+
3231
+ request_headers = {}
3232
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3233
+
3234
+ # Set Headers
3235
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3236
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3237
+ path_template = '{nextLink}'
3238
+
3239
+ request_url = @base_url || @client.base_url
3240
+
3241
+ options = {
3242
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3243
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3244
+ headers: request_headers.merge(custom_headers || {}),
3245
+ base_url: request_url
3246
+ }
3247
+ promise = @client.make_request_async(:get, path_template, options)
3248
+
3249
+ promise = promise.then do |result|
3250
+ http_response = result.response
3251
+ status_code = http_response.status
3252
+ response_content = http_response.body
3253
+ unless status_code == 200
3254
+ error_model = JSON.load(response_content)
3255
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3256
+ end
3257
+
3258
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3259
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3260
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3261
+ # Deserialize Response
3262
+ if status_code == 200
3263
+ begin
3264
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3265
+ result_mapper = Azure::EventGrid::Mgmt::V2019_06_01::Models::EventSubscriptionsListResult.mapper()
3266
+ result.body = @client.deserialize(result_mapper, parsed_response)
3267
+ rescue Exception => e
3268
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3269
+ end
3270
+ end
3271
+
3272
+ result
3273
+ end
3274
+
3275
+ promise.execute
3276
+ end
3277
+
3278
+ #
3279
+ # Get an aggregated list of all global event subscriptions under an Azure
3280
+ # subscription.
3281
+ #
3282
+ # List all aggregated global event subscriptions under a specific Azure
3283
+ # subscription.
3284
+ #
3285
+ # @param filter [String] The query used to filter the search results using
3286
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3287
+ # limited number of OData operations. These operations are: the 'contains'
3288
+ # function as well as the following logical operations: not, and, or, eq (for
3289
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3290
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3291
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3292
+ # $filter=location eq 'westus'.
3293
+ # @param top [Integer] The number of results to return per page for the list
3294
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3295
+ # default number of results to be returned is 20 items per page.
3296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3297
+ # will be added to the HTTP request.
3298
+ #
3299
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3300
+ # the response.
3301
+ #
3302
+ def list_global_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil)
3303
+ response = list_global_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
3304
+ unless response.nil?
3305
+ page = response.body
3306
+ page.next_method = Proc.new do |next_page_link|
3307
+ list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
3308
+ end
3309
+ page
3310
+ end
3311
+ end
3312
+
3313
+ #
3314
+ # List all global event subscriptions for a topic type.
3315
+ #
3316
+ # List all global event subscriptions under an Azure subscription for a topic
3317
+ # type.
3318
+ #
3319
+ # @param topic_type_name [String] Name of the topic type.
3320
+ # @param filter [String] The query used to filter the search results using
3321
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3322
+ # limited number of OData operations. These operations are: the 'contains'
3323
+ # function as well as the following logical operations: not, and, or, eq (for
3324
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3325
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3326
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3327
+ # $filter=location eq 'westus'.
3328
+ # @param top [Integer] The number of results to return per page for the list
3329
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3330
+ # default number of results to be returned is 20 items per page.
3331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3332
+ # will be added to the HTTP request.
3333
+ #
3334
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3335
+ # the response.
3336
+ #
3337
+ def list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:nil, top:nil, custom_headers:nil)
3338
+ response = list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3339
+ unless response.nil?
3340
+ page = response.body
3341
+ page.next_method = Proc.new do |next_page_link|
3342
+ list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3343
+ end
3344
+ page
3345
+ end
3346
+ end
3347
+
3348
+ #
3349
+ # List all global event subscriptions under an Azure subscription and resource
3350
+ # group.
3351
+ #
3352
+ # List all global event subscriptions under a specific Azure subscription and
3353
+ # resource group.
3354
+ #
3355
+ # @param resource_group_name [String] The name of the resource group within the
3356
+ # user's subscription.
3357
+ # @param filter [String] The query used to filter the search results using
3358
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3359
+ # limited number of OData operations. These operations are: the 'contains'
3360
+ # function as well as the following logical operations: not, and, or, eq (for
3361
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3362
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3363
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3364
+ # $filter=location eq 'westus'.
3365
+ # @param top [Integer] The number of results to return per page for the list
3366
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3367
+ # default number of results to be returned is 20 items per page.
3368
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3369
+ # will be added to the HTTP request.
3370
+ #
3371
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3372
+ # the response.
3373
+ #
3374
+ def list_global_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
3375
+ response = list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
3376
+ unless response.nil?
3377
+ page = response.body
3378
+ page.next_method = Proc.new do |next_page_link|
3379
+ list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3380
+ end
3381
+ page
3382
+ end
3383
+ end
3384
+
3385
+ #
3386
+ # List all global event subscriptions under a resource group for a topic type.
3387
+ #
3388
+ # List all global event subscriptions under a resource group for a specific
3389
+ # topic type.
3390
+ #
3391
+ # @param resource_group_name [String] The name of the resource group within the
3392
+ # user's subscription.
3393
+ # @param topic_type_name [String] Name of the topic type.
3394
+ # @param filter [String] The query used to filter the search results using
3395
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3396
+ # limited number of OData operations. These operations are: the 'contains'
3397
+ # function as well as the following logical operations: not, and, or, eq (for
3398
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3399
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3400
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3401
+ # $filter=location eq 'westus'.
3402
+ # @param top [Integer] The number of results to return per page for the list
3403
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3404
+ # default number of results to be returned is 20 items per page.
3405
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3406
+ # will be added to the HTTP request.
3407
+ #
3408
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3409
+ # the response.
3410
+ #
3411
+ def list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil)
3412
+ response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3413
+ unless response.nil?
3414
+ page = response.body
3415
+ page.next_method = Proc.new do |next_page_link|
3416
+ list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3417
+ end
3418
+ page
3419
+ end
3420
+ end
3421
+
3422
+ #
3423
+ # List all regional event subscriptions under an Azure subscription.
3424
+ #
3425
+ # List all event subscriptions from the given location under a specific Azure
3426
+ # subscription.
3427
+ #
3428
+ # @param location [String] Name of the location.
3429
+ # @param filter [String] The query used to filter the search results using
3430
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3431
+ # limited number of OData operations. These operations are: the 'contains'
3432
+ # function as well as the following logical operations: not, and, or, eq (for
3433
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3434
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3435
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3436
+ # $filter=location eq 'westus'.
3437
+ # @param top [Integer] The number of results to return per page for the list
3438
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3439
+ # default number of results to be returned is 20 items per page.
3440
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3441
+ # will be added to the HTTP request.
3442
+ #
3443
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3444
+ # the response.
3445
+ #
3446
+ def list_regional_by_subscription_as_lazy(location, filter:nil, top:nil, custom_headers:nil)
3447
+ response = list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers:custom_headers).value!
3448
+ unless response.nil?
3449
+ page = response.body
3450
+ page.next_method = Proc.new do |next_page_link|
3451
+ list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
3452
+ end
3453
+ page
3454
+ end
3455
+ end
3456
+
3457
+ #
3458
+ # List all regional event subscriptions under an Azure subscription and
3459
+ # resource group.
3460
+ #
3461
+ # List all event subscriptions from the given location under a specific Azure
3462
+ # subscription and resource group.
3463
+ #
3464
+ # @param resource_group_name [String] The name of the resource group within the
3465
+ # user's subscription.
3466
+ # @param location [String] Name of the location.
3467
+ # @param filter [String] The query used to filter the search results using
3468
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3469
+ # limited number of OData operations. These operations are: the 'contains'
3470
+ # function as well as the following logical operations: not, and, or, eq (for
3471
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3472
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3473
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3474
+ # $filter=location eq 'westus'.
3475
+ # @param top [Integer] The number of results to return per page for the list
3476
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3477
+ # default number of results to be returned is 20 items per page.
3478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3479
+ # will be added to the HTTP request.
3480
+ #
3481
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3482
+ # the response.
3483
+ #
3484
+ def list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:nil, top:nil, custom_headers:nil)
3485
+ response = list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers).value!
3486
+ unless response.nil?
3487
+ page = response.body
3488
+ page.next_method = Proc.new do |next_page_link|
3489
+ list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3490
+ end
3491
+ page
3492
+ end
3493
+ end
3494
+
3495
+ #
3496
+ # List all regional event subscriptions under an Azure subscription for a topic
3497
+ # type.
3498
+ #
3499
+ # List all event subscriptions from the given location under a specific Azure
3500
+ # subscription and topic type.
3501
+ #
3502
+ # @param location [String] Name of the location.
3503
+ # @param topic_type_name [String] Name of the topic type.
3504
+ # @param filter [String] The query used to filter the search results using
3505
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3506
+ # limited number of OData operations. These operations are: the 'contains'
3507
+ # function as well as the following logical operations: not, and, or, eq (for
3508
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3509
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3510
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3511
+ # $filter=location eq 'westus'.
3512
+ # @param top [Integer] The number of results to return per page for the list
3513
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3514
+ # default number of results to be returned is 20 items per page.
3515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3516
+ # will be added to the HTTP request.
3517
+ #
3518
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3519
+ # the response.
3520
+ #
3521
+ def list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
3522
+ response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3523
+ unless response.nil?
3524
+ page = response.body
3525
+ page.next_method = Proc.new do |next_page_link|
3526
+ list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3527
+ end
3528
+ page
3529
+ end
3530
+ end
3531
+
3532
+ #
3533
+ # List all regional event subscriptions under an Azure subscription and
3534
+ # resource group for a topic type.
3535
+ #
3536
+ # List all event subscriptions from the given location under a specific Azure
3537
+ # subscription and resource group and topic type.
3538
+ #
3539
+ # @param resource_group_name [String] The name of the resource group within the
3540
+ # user's subscription.
3541
+ # @param location [String] Name of the location.
3542
+ # @param topic_type_name [String] Name of the topic type.
3543
+ # @param filter [String] The query used to filter the search results using
3544
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3545
+ # limited number of OData operations. These operations are: the 'contains'
3546
+ # function as well as the following logical operations: not, and, or, eq (for
3547
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3548
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3549
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3550
+ # $filter=location eq 'westus'.
3551
+ # @param top [Integer] The number of results to return per page for the list
3552
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3553
+ # default number of results to be returned is 20 items per page.
3554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3555
+ # will be added to the HTTP request.
3556
+ #
3557
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3558
+ # the response.
3559
+ #
3560
+ def list_regional_by_resource_group_for_topic_type_as_lazy(resource_group_name, location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
3561
+ response = list_regional_by_resource_group_for_topic_type_async(resource_group_name, location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3562
+ unless response.nil?
3563
+ page = response.body
3564
+ page.next_method = Proc.new do |next_page_link|
3565
+ list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3566
+ end
3567
+ page
3568
+ end
3569
+ end
3570
+
3571
+ #
3572
+ # List all event subscriptions for a specific topic.
3573
+ #
3574
+ # List all event subscriptions that have been created for a specific topic.
3575
+ #
3576
+ # @param resource_group_name [String] The name of the resource group within the
3577
+ # user's subscription.
3578
+ # @param provider_namespace [String] Namespace of the provider of the topic.
3579
+ # @param resource_type_name [String] Name of the resource type.
3580
+ # @param resource_name [String] Name of the resource.
3581
+ # @param filter [String] The query used to filter the search results using
3582
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3583
+ # limited number of OData operations. These operations are: the 'contains'
3584
+ # function as well as the following logical operations: not, and, or, eq (for
3585
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3586
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3587
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3588
+ # $filter=location eq 'westus'.
3589
+ # @param top [Integer] The number of results to return per page for the list
3590
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3591
+ # default number of results to be returned is 20 items per page.
3592
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3593
+ # will be added to the HTTP request.
3594
+ #
3595
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3596
+ # the response.
3597
+ #
3598
+ def list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil)
3599
+ response = list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers).value!
3600
+ unless response.nil?
3601
+ page = response.body
3602
+ page.next_method = Proc.new do |next_page_link|
3603
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers)
3604
+ end
3605
+ page
3606
+ end
3607
+ end
3608
+
3609
+ #
3610
+ # List all event subscriptions for a specific domain topic.
3611
+ #
3612
+ # List all event subscriptions that have been created for a specific domain
3613
+ # topic.
3614
+ #
3615
+ # @param resource_group_name [String] The name of the resource group within the
3616
+ # user's subscription.
3617
+ # @param domain_name [String] Name of the top level domain.
3618
+ # @param topic_name [String] Name of the domain topic.
3619
+ # @param filter [String] The query used to filter the search results using
3620
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3621
+ # limited number of OData operations. These operations are: the 'contains'
3622
+ # function as well as the following logical operations: not, and, or, eq (for
3623
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3624
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3625
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3626
+ # $filter=location eq 'westus'.
3627
+ # @param top [Integer] The number of results to return per page for the list
3628
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3629
+ # default number of results to be returned is 20 items per page.
3630
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3631
+ # will be added to the HTTP request.
3632
+ #
3633
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3634
+ # the response.
3635
+ #
3636
+ def list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil)
3637
+ response = list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers).value!
3638
+ unless response.nil?
3639
+ page = response.body
3640
+ page.next_method = Proc.new do |next_page_link|
3641
+ list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers)
3642
+ end
3643
+ page
3644
+ end
3645
+ end
3646
+
3647
+ end
3648
+ end