azure_mgmt_event_grid 0.20.2 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-06-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  3. data/lib/2017-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  4. data/lib/2018-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  5. data/lib/2018-05-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  6. data/lib/2018-09-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  7. data/lib/2019-01-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  8. data/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  9. data/lib/2019-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  10. data/lib/2020-01-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  11. data/lib/2020-04-01-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  12. data/lib/2020-06-01/generated/azure_mgmt_event_grid/event_grid_management_client.rb +1 -1
  13. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid.rb +171 -0
  14. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domain_topics.rb +699 -0
  15. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/domains.rb +1328 -0
  16. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_channels.rb +658 -0
  17. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_grid_management_client.rb +194 -0
  18. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/event_subscriptions.rb +3775 -0
  19. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/extension_topics.rb +141 -0
  20. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/advanced_filter.rb +81 -0
  21. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/azure_function_event_subscription_destination.rb +112 -0
  22. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/bool_equals_advanced_filter.rb +69 -0
  23. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/connection_state.rb +69 -0
  24. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/created_by_type.rb +18 -0
  25. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_destination.rb +50 -0
  26. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dead_letter_with_resource_identity.rb +66 -0
  27. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_list_result.rb +58 -0
  28. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_attribute_mapping.rb +58 -0
  29. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/delivery_with_resource_identity.rb +67 -0
  30. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain.rb +253 -0
  31. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_provisioning_state.rb +20 -0
  32. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_regenerate_key_request.rb +46 -0
  33. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_shared_access_keys.rb +57 -0
  34. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic.rb +89 -0
  35. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topic_provisioning_state.rb +20 -0
  36. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_topics_list_result.rb +98 -0
  37. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domain_update_parameters.rb +117 -0
  38. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/domains_list_result.rb +98 -0
  39. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/dynamic_delivery_attribute_mapping.rb +69 -0
  40. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel.rb +172 -0
  41. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_destination.rb +75 -0
  42. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_filter.rb +70 -0
  43. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_provisioning_state.rb +20 -0
  44. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channel_source.rb +48 -0
  45. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_channels_list_result.rb +98 -0
  46. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_delivery_schema.rb +17 -0
  47. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_hub_event_subscription_destination.rb +84 -0
  48. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription.rb +244 -0
  49. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_destination.rb +52 -0
  50. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_filter.rb +132 -0
  51. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_full_url.rb +47 -0
  52. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity.rb +61 -0
  53. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_identity_type.rb +16 -0
  54. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_provisioning_state.rb +21 -0
  55. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscription_update_parameters.rb +176 -0
  56. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_subscriptions_list_result.rb +98 -0
  57. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_type.rb +106 -0
  58. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/event_types_list_result.rb +55 -0
  59. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extended_location.rb +57 -0
  60. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/extension_topic.rb +86 -0
  61. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/hybrid_connection_event_subscription_destination.rb +86 -0
  62. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_info.rb +96 -0
  63. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/identity_type.rb +18 -0
  64. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/inbound_ip_rule.rb +59 -0
  65. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema.rb +17 -0
  66. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/input_schema_mapping.rb +49 -0
  67. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/ip_action_type.rb +15 -0
  68. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_not_null_advanced_filter.rb +58 -0
  69. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/is_null_or_undefined_advanced_filter.rb +58 -0
  70. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field.rb +50 -0
  71. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_field_with_default.rb +67 -0
  72. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/json_input_schema_mapping.rb +130 -0
  73. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_advanced_filter.rb +69 -0
  74. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_greater_than_or_equals_advanced_filter.rb +69 -0
  75. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_advanced_filter.rb +77 -0
  76. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_in_range_advanced_filter.rb +85 -0
  77. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_advanced_filter.rb +69 -0
  78. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_less_than_or_equals_advanced_filter.rb +69 -0
  79. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_advanced_filter.rb +77 -0
  80. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/number_not_in_range_advanced_filter.rb +85 -0
  81. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation.rb +80 -0
  82. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operation_info.rb +79 -0
  83. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/operations_list_result.rb +55 -0
  84. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace.rb +140 -0
  85. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_provisioning_state.rb +20 -0
  86. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_regenerate_key_request.rb +46 -0
  87. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_shared_access_keys.rb +57 -0
  88. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespace_update_parameters.rb +54 -0
  89. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_namespaces_list_result.rb +98 -0
  90. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration.rb +278 -0
  91. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_event_types_list_result.rb +68 -0
  92. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_provisioning_state.rb +20 -0
  93. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_update_parameters.rb +137 -0
  94. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registration_visibility_state.rb +17 -0
  95. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_registrations_list_result.rb +99 -0
  96. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic.rb +179 -0
  97. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_activation_state.rb +17 -0
  98. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_provisioning_state.rb +20 -0
  99. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_readiness_state.rb +18 -0
  100. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type.rb +134 -0
  101. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_type_authorization_state.rb +17 -0
  102. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_types_list_result.rb +55 -0
  103. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topic_update_parameters.rb +54 -0
  104. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/partner_topics_list_result.rb +98 -0
  105. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/persisted_connection_status.rb +18 -0
  106. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint.rb +46 -0
  107. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection.rb +121 -0
  108. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_endpoint_connection_list_result.rb +100 -0
  109. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resource.rb +128 -0
  110. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/private_link_resources_list_result.rb +99 -0
  111. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/public_network_access.rb +16 -0
  112. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource.rb +80 -0
  113. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_kind.rb +16 -0
  114. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_provisioning_state.rb +20 -0
  115. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_region_type.rb +16 -0
  116. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/resource_sku.rb +47 -0
  117. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/retry_policy.rb +61 -0
  118. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_queue_event_subscription_destination.rb +85 -0
  119. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/service_bus_topic_event_subscription_destination.rb +86 -0
  120. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/sku.rb +16 -0
  121. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/static_delivery_attribute_mapping.rb +81 -0
  122. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_blob_dead_letter_destination.rb +74 -0
  123. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/storage_queue_event_subscription_destination.rb +86 -0
  124. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_begins_with_advanced_filter.rb +77 -0
  125. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_contains_advanced_filter.rb +77 -0
  126. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_ends_with_advanced_filter.rb +77 -0
  127. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_in_advanced_filter.rb +77 -0
  128. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_begins_with_advanced_filter.rb +77 -0
  129. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_contains_advanced_filter.rb +77 -0
  130. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_ends_with_advanced_filter.rb +77 -0
  131. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/string_not_in_advanced_filter.rb +77 -0
  132. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_data.rb +105 -0
  133. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic.rb +159 -0
  134. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topic_update_parameters.rb +66 -0
  135. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/system_topics_list_result.rb +98 -0
  136. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic.rb +278 -0
  137. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_provisioning_state.rb +20 -0
  138. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_regenerate_key_request.rb +46 -0
  139. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_shared_access_keys.rb +57 -0
  140. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_info.rb +169 -0
  141. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_type_provisioning_state.rb +20 -0
  142. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_types_list_result.rb +55 -0
  143. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topic_update_parameters.rb +117 -0
  144. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/topics_list_result.rb +98 -0
  145. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/tracked_resource.rb +92 -0
  146. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/user_identity_properties.rb +57 -0
  147. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/models/web_hook_event_subscription_destination.rb +148 -0
  148. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/module_definition.rb +9 -0
  149. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/operations.rb +118 -0
  150. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_namespaces.rb +1333 -0
  151. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_registrations.rb +1074 -0
  152. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topic_event_subscriptions.rb +1156 -0
  153. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/partner_topics.rb +1102 -0
  154. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_endpoint_connections.rb +791 -0
  155. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/private_link_resources.rb +423 -0
  156. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topic_event_subscriptions.rb +1152 -0
  157. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/system_topics.rb +1128 -0
  158. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topic_types.rb +305 -0
  159. data/lib/2020-10-15-preview/generated/azure_mgmt_event_grid/topics.rb +1489 -0
  160. data/lib/azure_mgmt_event_grid.rb +8 -7
  161. data/lib/profiles/latest/modules/eventgrid_profile_module.rb +417 -181
  162. data/lib/version.rb +1 -1
  163. metadata +150 -3
@@ -0,0 +1,194 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::EventGrid::Mgmt::V2020_10_15_preview
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 [EventChannels] event_channels
47
+ attr_reader :event_channels
48
+
49
+ # @return [EventSubscriptions] event_subscriptions
50
+ attr_reader :event_subscriptions
51
+
52
+ # @return [SystemTopicEventSubscriptions] system_topic_event_subscriptions
53
+ attr_reader :system_topic_event_subscriptions
54
+
55
+ # @return [PartnerTopicEventSubscriptions]
56
+ # partner_topic_event_subscriptions
57
+ attr_reader :partner_topic_event_subscriptions
58
+
59
+ # @return [Operations] operations
60
+ attr_reader :operations
61
+
62
+ # @return [PartnerNamespaces] partner_namespaces
63
+ attr_reader :partner_namespaces
64
+
65
+ # @return [PartnerRegistrations] partner_registrations
66
+ attr_reader :partner_registrations
67
+
68
+ # @return [PartnerTopics] partner_topics
69
+ attr_reader :partner_topics
70
+
71
+ # @return [PrivateEndpointConnections] private_endpoint_connections
72
+ attr_reader :private_endpoint_connections
73
+
74
+ # @return [PrivateLinkResources] private_link_resources
75
+ attr_reader :private_link_resources
76
+
77
+ # @return [SystemTopics] system_topics
78
+ attr_reader :system_topics
79
+
80
+ # @return [Topics] topics
81
+ attr_reader :topics
82
+
83
+ # @return [ExtensionTopics] extension_topics
84
+ attr_reader :extension_topics
85
+
86
+ # @return [TopicTypes] topic_types
87
+ attr_reader :topic_types
88
+
89
+ #
90
+ # Creates initializes a new instance of the EventGridManagementClient class.
91
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
92
+ # @param base_url [String] the base URI of the service.
93
+ # @param options [Array] filters to be applied to the HTTP requests.
94
+ #
95
+ def initialize(credentials = nil, base_url = nil, options = nil)
96
+ super(credentials, options)
97
+ @base_url = base_url || 'https://management.azure.com'
98
+
99
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
100
+ @credentials = credentials
101
+
102
+ @domains = Domains.new(self)
103
+ @domain_topics = DomainTopics.new(self)
104
+ @event_channels = EventChannels.new(self)
105
+ @event_subscriptions = EventSubscriptions.new(self)
106
+ @system_topic_event_subscriptions = SystemTopicEventSubscriptions.new(self)
107
+ @partner_topic_event_subscriptions = PartnerTopicEventSubscriptions.new(self)
108
+ @operations = Operations.new(self)
109
+ @partner_namespaces = PartnerNamespaces.new(self)
110
+ @partner_registrations = PartnerRegistrations.new(self)
111
+ @partner_topics = PartnerTopics.new(self)
112
+ @private_endpoint_connections = PrivateEndpointConnections.new(self)
113
+ @private_link_resources = PrivateLinkResources.new(self)
114
+ @system_topics = SystemTopics.new(self)
115
+ @topics = Topics.new(self)
116
+ @extension_topics = ExtensionTopics.new(self)
117
+ @topic_types = TopicTypes.new(self)
118
+ @api_version = '2020-10-15-preview'
119
+ @accept_language = 'en-US'
120
+ @long_running_operation_retry_timeout = 30
121
+ @generate_client_request_id = true
122
+ add_telemetry
123
+ end
124
+
125
+ #
126
+ # Makes a request and returns the body of the response.
127
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
128
+ # @param path [String] the path, relative to {base_url}.
129
+ # @param options [Hash{String=>String}] specifying any request options like :body.
130
+ # @return [Hash{String=>String}] containing the body of the response.
131
+ # Example:
132
+ #
133
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
134
+ # path = "/path"
135
+ # options = {
136
+ # body: request_content,
137
+ # query_params: {'api-version' => '2016-02-01'}
138
+ # }
139
+ # result = @client.make_request(:put, path, options)
140
+ #
141
+ def make_request(method, path, options = {})
142
+ result = make_request_with_http_info(method, path, options)
143
+ result.body unless result.nil?
144
+ end
145
+
146
+ #
147
+ # Makes a request and returns the operation response.
148
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
149
+ # @param path [String] the path, relative to {base_url}.
150
+ # @param options [Hash{String=>String}] specifying any request options like :body.
151
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
152
+ #
153
+ def make_request_with_http_info(method, path, options = {})
154
+ result = make_request_async(method, path, options).value!
155
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
156
+ result
157
+ end
158
+
159
+ #
160
+ # Makes a request asynchronously.
161
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
162
+ # @param path [String] the path, relative to {base_url}.
163
+ # @param options [Hash{String=>String}] specifying any request options like :body.
164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
+ #
166
+ def make_request_async(method, path, options = {})
167
+ fail ArgumentError, 'method is nil' if method.nil?
168
+ fail ArgumentError, 'path is nil' if path.nil?
169
+
170
+ request_url = options[:base_url] || @base_url
171
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
172
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
173
+ end
174
+
175
+ request_headers = @request_headers
176
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
177
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
178
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
179
+
180
+ super(request_url, method, path, options)
181
+ end
182
+
183
+
184
+ private
185
+ #
186
+ # Adds telemetry information.
187
+ #
188
+ def add_telemetry
189
+ sdk_information = 'azure_mgmt_event_grid'
190
+ sdk_information = "#{sdk_information}/0.21.0"
191
+ add_user_agent_information(sdk_information)
192
+ end
193
+ end
194
+ end
@@ -0,0 +1,3775 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::EventGrid::Mgmt::V2020_10_15_preview
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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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::V2020_10_15_preview::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
+ # Get delivery attributes for an event subscription.
1865
+ #
1866
+ # Get all delivery attributes for an event subscription.
1867
+ #
1868
+ # @param scope [String] The scope of the event subscription. The scope can be a
1869
+ # subscription, or a resource group, or a top level resource belonging to a
1870
+ # resource provider namespace, or an EventGrid topic. For example, use
1871
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1872
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1873
+ # resource group, and
1874
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1875
+ # for a resource, and
1876
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1877
+ # for an EventGrid topic.
1878
+ # @param event_subscription_name [String] Name of the event subscription.
1879
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1880
+ # will be added to the HTTP request.
1881
+ #
1882
+ # @return [DeliveryAttributeListResult] operation results.
1883
+ #
1884
+ def get_delivery_attributes(scope, event_subscription_name, custom_headers:nil)
1885
+ response = get_delivery_attributes_async(scope, event_subscription_name, custom_headers:custom_headers).value!
1886
+ response.body unless response.nil?
1887
+ end
1888
+
1889
+ #
1890
+ # Get delivery attributes for an event subscription.
1891
+ #
1892
+ # Get all delivery attributes for an event subscription.
1893
+ #
1894
+ # @param scope [String] The scope of the event subscription. The scope can be a
1895
+ # subscription, or a resource group, or a top level resource belonging to a
1896
+ # resource provider namespace, or an EventGrid topic. For example, use
1897
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1898
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1899
+ # resource group, and
1900
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1901
+ # for a resource, and
1902
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1903
+ # for an EventGrid topic.
1904
+ # @param event_subscription_name [String] Name of the event subscription.
1905
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1906
+ # will be added to the HTTP request.
1907
+ #
1908
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1909
+ #
1910
+ def get_delivery_attributes_with_http_info(scope, event_subscription_name, custom_headers:nil)
1911
+ get_delivery_attributes_async(scope, event_subscription_name, custom_headers:custom_headers).value!
1912
+ end
1913
+
1914
+ #
1915
+ # Get delivery attributes for an event subscription.
1916
+ #
1917
+ # Get all delivery attributes for an event subscription.
1918
+ #
1919
+ # @param scope [String] The scope of the event subscription. The scope can be a
1920
+ # subscription, or a resource group, or a top level resource belonging to a
1921
+ # resource provider namespace, or an EventGrid topic. For example, use
1922
+ # '/subscriptions/{subscriptionId}/' for a subscription,
1923
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
1924
+ # resource group, and
1925
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
1926
+ # for a resource, and
1927
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
1928
+ # for an EventGrid topic.
1929
+ # @param event_subscription_name [String] Name of the event subscription.
1930
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1931
+ # to the HTTP request.
1932
+ #
1933
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1934
+ #
1935
+ def get_delivery_attributes_async(scope, event_subscription_name, custom_headers:nil)
1936
+ fail ArgumentError, 'scope is nil' if scope.nil?
1937
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
1938
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1939
+
1940
+
1941
+ request_headers = {}
1942
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1943
+
1944
+ # Set Headers
1945
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1946
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1947
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes'
1948
+
1949
+ request_url = @base_url || @client.base_url
1950
+
1951
+ options = {
1952
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1953
+ path_params: {'eventSubscriptionName' => event_subscription_name},
1954
+ skip_encoding_path_params: {'scope' => scope},
1955
+ query_params: {'api-version' => @client.api_version},
1956
+ headers: request_headers.merge(custom_headers || {}),
1957
+ base_url: request_url
1958
+ }
1959
+ promise = @client.make_request_async(:post, path_template, options)
1960
+
1961
+ promise = promise.then do |result|
1962
+ http_response = result.response
1963
+ status_code = http_response.status
1964
+ response_content = http_response.body
1965
+ unless status_code == 200
1966
+ error_model = JSON.load(response_content)
1967
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1968
+ end
1969
+
1970
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1971
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1972
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1973
+ # Deserialize Response
1974
+ if status_code == 200
1975
+ begin
1976
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1977
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::DeliveryAttributeListResult.mapper()
1978
+ result.body = @client.deserialize(result_mapper, parsed_response)
1979
+ rescue Exception => e
1980
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1981
+ end
1982
+ end
1983
+
1984
+ result
1985
+ end
1986
+
1987
+ promise.execute
1988
+ end
1989
+
1990
+ #
1991
+ # Create or update an event subscription.
1992
+ #
1993
+ # Asynchronously creates a new event subscription or updates an existing event
1994
+ # subscription based on the specified scope.
1995
+ #
1996
+ # @param scope [String] The identifier of the resource to which the event
1997
+ # subscription needs to be created or updated. The scope can be a subscription,
1998
+ # or a resource group, or a top level resource belonging to a resource provider
1999
+ # namespace, or an EventGrid topic. For example, use
2000
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2001
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2002
+ # resource group, and
2003
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2004
+ # for a resource, and
2005
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2006
+ # for an EventGrid topic.
2007
+ # @param event_subscription_name [String] Name of the event subscription. Event
2008
+ # subscription names must be between 3 and 64 characters in length and should
2009
+ # use alphanumeric letters only.
2010
+ # @param event_subscription_info [EventSubscription] Event subscription
2011
+ # properties containing the destination and filter information.
2012
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2013
+ # will be added to the HTTP request.
2014
+ #
2015
+ # @return [EventSubscription] operation results.
2016
+ #
2017
+ def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
2018
+ response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
2019
+ response.body unless response.nil?
2020
+ end
2021
+
2022
+ #
2023
+ # Create or update an event subscription.
2024
+ #
2025
+ # Asynchronously creates a new event subscription or updates an existing event
2026
+ # subscription based on the specified scope.
2027
+ #
2028
+ # @param scope [String] The identifier of the resource to which the event
2029
+ # subscription needs to be created or updated. The scope can be a subscription,
2030
+ # or a resource group, or a top level resource belonging to a resource provider
2031
+ # namespace, or an EventGrid topic. For example, use
2032
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2033
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2034
+ # resource group, and
2035
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2036
+ # for a resource, and
2037
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2038
+ # for an EventGrid topic.
2039
+ # @param event_subscription_name [String] Name of the event subscription. Event
2040
+ # subscription names must be between 3 and 64 characters in length and should
2041
+ # use alphanumeric letters only.
2042
+ # @param event_subscription_info [EventSubscription] Event subscription
2043
+ # properties containing the destination and filter information.
2044
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2045
+ # will be added to the HTTP request.
2046
+ #
2047
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2048
+ #
2049
+ def begin_create_or_update_with_http_info(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
2050
+ begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
2051
+ end
2052
+
2053
+ #
2054
+ # Create or update an event subscription.
2055
+ #
2056
+ # Asynchronously creates a new event subscription or updates an existing event
2057
+ # subscription based on the specified scope.
2058
+ #
2059
+ # @param scope [String] The identifier of the resource to which the event
2060
+ # subscription needs to be created or updated. The scope can be a subscription,
2061
+ # or a resource group, or a top level resource belonging to a resource provider
2062
+ # namespace, or an EventGrid topic. For example, use
2063
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2064
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2065
+ # resource group, and
2066
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2067
+ # for a resource, and
2068
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2069
+ # for an EventGrid topic.
2070
+ # @param event_subscription_name [String] Name of the event subscription. Event
2071
+ # subscription names must be between 3 and 64 characters in length and should
2072
+ # use alphanumeric letters only.
2073
+ # @param event_subscription_info [EventSubscription] Event subscription
2074
+ # properties containing the destination and filter information.
2075
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2076
+ # to the HTTP request.
2077
+ #
2078
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2079
+ #
2080
+ def begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
2081
+ fail ArgumentError, 'scope is nil' if scope.nil?
2082
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
2083
+ fail ArgumentError, 'event_subscription_info is nil' if event_subscription_info.nil?
2084
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2085
+
2086
+
2087
+ request_headers = {}
2088
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2089
+
2090
+ # Set Headers
2091
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2092
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2093
+
2094
+ # Serialize Request
2095
+ request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscription.mapper()
2096
+ request_content = @client.serialize(request_mapper, event_subscription_info)
2097
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2098
+
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
+ body: request_content,
2109
+ headers: request_headers.merge(custom_headers || {}),
2110
+ base_url: request_url
2111
+ }
2112
+ promise = @client.make_request_async(:put, path_template, options)
2113
+
2114
+ promise = promise.then do |result|
2115
+ http_response = result.response
2116
+ status_code = http_response.status
2117
+ response_content = http_response.body
2118
+ unless status_code == 201
2119
+ error_model = JSON.load(response_content)
2120
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2121
+ end
2122
+
2123
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2124
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2125
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2126
+ # Deserialize Response
2127
+ if status_code == 201
2128
+ begin
2129
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2130
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscription.mapper()
2131
+ result.body = @client.deserialize(result_mapper, parsed_response)
2132
+ rescue Exception => e
2133
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2134
+ end
2135
+ end
2136
+
2137
+ result
2138
+ end
2139
+
2140
+ promise.execute
2141
+ end
2142
+
2143
+ #
2144
+ # Delete an event subscription.
2145
+ #
2146
+ # Delete an existing event subscription.
2147
+ #
2148
+ # @param scope [String] The scope of the event subscription. The scope can be a
2149
+ # subscription, or a resource group, or a top level resource belonging to a
2150
+ # resource provider namespace, or an EventGrid topic. For example, use
2151
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2152
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2153
+ # resource group, and
2154
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2155
+ # for a resource, and
2156
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2157
+ # for an EventGrid topic.
2158
+ # @param event_subscription_name [String] Name of the event subscription.
2159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2160
+ # will be added to the HTTP request.
2161
+ #
2162
+ #
2163
+ def begin_delete(scope, event_subscription_name, custom_headers:nil)
2164
+ response = begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
2165
+ nil
2166
+ end
2167
+
2168
+ #
2169
+ # Delete an event subscription.
2170
+ #
2171
+ # Delete an existing event subscription.
2172
+ #
2173
+ # @param scope [String] The scope of the event subscription. The scope can be a
2174
+ # subscription, or a resource group, or a top level resource belonging to a
2175
+ # resource provider namespace, or an EventGrid topic. For example, use
2176
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2177
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2178
+ # resource group, and
2179
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2180
+ # for a resource, and
2181
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2182
+ # for an EventGrid topic.
2183
+ # @param event_subscription_name [String] Name of the event subscription.
2184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2185
+ # will be added to the HTTP request.
2186
+ #
2187
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2188
+ #
2189
+ def begin_delete_with_http_info(scope, event_subscription_name, custom_headers:nil)
2190
+ begin_delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
2191
+ end
2192
+
2193
+ #
2194
+ # Delete an event subscription.
2195
+ #
2196
+ # Delete an existing event subscription.
2197
+ #
2198
+ # @param scope [String] The scope of the event subscription. The scope can be a
2199
+ # subscription, or a resource group, or a top level resource belonging to a
2200
+ # resource provider namespace, or an EventGrid topic. For example, use
2201
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2202
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2203
+ # resource group, and
2204
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2205
+ # for a resource, and
2206
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2207
+ # for an EventGrid topic.
2208
+ # @param event_subscription_name [String] Name of the event subscription.
2209
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2210
+ # to the HTTP request.
2211
+ #
2212
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2213
+ #
2214
+ def begin_delete_async(scope, event_subscription_name, custom_headers:nil)
2215
+ fail ArgumentError, 'scope is nil' if scope.nil?
2216
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.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
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
2227
+
2228
+ request_url = @base_url || @client.base_url
2229
+
2230
+ options = {
2231
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2232
+ path_params: {'eventSubscriptionName' => event_subscription_name},
2233
+ skip_encoding_path_params: {'scope' => scope},
2234
+ query_params: {'api-version' => @client.api_version},
2235
+ headers: request_headers.merge(custom_headers || {}),
2236
+ base_url: request_url
2237
+ }
2238
+ promise = @client.make_request_async(:delete, path_template, options)
2239
+
2240
+ promise = promise.then do |result|
2241
+ http_response = result.response
2242
+ status_code = http_response.status
2243
+ response_content = http_response.body
2244
+ unless status_code == 200 || status_code == 202 || status_code == 204
2245
+ error_model = JSON.load(response_content)
2246
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2247
+ end
2248
+
2249
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2250
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2251
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2252
+
2253
+ result
2254
+ end
2255
+
2256
+ promise.execute
2257
+ end
2258
+
2259
+ #
2260
+ # Update an event subscription.
2261
+ #
2262
+ # Asynchronously updates an existing event subscription.
2263
+ #
2264
+ # @param scope [String] The scope of existing event subscription. The scope can
2265
+ # be a subscription, or a resource group, or a top level resource belonging to
2266
+ # a resource provider namespace, or an EventGrid topic. For example, use
2267
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2268
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2269
+ # resource group, and
2270
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2271
+ # for a resource, and
2272
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2273
+ # for an EventGrid topic.
2274
+ # @param event_subscription_name [String] Name of the event subscription to be
2275
+ # updated.
2276
+ # @param event_subscription_update_parameters
2277
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2279
+ # will be added to the HTTP request.
2280
+ #
2281
+ # @return [EventSubscription] operation results.
2282
+ #
2283
+ def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2284
+ response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
2285
+ response.body unless response.nil?
2286
+ end
2287
+
2288
+ #
2289
+ # Update an event subscription.
2290
+ #
2291
+ # Asynchronously updates an existing event subscription.
2292
+ #
2293
+ # @param scope [String] The scope of existing event subscription. The scope can
2294
+ # be a subscription, or a resource group, or a top level resource belonging to
2295
+ # a resource provider namespace, or an EventGrid topic. For example, use
2296
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2297
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2298
+ # resource group, and
2299
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2300
+ # for a resource, and
2301
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2302
+ # for an EventGrid topic.
2303
+ # @param event_subscription_name [String] Name of the event subscription to be
2304
+ # updated.
2305
+ # @param event_subscription_update_parameters
2306
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2308
+ # will be added to the HTTP request.
2309
+ #
2310
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2311
+ #
2312
+ def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2313
+ begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
2314
+ end
2315
+
2316
+ #
2317
+ # Update an event subscription.
2318
+ #
2319
+ # Asynchronously updates an existing event subscription.
2320
+ #
2321
+ # @param scope [String] The scope of existing event subscription. The scope can
2322
+ # be a subscription, or a resource group, or a top level resource belonging to
2323
+ # a resource provider namespace, or an EventGrid topic. For example, use
2324
+ # '/subscriptions/{subscriptionId}/' for a subscription,
2325
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
2326
+ # resource group, and
2327
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
2328
+ # for a resource, and
2329
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
2330
+ # for an EventGrid topic.
2331
+ # @param event_subscription_name [String] Name of the event subscription to be
2332
+ # updated.
2333
+ # @param event_subscription_update_parameters
2334
+ # [EventSubscriptionUpdateParameters] Updated event subscription information.
2335
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2336
+ # to the HTTP request.
2337
+ #
2338
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2339
+ #
2340
+ def begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
2341
+ fail ArgumentError, 'scope is nil' if scope.nil?
2342
+ fail ArgumentError, 'event_subscription_name is nil' if event_subscription_name.nil?
2343
+ fail ArgumentError, 'event_subscription_update_parameters is nil' if event_subscription_update_parameters.nil?
2344
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2345
+
2346
+
2347
+ request_headers = {}
2348
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2349
+
2350
+ # Set Headers
2351
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2352
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2353
+
2354
+ # Serialize Request
2355
+ request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionUpdateParameters.mapper()
2356
+ request_content = @client.serialize(request_mapper, event_subscription_update_parameters)
2357
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2358
+
2359
+ path_template = '{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'
2360
+
2361
+ request_url = @base_url || @client.base_url
2362
+
2363
+ options = {
2364
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2365
+ path_params: {'eventSubscriptionName' => event_subscription_name},
2366
+ skip_encoding_path_params: {'scope' => scope},
2367
+ query_params: {'api-version' => @client.api_version},
2368
+ body: request_content,
2369
+ headers: request_headers.merge(custom_headers || {}),
2370
+ base_url: request_url
2371
+ }
2372
+ promise = @client.make_request_async(:patch, path_template, options)
2373
+
2374
+ promise = promise.then do |result|
2375
+ http_response = result.response
2376
+ status_code = http_response.status
2377
+ response_content = http_response.body
2378
+ unless status_code == 201
2379
+ error_model = JSON.load(response_content)
2380
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2381
+ end
2382
+
2383
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2384
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2385
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2386
+ # Deserialize Response
2387
+ if status_code == 201
2388
+ begin
2389
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2390
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscription.mapper()
2391
+ result.body = @client.deserialize(result_mapper, parsed_response)
2392
+ rescue Exception => e
2393
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2394
+ end
2395
+ end
2396
+
2397
+ result
2398
+ end
2399
+
2400
+ promise.execute
2401
+ end
2402
+
2403
+ #
2404
+ # Get an aggregated list of all global event subscriptions under an Azure
2405
+ # subscription.
2406
+ #
2407
+ # List all aggregated global event subscriptions under a specific Azure
2408
+ # subscription.
2409
+ #
2410
+ # @param next_page_link [String] The NextLink from the previous successful call
2411
+ # to List operation.
2412
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2413
+ # will be added to the HTTP request.
2414
+ #
2415
+ # @return [EventSubscriptionsListResult] operation results.
2416
+ #
2417
+ def list_global_by_subscription_next(next_page_link, custom_headers:nil)
2418
+ response = list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2419
+ response.body unless response.nil?
2420
+ end
2421
+
2422
+ #
2423
+ # Get an aggregated list of all global event subscriptions under an Azure
2424
+ # subscription.
2425
+ #
2426
+ # List all aggregated global event subscriptions under a specific Azure
2427
+ # subscription.
2428
+ #
2429
+ # @param next_page_link [String] The NextLink from the previous successful call
2430
+ # to List operation.
2431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2432
+ # will be added to the HTTP request.
2433
+ #
2434
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2435
+ #
2436
+ def list_global_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2437
+ list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2438
+ end
2439
+
2440
+ #
2441
+ # Get an aggregated list of all global event subscriptions under an Azure
2442
+ # subscription.
2443
+ #
2444
+ # List all aggregated global event subscriptions under a specific Azure
2445
+ # subscription.
2446
+ #
2447
+ # @param next_page_link [String] The NextLink from the previous successful call
2448
+ # to List operation.
2449
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2450
+ # to the HTTP request.
2451
+ #
2452
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2453
+ #
2454
+ def list_global_by_subscription_next_async(next_page_link, custom_headers:nil)
2455
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2456
+
2457
+
2458
+ request_headers = {}
2459
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2460
+
2461
+ # Set Headers
2462
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2463
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2464
+ path_template = '{nextLink}'
2465
+
2466
+ request_url = @base_url || @client.base_url
2467
+
2468
+ options = {
2469
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2470
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2471
+ headers: request_headers.merge(custom_headers || {}),
2472
+ base_url: request_url
2473
+ }
2474
+ promise = @client.make_request_async(:get, path_template, options)
2475
+
2476
+ promise = promise.then do |result|
2477
+ http_response = result.response
2478
+ status_code = http_response.status
2479
+ response_content = http_response.body
2480
+ unless status_code == 200
2481
+ error_model = JSON.load(response_content)
2482
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2483
+ end
2484
+
2485
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2486
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2487
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2488
+ # Deserialize Response
2489
+ if status_code == 200
2490
+ begin
2491
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2492
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2493
+ result.body = @client.deserialize(result_mapper, parsed_response)
2494
+ rescue Exception => e
2495
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2496
+ end
2497
+ end
2498
+
2499
+ result
2500
+ end
2501
+
2502
+ promise.execute
2503
+ end
2504
+
2505
+ #
2506
+ # List all global event subscriptions for a topic type.
2507
+ #
2508
+ # List all global event subscriptions under an Azure subscription for a topic
2509
+ # type.
2510
+ #
2511
+ # @param next_page_link [String] The NextLink from the previous successful call
2512
+ # to List operation.
2513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2514
+ # will be added to the HTTP request.
2515
+ #
2516
+ # @return [EventSubscriptionsListResult] operation results.
2517
+ #
2518
+ def list_global_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil)
2519
+ response = list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2520
+ response.body unless response.nil?
2521
+ end
2522
+
2523
+ #
2524
+ # List all global event subscriptions for a topic type.
2525
+ #
2526
+ # List all global event subscriptions under an Azure subscription for a topic
2527
+ # type.
2528
+ #
2529
+ # @param next_page_link [String] The NextLink from the previous successful call
2530
+ # to List operation.
2531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2532
+ # will be added to the HTTP request.
2533
+ #
2534
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2535
+ #
2536
+ def list_global_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
2537
+ list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2538
+ end
2539
+
2540
+ #
2541
+ # List all global event subscriptions for a topic type.
2542
+ #
2543
+ # List all global event subscriptions under an Azure subscription for a topic
2544
+ # type.
2545
+ #
2546
+ # @param next_page_link [String] The NextLink from the previous successful call
2547
+ # to List operation.
2548
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2549
+ # to the HTTP request.
2550
+ #
2551
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2552
+ #
2553
+ def list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil)
2554
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2555
+
2556
+
2557
+ request_headers = {}
2558
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2559
+
2560
+ # Set Headers
2561
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2562
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2563
+ path_template = '{nextLink}'
2564
+
2565
+ request_url = @base_url || @client.base_url
2566
+
2567
+ options = {
2568
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2569
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2570
+ headers: request_headers.merge(custom_headers || {}),
2571
+ base_url: request_url
2572
+ }
2573
+ promise = @client.make_request_async(:get, path_template, options)
2574
+
2575
+ promise = promise.then do |result|
2576
+ http_response = result.response
2577
+ status_code = http_response.status
2578
+ response_content = http_response.body
2579
+ unless status_code == 200
2580
+ error_model = JSON.load(response_content)
2581
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2582
+ end
2583
+
2584
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2585
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2586
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2587
+ # Deserialize Response
2588
+ if status_code == 200
2589
+ begin
2590
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2591
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2592
+ result.body = @client.deserialize(result_mapper, parsed_response)
2593
+ rescue Exception => e
2594
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2595
+ end
2596
+ end
2597
+
2598
+ result
2599
+ end
2600
+
2601
+ promise.execute
2602
+ end
2603
+
2604
+ #
2605
+ # List all global event subscriptions under an Azure subscription and resource
2606
+ # group.
2607
+ #
2608
+ # List all global event subscriptions under a specific Azure subscription and
2609
+ # resource group.
2610
+ #
2611
+ # @param next_page_link [String] The NextLink from the previous successful call
2612
+ # to List operation.
2613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2614
+ # will be added to the HTTP request.
2615
+ #
2616
+ # @return [EventSubscriptionsListResult] operation results.
2617
+ #
2618
+ def list_global_by_resource_group_next(next_page_link, custom_headers:nil)
2619
+ response = list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2620
+ response.body unless response.nil?
2621
+ end
2622
+
2623
+ #
2624
+ # List all global event subscriptions under an Azure subscription and resource
2625
+ # group.
2626
+ #
2627
+ # List all global event subscriptions under a specific Azure subscription and
2628
+ # resource group.
2629
+ #
2630
+ # @param next_page_link [String] The NextLink from the previous successful call
2631
+ # to List operation.
2632
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2633
+ # will be added to the HTTP request.
2634
+ #
2635
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2636
+ #
2637
+ def list_global_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2638
+ list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2639
+ end
2640
+
2641
+ #
2642
+ # List all global event subscriptions under an Azure subscription and resource
2643
+ # group.
2644
+ #
2645
+ # List all global event subscriptions under a specific Azure subscription and
2646
+ # resource group.
2647
+ #
2648
+ # @param next_page_link [String] The NextLink from the previous successful call
2649
+ # to List operation.
2650
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2651
+ # to the HTTP request.
2652
+ #
2653
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2654
+ #
2655
+ def list_global_by_resource_group_next_async(next_page_link, custom_headers:nil)
2656
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2657
+
2658
+
2659
+ request_headers = {}
2660
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2661
+
2662
+ # Set Headers
2663
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2664
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2665
+ path_template = '{nextLink}'
2666
+
2667
+ request_url = @base_url || @client.base_url
2668
+
2669
+ options = {
2670
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2671
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2672
+ headers: request_headers.merge(custom_headers || {}),
2673
+ base_url: request_url
2674
+ }
2675
+ promise = @client.make_request_async(:get, path_template, options)
2676
+
2677
+ promise = promise.then do |result|
2678
+ http_response = result.response
2679
+ status_code = http_response.status
2680
+ response_content = http_response.body
2681
+ unless status_code == 200
2682
+ error_model = JSON.load(response_content)
2683
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2684
+ end
2685
+
2686
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2687
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2688
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2689
+ # Deserialize Response
2690
+ if status_code == 200
2691
+ begin
2692
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2693
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2694
+ result.body = @client.deserialize(result_mapper, parsed_response)
2695
+ rescue Exception => e
2696
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2697
+ end
2698
+ end
2699
+
2700
+ result
2701
+ end
2702
+
2703
+ promise.execute
2704
+ end
2705
+
2706
+ #
2707
+ # List all global event subscriptions under a resource group for a topic type.
2708
+ #
2709
+ # List all global event subscriptions under a resource group for a specific
2710
+ # topic type.
2711
+ #
2712
+ # @param next_page_link [String] The NextLink from the previous successful call
2713
+ # to List operation.
2714
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2715
+ # will be added to the HTTP request.
2716
+ #
2717
+ # @return [EventSubscriptionsListResult] operation results.
2718
+ #
2719
+ def list_global_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil)
2720
+ response = list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2721
+ response.body unless response.nil?
2722
+ end
2723
+
2724
+ #
2725
+ # List all global event subscriptions under a resource group for a topic type.
2726
+ #
2727
+ # List all global event subscriptions under a resource group for a specific
2728
+ # topic type.
2729
+ #
2730
+ # @param next_page_link [String] The NextLink from the previous successful call
2731
+ # to List operation.
2732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2733
+ # will be added to the HTTP request.
2734
+ #
2735
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2736
+ #
2737
+ def list_global_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
2738
+ list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
2739
+ end
2740
+
2741
+ #
2742
+ # List all global event subscriptions under a resource group for a topic type.
2743
+ #
2744
+ # List all global event subscriptions under a resource group for a specific
2745
+ # topic type.
2746
+ #
2747
+ # @param next_page_link [String] The NextLink from the previous successful call
2748
+ # to List operation.
2749
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2750
+ # to the HTTP request.
2751
+ #
2752
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2753
+ #
2754
+ def list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil)
2755
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2756
+
2757
+
2758
+ request_headers = {}
2759
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2760
+
2761
+ # Set Headers
2762
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2763
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2764
+ path_template = '{nextLink}'
2765
+
2766
+ request_url = @base_url || @client.base_url
2767
+
2768
+ options = {
2769
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2770
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2771
+ headers: request_headers.merge(custom_headers || {}),
2772
+ base_url: request_url
2773
+ }
2774
+ promise = @client.make_request_async(:get, path_template, options)
2775
+
2776
+ promise = promise.then do |result|
2777
+ http_response = result.response
2778
+ status_code = http_response.status
2779
+ response_content = http_response.body
2780
+ unless status_code == 200
2781
+ error_model = JSON.load(response_content)
2782
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2783
+ end
2784
+
2785
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2786
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2787
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2788
+ # Deserialize Response
2789
+ if status_code == 200
2790
+ begin
2791
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2792
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2793
+ result.body = @client.deserialize(result_mapper, parsed_response)
2794
+ rescue Exception => e
2795
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2796
+ end
2797
+ end
2798
+
2799
+ result
2800
+ end
2801
+
2802
+ promise.execute
2803
+ end
2804
+
2805
+ #
2806
+ # List all regional event subscriptions under an Azure subscription.
2807
+ #
2808
+ # List all event subscriptions from the given location under a specific Azure
2809
+ # subscription.
2810
+ #
2811
+ # @param next_page_link [String] The NextLink from the previous successful call
2812
+ # to List operation.
2813
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2814
+ # will be added to the HTTP request.
2815
+ #
2816
+ # @return [EventSubscriptionsListResult] operation results.
2817
+ #
2818
+ def list_regional_by_subscription_next(next_page_link, custom_headers:nil)
2819
+ response = list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2820
+ response.body unless response.nil?
2821
+ end
2822
+
2823
+ #
2824
+ # List all regional event subscriptions under an Azure subscription.
2825
+ #
2826
+ # List all event subscriptions from the given location under a specific Azure
2827
+ # subscription.
2828
+ #
2829
+ # @param next_page_link [String] The NextLink from the previous successful call
2830
+ # to List operation.
2831
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2832
+ # will be added to the HTTP request.
2833
+ #
2834
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2835
+ #
2836
+ def list_regional_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2837
+ list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2838
+ end
2839
+
2840
+ #
2841
+ # List all regional event subscriptions under an Azure subscription.
2842
+ #
2843
+ # List all event subscriptions from the given location under a specific Azure
2844
+ # subscription.
2845
+ #
2846
+ # @param next_page_link [String] The NextLink from the previous successful call
2847
+ # to List operation.
2848
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2849
+ # to the HTTP request.
2850
+ #
2851
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2852
+ #
2853
+ def list_regional_by_subscription_next_async(next_page_link, custom_headers:nil)
2854
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2855
+
2856
+
2857
+ request_headers = {}
2858
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2859
+
2860
+ # Set Headers
2861
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2862
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2863
+ path_template = '{nextLink}'
2864
+
2865
+ request_url = @base_url || @client.base_url
2866
+
2867
+ options = {
2868
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2869
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2870
+ headers: request_headers.merge(custom_headers || {}),
2871
+ base_url: request_url
2872
+ }
2873
+ promise = @client.make_request_async(:get, path_template, options)
2874
+
2875
+ promise = promise.then do |result|
2876
+ http_response = result.response
2877
+ status_code = http_response.status
2878
+ response_content = http_response.body
2879
+ unless status_code == 200
2880
+ error_model = JSON.load(response_content)
2881
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2882
+ end
2883
+
2884
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2885
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2886
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2887
+ # Deserialize Response
2888
+ if status_code == 200
2889
+ begin
2890
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2891
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2892
+ result.body = @client.deserialize(result_mapper, parsed_response)
2893
+ rescue Exception => e
2894
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2895
+ end
2896
+ end
2897
+
2898
+ result
2899
+ end
2900
+
2901
+ promise.execute
2902
+ end
2903
+
2904
+ #
2905
+ # List all regional event subscriptions under an Azure subscription and
2906
+ # resource group.
2907
+ #
2908
+ # List all event subscriptions from the given location under a specific Azure
2909
+ # subscription and resource group.
2910
+ #
2911
+ # @param next_page_link [String] The NextLink from the previous successful call
2912
+ # to List operation.
2913
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2914
+ # will be added to the HTTP request.
2915
+ #
2916
+ # @return [EventSubscriptionsListResult] operation results.
2917
+ #
2918
+ def list_regional_by_resource_group_next(next_page_link, custom_headers:nil)
2919
+ response = list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2920
+ response.body unless response.nil?
2921
+ end
2922
+
2923
+ #
2924
+ # List all regional event subscriptions under an Azure subscription and
2925
+ # resource group.
2926
+ #
2927
+ # List all event subscriptions from the given location under a specific Azure
2928
+ # subscription and resource group.
2929
+ #
2930
+ # @param next_page_link [String] The NextLink from the previous successful call
2931
+ # to List operation.
2932
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2933
+ # will be added to the HTTP request.
2934
+ #
2935
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2936
+ #
2937
+ def list_regional_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2938
+ list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2939
+ end
2940
+
2941
+ #
2942
+ # List all regional event subscriptions under an Azure subscription and
2943
+ # resource group.
2944
+ #
2945
+ # List all event subscriptions from the given location under a specific Azure
2946
+ # subscription and resource group.
2947
+ #
2948
+ # @param next_page_link [String] The NextLink from the previous successful call
2949
+ # to List operation.
2950
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2951
+ # to the HTTP request.
2952
+ #
2953
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2954
+ #
2955
+ def list_regional_by_resource_group_next_async(next_page_link, custom_headers:nil)
2956
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2957
+
2958
+
2959
+ request_headers = {}
2960
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2961
+
2962
+ # Set Headers
2963
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2964
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2965
+ path_template = '{nextLink}'
2966
+
2967
+ request_url = @base_url || @client.base_url
2968
+
2969
+ options = {
2970
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2971
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2972
+ headers: request_headers.merge(custom_headers || {}),
2973
+ base_url: request_url
2974
+ }
2975
+ promise = @client.make_request_async(:get, path_template, options)
2976
+
2977
+ promise = promise.then do |result|
2978
+ http_response = result.response
2979
+ status_code = http_response.status
2980
+ response_content = http_response.body
2981
+ unless status_code == 200
2982
+ error_model = JSON.load(response_content)
2983
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2984
+ end
2985
+
2986
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2987
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2988
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2989
+ # Deserialize Response
2990
+ if status_code == 200
2991
+ begin
2992
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2993
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
2994
+ result.body = @client.deserialize(result_mapper, parsed_response)
2995
+ rescue Exception => e
2996
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2997
+ end
2998
+ end
2999
+
3000
+ result
3001
+ end
3002
+
3003
+ promise.execute
3004
+ end
3005
+
3006
+ #
3007
+ # List all regional event subscriptions under an Azure subscription for a topic
3008
+ # type.
3009
+ #
3010
+ # List all event subscriptions from the given location under a specific Azure
3011
+ # subscription and topic type.
3012
+ #
3013
+ # @param next_page_link [String] The NextLink from the previous successful call
3014
+ # to List operation.
3015
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3016
+ # will be added to the HTTP request.
3017
+ #
3018
+ # @return [EventSubscriptionsListResult] operation results.
3019
+ #
3020
+ def list_regional_by_subscription_for_topic_type_next(next_page_link, custom_headers:nil)
3021
+ response = list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
3022
+ response.body unless response.nil?
3023
+ end
3024
+
3025
+ #
3026
+ # List all regional event subscriptions under an Azure subscription for a topic
3027
+ # type.
3028
+ #
3029
+ # List all event subscriptions from the given location under a specific Azure
3030
+ # subscription and topic type.
3031
+ #
3032
+ # @param next_page_link [String] The NextLink from the previous successful call
3033
+ # to List operation.
3034
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3035
+ # will be added to the HTTP request.
3036
+ #
3037
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3038
+ #
3039
+ def list_regional_by_subscription_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
3040
+ list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
3041
+ end
3042
+
3043
+ #
3044
+ # List all regional event subscriptions under an Azure subscription for a topic
3045
+ # type.
3046
+ #
3047
+ # List all event subscriptions from the given location under a specific Azure
3048
+ # subscription and topic type.
3049
+ #
3050
+ # @param next_page_link [String] The NextLink from the previous successful call
3051
+ # to List operation.
3052
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3053
+ # to the HTTP request.
3054
+ #
3055
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3056
+ #
3057
+ def list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:nil)
3058
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3059
+
3060
+
3061
+ request_headers = {}
3062
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3063
+
3064
+ # Set Headers
3065
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3066
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3067
+ path_template = '{nextLink}'
3068
+
3069
+ request_url = @base_url || @client.base_url
3070
+
3071
+ options = {
3072
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3073
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3074
+ headers: request_headers.merge(custom_headers || {}),
3075
+ base_url: request_url
3076
+ }
3077
+ promise = @client.make_request_async(:get, path_template, options)
3078
+
3079
+ promise = promise.then do |result|
3080
+ http_response = result.response
3081
+ status_code = http_response.status
3082
+ response_content = http_response.body
3083
+ unless status_code == 200
3084
+ error_model = JSON.load(response_content)
3085
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3086
+ end
3087
+
3088
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3089
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3090
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3091
+ # Deserialize Response
3092
+ if status_code == 200
3093
+ begin
3094
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3095
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
3096
+ result.body = @client.deserialize(result_mapper, parsed_response)
3097
+ rescue Exception => e
3098
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3099
+ end
3100
+ end
3101
+
3102
+ result
3103
+ end
3104
+
3105
+ promise.execute
3106
+ end
3107
+
3108
+ #
3109
+ # List all regional event subscriptions under an Azure subscription and
3110
+ # resource group for a topic type.
3111
+ #
3112
+ # List all event subscriptions from the given location under a specific Azure
3113
+ # subscription and resource group and topic type.
3114
+ #
3115
+ # @param next_page_link [String] The NextLink from the previous successful call
3116
+ # to List operation.
3117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3118
+ # will be added to the HTTP request.
3119
+ #
3120
+ # @return [EventSubscriptionsListResult] operation results.
3121
+ #
3122
+ def list_regional_by_resource_group_for_topic_type_next(next_page_link, custom_headers:nil)
3123
+ response = list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
3124
+ response.body unless response.nil?
3125
+ end
3126
+
3127
+ #
3128
+ # List all regional event subscriptions under an Azure subscription and
3129
+ # resource group for a topic type.
3130
+ #
3131
+ # List all event subscriptions from the given location under a specific Azure
3132
+ # subscription and resource group and topic type.
3133
+ #
3134
+ # @param next_page_link [String] The NextLink from the previous successful call
3135
+ # to List operation.
3136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3137
+ # will be added to the HTTP request.
3138
+ #
3139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3140
+ #
3141
+ def list_regional_by_resource_group_for_topic_type_next_with_http_info(next_page_link, custom_headers:nil)
3142
+ list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers).value!
3143
+ end
3144
+
3145
+ #
3146
+ # List all regional event subscriptions under an Azure subscription and
3147
+ # resource group for a topic type.
3148
+ #
3149
+ # List all event subscriptions from the given location under a specific Azure
3150
+ # subscription and resource group and topic type.
3151
+ #
3152
+ # @param next_page_link [String] The NextLink from the previous successful call
3153
+ # to List operation.
3154
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3155
+ # to the HTTP request.
3156
+ #
3157
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3158
+ #
3159
+ def list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:nil)
3160
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3161
+
3162
+
3163
+ request_headers = {}
3164
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3165
+
3166
+ # Set Headers
3167
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3168
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3169
+ path_template = '{nextLink}'
3170
+
3171
+ request_url = @base_url || @client.base_url
3172
+
3173
+ options = {
3174
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3175
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3176
+ headers: request_headers.merge(custom_headers || {}),
3177
+ base_url: request_url
3178
+ }
3179
+ promise = @client.make_request_async(:get, path_template, options)
3180
+
3181
+ promise = promise.then do |result|
3182
+ http_response = result.response
3183
+ status_code = http_response.status
3184
+ response_content = http_response.body
3185
+ unless status_code == 200
3186
+ error_model = JSON.load(response_content)
3187
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3188
+ end
3189
+
3190
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3191
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3192
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3193
+ # Deserialize Response
3194
+ if status_code == 200
3195
+ begin
3196
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3197
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
3198
+ result.body = @client.deserialize(result_mapper, parsed_response)
3199
+ rescue Exception => e
3200
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3201
+ end
3202
+ end
3203
+
3204
+ result
3205
+ end
3206
+
3207
+ promise.execute
3208
+ end
3209
+
3210
+ #
3211
+ # List all event subscriptions for a specific topic.
3212
+ #
3213
+ # List all event subscriptions that have been created for a specific topic.
3214
+ #
3215
+ # @param next_page_link [String] The NextLink from the previous successful call
3216
+ # to List operation.
3217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3218
+ # will be added to the HTTP request.
3219
+ #
3220
+ # @return [EventSubscriptionsListResult] operation results.
3221
+ #
3222
+ def list_by_resource_next(next_page_link, custom_headers:nil)
3223
+ response = list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
3224
+ response.body unless response.nil?
3225
+ end
3226
+
3227
+ #
3228
+ # List all event subscriptions for a specific topic.
3229
+ #
3230
+ # List all event subscriptions that have been created for a specific topic.
3231
+ #
3232
+ # @param next_page_link [String] The NextLink from the previous successful call
3233
+ # to List operation.
3234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3235
+ # will be added to the HTTP request.
3236
+ #
3237
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3238
+ #
3239
+ def list_by_resource_next_with_http_info(next_page_link, custom_headers:nil)
3240
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers).value!
3241
+ end
3242
+
3243
+ #
3244
+ # List all event subscriptions for a specific topic.
3245
+ #
3246
+ # List all event subscriptions that have been created for a specific topic.
3247
+ #
3248
+ # @param next_page_link [String] The NextLink from the previous successful call
3249
+ # to List operation.
3250
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3251
+ # to the HTTP request.
3252
+ #
3253
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3254
+ #
3255
+ def list_by_resource_next_async(next_page_link, custom_headers:nil)
3256
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3257
+
3258
+
3259
+ request_headers = {}
3260
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3261
+
3262
+ # Set Headers
3263
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3264
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3265
+ path_template = '{nextLink}'
3266
+
3267
+ request_url = @base_url || @client.base_url
3268
+
3269
+ options = {
3270
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3271
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3272
+ headers: request_headers.merge(custom_headers || {}),
3273
+ base_url: request_url
3274
+ }
3275
+ promise = @client.make_request_async(:get, path_template, options)
3276
+
3277
+ promise = promise.then do |result|
3278
+ http_response = result.response
3279
+ status_code = http_response.status
3280
+ response_content = http_response.body
3281
+ unless status_code == 200
3282
+ error_model = JSON.load(response_content)
3283
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3284
+ end
3285
+
3286
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3287
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3288
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3289
+ # Deserialize Response
3290
+ if status_code == 200
3291
+ begin
3292
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3293
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
3294
+ result.body = @client.deserialize(result_mapper, parsed_response)
3295
+ rescue Exception => e
3296
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3297
+ end
3298
+ end
3299
+
3300
+ result
3301
+ end
3302
+
3303
+ promise.execute
3304
+ end
3305
+
3306
+ #
3307
+ # List all event subscriptions for a specific domain topic.
3308
+ #
3309
+ # List all event subscriptions that have been created for a specific domain
3310
+ # topic.
3311
+ #
3312
+ # @param next_page_link [String] The NextLink from the previous successful call
3313
+ # to List operation.
3314
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3315
+ # will be added to the HTTP request.
3316
+ #
3317
+ # @return [EventSubscriptionsListResult] operation results.
3318
+ #
3319
+ def list_by_domain_topic_next(next_page_link, custom_headers:nil)
3320
+ response = list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value!
3321
+ response.body unless response.nil?
3322
+ end
3323
+
3324
+ #
3325
+ # List all event subscriptions for a specific domain topic.
3326
+ #
3327
+ # List all event subscriptions that have been created for a specific domain
3328
+ # topic.
3329
+ #
3330
+ # @param next_page_link [String] The NextLink from the previous successful call
3331
+ # to List operation.
3332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3333
+ # will be added to the HTTP request.
3334
+ #
3335
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3336
+ #
3337
+ def list_by_domain_topic_next_with_http_info(next_page_link, custom_headers:nil)
3338
+ list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers).value!
3339
+ end
3340
+
3341
+ #
3342
+ # List all event subscriptions for a specific domain topic.
3343
+ #
3344
+ # List all event subscriptions that have been created for a specific domain
3345
+ # topic.
3346
+ #
3347
+ # @param next_page_link [String] The NextLink from the previous successful call
3348
+ # to List operation.
3349
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3350
+ # to the HTTP request.
3351
+ #
3352
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3353
+ #
3354
+ def list_by_domain_topic_next_async(next_page_link, custom_headers:nil)
3355
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3356
+
3357
+
3358
+ request_headers = {}
3359
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3360
+
3361
+ # Set Headers
3362
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3363
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3364
+ path_template = '{nextLink}'
3365
+
3366
+ request_url = @base_url || @client.base_url
3367
+
3368
+ options = {
3369
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3370
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3371
+ headers: request_headers.merge(custom_headers || {}),
3372
+ base_url: request_url
3373
+ }
3374
+ promise = @client.make_request_async(:get, path_template, options)
3375
+
3376
+ promise = promise.then do |result|
3377
+ http_response = result.response
3378
+ status_code = http_response.status
3379
+ response_content = http_response.body
3380
+ unless status_code == 200
3381
+ error_model = JSON.load(response_content)
3382
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3383
+ end
3384
+
3385
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3386
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3387
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3388
+ # Deserialize Response
3389
+ if status_code == 200
3390
+ begin
3391
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3392
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::EventSubscriptionsListResult.mapper()
3393
+ result.body = @client.deserialize(result_mapper, parsed_response)
3394
+ rescue Exception => e
3395
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3396
+ end
3397
+ end
3398
+
3399
+ result
3400
+ end
3401
+
3402
+ promise.execute
3403
+ end
3404
+
3405
+ #
3406
+ # Get an aggregated list of all global event subscriptions under an Azure
3407
+ # subscription.
3408
+ #
3409
+ # List all aggregated global event subscriptions under a specific Azure
3410
+ # subscription.
3411
+ #
3412
+ # @param filter [String] The query used to filter the search results using
3413
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3414
+ # limited number of OData operations. These operations are: the 'contains'
3415
+ # function as well as the following logical operations: not, and, or, eq (for
3416
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3417
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3418
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3419
+ # $filter=location eq 'westus'.
3420
+ # @param top [Integer] The number of results to return per page for the list
3421
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3422
+ # default number of results to be returned is 20 items per page.
3423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3424
+ # will be added to the HTTP request.
3425
+ #
3426
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3427
+ # the response.
3428
+ #
3429
+ def list_global_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil)
3430
+ response = list_global_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
3431
+ unless response.nil?
3432
+ page = response.body
3433
+ page.next_method = Proc.new do |next_page_link|
3434
+ list_global_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
3435
+ end
3436
+ page
3437
+ end
3438
+ end
3439
+
3440
+ #
3441
+ # List all global event subscriptions for a topic type.
3442
+ #
3443
+ # List all global event subscriptions under an Azure subscription for a topic
3444
+ # type.
3445
+ #
3446
+ # @param topic_type_name [String] Name of the topic type.
3447
+ # @param filter [String] The query used to filter the search results using
3448
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3449
+ # limited number of OData operations. These operations are: the 'contains'
3450
+ # function as well as the following logical operations: not, and, or, eq (for
3451
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3452
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3453
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3454
+ # $filter=location eq 'westus'.
3455
+ # @param top [Integer] The number of results to return per page for the list
3456
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3457
+ # default number of results to be returned is 20 items per page.
3458
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3459
+ # will be added to the HTTP request.
3460
+ #
3461
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3462
+ # the response.
3463
+ #
3464
+ def list_global_by_subscription_for_topic_type_as_lazy(topic_type_name, filter:nil, top:nil, custom_headers:nil)
3465
+ response = list_global_by_subscription_for_topic_type_async(topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3466
+ unless response.nil?
3467
+ page = response.body
3468
+ page.next_method = Proc.new do |next_page_link|
3469
+ list_global_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3470
+ end
3471
+ page
3472
+ end
3473
+ end
3474
+
3475
+ #
3476
+ # List all global event subscriptions under an Azure subscription and resource
3477
+ # group.
3478
+ #
3479
+ # List all global event subscriptions under a specific Azure subscription and
3480
+ # resource group.
3481
+ #
3482
+ # @param resource_group_name [String] The name of the resource group within the
3483
+ # user's subscription.
3484
+ # @param filter [String] The query used to filter the search results using
3485
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3486
+ # limited number of OData operations. These operations are: the 'contains'
3487
+ # function as well as the following logical operations: not, and, or, eq (for
3488
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3489
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3490
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3491
+ # $filter=location eq 'westus'.
3492
+ # @param top [Integer] The number of results to return per page for the list
3493
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3494
+ # default number of results to be returned is 20 items per page.
3495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3496
+ # will be added to the HTTP request.
3497
+ #
3498
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3499
+ # the response.
3500
+ #
3501
+ def list_global_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
3502
+ response = list_global_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
3503
+ unless response.nil?
3504
+ page = response.body
3505
+ page.next_method = Proc.new do |next_page_link|
3506
+ list_global_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3507
+ end
3508
+ page
3509
+ end
3510
+ end
3511
+
3512
+ #
3513
+ # List all global event subscriptions under a resource group for a topic type.
3514
+ #
3515
+ # List all global event subscriptions under a resource group for a specific
3516
+ # topic type.
3517
+ #
3518
+ # @param resource_group_name [String] The name of the resource group within the
3519
+ # user's subscription.
3520
+ # @param topic_type_name [String] Name of the topic type.
3521
+ # @param filter [String] The query used to filter the search results using
3522
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3523
+ # limited number of OData operations. These operations are: the 'contains'
3524
+ # function as well as the following logical operations: not, and, or, eq (for
3525
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3526
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3527
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3528
+ # $filter=location eq 'westus'.
3529
+ # @param top [Integer] The number of results to return per page for the list
3530
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3531
+ # default number of results to be returned is 20 items per page.
3532
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3533
+ # will be added to the HTTP request.
3534
+ #
3535
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3536
+ # the response.
3537
+ #
3538
+ def list_global_by_resource_group_for_topic_type_as_lazy(resource_group_name, topic_type_name, filter:nil, top:nil, custom_headers:nil)
3539
+ 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!
3540
+ unless response.nil?
3541
+ page = response.body
3542
+ page.next_method = Proc.new do |next_page_link|
3543
+ list_global_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3544
+ end
3545
+ page
3546
+ end
3547
+ end
3548
+
3549
+ #
3550
+ # List all regional event subscriptions under an Azure subscription.
3551
+ #
3552
+ # List all event subscriptions from the given location under a specific Azure
3553
+ # subscription.
3554
+ #
3555
+ # @param location [String] Name of the location.
3556
+ # @param filter [String] The query used to filter the search results using
3557
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3558
+ # limited number of OData operations. These operations are: the 'contains'
3559
+ # function as well as the following logical operations: not, and, or, eq (for
3560
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3561
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3562
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3563
+ # $filter=location eq 'westus'.
3564
+ # @param top [Integer] The number of results to return per page for the list
3565
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3566
+ # default number of results to be returned is 20 items per page.
3567
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3568
+ # will be added to the HTTP request.
3569
+ #
3570
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3571
+ # the response.
3572
+ #
3573
+ def list_regional_by_subscription_as_lazy(location, filter:nil, top:nil, custom_headers:nil)
3574
+ response = list_regional_by_subscription_async(location, filter:filter, top:top, custom_headers:custom_headers).value!
3575
+ unless response.nil?
3576
+ page = response.body
3577
+ page.next_method = Proc.new do |next_page_link|
3578
+ list_regional_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
3579
+ end
3580
+ page
3581
+ end
3582
+ end
3583
+
3584
+ #
3585
+ # List all regional event subscriptions under an Azure subscription and
3586
+ # resource group.
3587
+ #
3588
+ # List all event subscriptions from the given location under a specific Azure
3589
+ # subscription and resource group.
3590
+ #
3591
+ # @param resource_group_name [String] The name of the resource group within the
3592
+ # user's subscription.
3593
+ # @param location [String] Name of the location.
3594
+ # @param filter [String] The query used to filter the search results using
3595
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3596
+ # limited number of OData operations. These operations are: the 'contains'
3597
+ # function as well as the following logical operations: not, and, or, eq (for
3598
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3599
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3600
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3601
+ # $filter=location eq 'westus'.
3602
+ # @param top [Integer] The number of results to return per page for the list
3603
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3604
+ # default number of results to be returned is 20 items per page.
3605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3606
+ # will be added to the HTTP request.
3607
+ #
3608
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3609
+ # the response.
3610
+ #
3611
+ def list_regional_by_resource_group_as_lazy(resource_group_name, location, filter:nil, top:nil, custom_headers:nil)
3612
+ response = list_regional_by_resource_group_async(resource_group_name, location, filter:filter, top:top, custom_headers:custom_headers).value!
3613
+ unless response.nil?
3614
+ page = response.body
3615
+ page.next_method = Proc.new do |next_page_link|
3616
+ list_regional_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3617
+ end
3618
+ page
3619
+ end
3620
+ end
3621
+
3622
+ #
3623
+ # List all regional event subscriptions under an Azure subscription for a topic
3624
+ # type.
3625
+ #
3626
+ # List all event subscriptions from the given location under a specific Azure
3627
+ # subscription and topic type.
3628
+ #
3629
+ # @param location [String] Name of the location.
3630
+ # @param topic_type_name [String] Name of the topic type.
3631
+ # @param filter [String] The query used to filter the search results using
3632
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3633
+ # limited number of OData operations. These operations are: the 'contains'
3634
+ # function as well as the following logical operations: not, and, or, eq (for
3635
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3636
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3637
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3638
+ # $filter=location eq 'westus'.
3639
+ # @param top [Integer] The number of results to return per page for the list
3640
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3641
+ # default number of results to be returned is 20 items per page.
3642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3643
+ # will be added to the HTTP request.
3644
+ #
3645
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3646
+ # the response.
3647
+ #
3648
+ def list_regional_by_subscription_for_topic_type_as_lazy(location, topic_type_name, filter:nil, top:nil, custom_headers:nil)
3649
+ response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, filter:filter, top:top, custom_headers:custom_headers).value!
3650
+ unless response.nil?
3651
+ page = response.body
3652
+ page.next_method = Proc.new do |next_page_link|
3653
+ list_regional_by_subscription_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3654
+ end
3655
+ page
3656
+ end
3657
+ end
3658
+
3659
+ #
3660
+ # List all regional event subscriptions under an Azure subscription and
3661
+ # resource group for a topic type.
3662
+ #
3663
+ # List all event subscriptions from the given location under a specific Azure
3664
+ # subscription and resource group and topic type.
3665
+ #
3666
+ # @param resource_group_name [String] The name of the resource group within the
3667
+ # user's subscription.
3668
+ # @param location [String] Name of the location.
3669
+ # @param topic_type_name [String] Name of the topic type.
3670
+ # @param filter [String] The query used to filter the search results using
3671
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3672
+ # limited number of OData operations. These operations are: the 'contains'
3673
+ # function as well as the following logical operations: not, and, or, eq (for
3674
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3675
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3676
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3677
+ # $filter=location eq 'westus'.
3678
+ # @param top [Integer] The number of results to return per page for the list
3679
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3680
+ # default number of results to be returned is 20 items per page.
3681
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3682
+ # will be added to the HTTP request.
3683
+ #
3684
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3685
+ # the response.
3686
+ #
3687
+ 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)
3688
+ 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!
3689
+ unless response.nil?
3690
+ page = response.body
3691
+ page.next_method = Proc.new do |next_page_link|
3692
+ list_regional_by_resource_group_for_topic_type_next_async(next_page_link, custom_headers:custom_headers)
3693
+ end
3694
+ page
3695
+ end
3696
+ end
3697
+
3698
+ #
3699
+ # List all event subscriptions for a specific topic.
3700
+ #
3701
+ # List all event subscriptions that have been created for a specific topic.
3702
+ #
3703
+ # @param resource_group_name [String] The name of the resource group within the
3704
+ # user's subscription.
3705
+ # @param provider_namespace [String] Namespace of the provider of the topic.
3706
+ # @param resource_type_name [String] Name of the resource type.
3707
+ # @param resource_name [String] Name of the resource.
3708
+ # @param filter [String] The query used to filter the search results using
3709
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3710
+ # limited number of OData operations. These operations are: the 'contains'
3711
+ # function as well as the following logical operations: not, and, or, eq (for
3712
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3713
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3714
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3715
+ # $filter=location eq 'westus'.
3716
+ # @param top [Integer] The number of results to return per page for the list
3717
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3718
+ # default number of results to be returned is 20 items per page.
3719
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3720
+ # will be added to the HTTP request.
3721
+ #
3722
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3723
+ # the response.
3724
+ #
3725
+ def list_by_resource_as_lazy(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:nil, top:nil, custom_headers:nil)
3726
+ response = list_by_resource_async(resource_group_name, provider_namespace, resource_type_name, resource_name, filter:filter, top:top, custom_headers:custom_headers).value!
3727
+ unless response.nil?
3728
+ page = response.body
3729
+ page.next_method = Proc.new do |next_page_link|
3730
+ list_by_resource_next_async(next_page_link, custom_headers:custom_headers)
3731
+ end
3732
+ page
3733
+ end
3734
+ end
3735
+
3736
+ #
3737
+ # List all event subscriptions for a specific domain topic.
3738
+ #
3739
+ # List all event subscriptions that have been created for a specific domain
3740
+ # topic.
3741
+ #
3742
+ # @param resource_group_name [String] The name of the resource group within the
3743
+ # user's subscription.
3744
+ # @param domain_name [String] Name of the top level domain.
3745
+ # @param topic_name [String] Name of the domain topic.
3746
+ # @param filter [String] The query used to filter the search results using
3747
+ # OData syntax. Filtering is permitted on the 'name' property only and with
3748
+ # limited number of OData operations. These operations are: the 'contains'
3749
+ # function as well as the following logical operations: not, and, or, eq (for
3750
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
3751
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
3752
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
3753
+ # $filter=location eq 'westus'.
3754
+ # @param top [Integer] The number of results to return per page for the list
3755
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
3756
+ # default number of results to be returned is 20 items per page.
3757
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3758
+ # will be added to the HTTP request.
3759
+ #
3760
+ # @return [EventSubscriptionsListResult] which provide lazy access to pages of
3761
+ # the response.
3762
+ #
3763
+ def list_by_domain_topic_as_lazy(resource_group_name, domain_name, topic_name, filter:nil, top:nil, custom_headers:nil)
3764
+ response = list_by_domain_topic_async(resource_group_name, domain_name, topic_name, filter:filter, top:top, custom_headers:custom_headers).value!
3765
+ unless response.nil?
3766
+ page = response.body
3767
+ page.next_method = Proc.new do |next_page_link|
3768
+ list_by_domain_topic_next_async(next_page_link, custom_headers:custom_headers)
3769
+ end
3770
+ page
3771
+ end
3772
+ end
3773
+
3774
+ end
3775
+ end