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,1128 @@
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 SystemTopics
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SystemTopics class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [EventGridManagementClient] reference to the EventGridManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get a system topic.
26
+ #
27
+ # Get properties of a system topic.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group within the
30
+ # user's subscription.
31
+ # @param system_topic_name [String] Name of the system topic.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [SystemTopic] operation results.
36
+ #
37
+ def get(resource_group_name, system_topic_name, custom_headers:nil)
38
+ response = get_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Get a system topic.
44
+ #
45
+ # Get properties of a system topic.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group within the
48
+ # user's subscription.
49
+ # @param system_topic_name [String] Name of the system topic.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, system_topic_name, custom_headers:nil)
56
+ get_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get a system topic.
61
+ #
62
+ # Get properties of a system topic.
63
+ #
64
+ # @param resource_group_name [String] The name of the resource group within the
65
+ # user's subscription.
66
+ # @param system_topic_name [String] Name of the system topic.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, system_topic_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, 'system_topic_name is nil' if system_topic_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'systemTopicName' => system_topic_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Create a system topic.
129
+ #
130
+ # Asynchronously creates a new system topic with the specified parameters.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group within the
133
+ # user's subscription.
134
+ # @param system_topic_name [String] Name of the system topic.
135
+ # @param system_topic_info [SystemTopic] System Topic information.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [SystemTopic] operation results.
140
+ #
141
+ def create_or_update(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil)
142
+ response = create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group within the
148
+ # user's subscription.
149
+ # @param system_topic_name [String] Name of the system topic.
150
+ # @param system_topic_info [SystemTopic] System Topic information.
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [Concurrent::Promise] promise which provides async access to http
155
+ # response.
156
+ #
157
+ def create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil)
158
+ # Send request
159
+ promise = begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers)
160
+
161
+ promise = promise.then do |response|
162
+ # Defining deserialization method.
163
+ deserialize_method = lambda do |parsed_response|
164
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
165
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
166
+ end
167
+
168
+ # Waiting for response.
169
+ @client.get_long_running_operation_result(response, deserialize_method)
170
+ end
171
+
172
+ promise
173
+ end
174
+
175
+ #
176
+ # Delete a system topic.
177
+ #
178
+ # Delete existing system topic.
179
+ #
180
+ # @param resource_group_name [String] The name of the resource group within the
181
+ # user's subscription.
182
+ # @param system_topic_name [String] Name of the system topic.
183
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
184
+ # will be added to the HTTP request.
185
+ #
186
+ def delete(resource_group_name, system_topic_name, custom_headers:nil)
187
+ response = delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value!
188
+ nil
189
+ end
190
+
191
+ #
192
+ # @param resource_group_name [String] The name of the resource group within the
193
+ # user's subscription.
194
+ # @param system_topic_name [String] Name of the system topic.
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [Concurrent::Promise] promise which provides async access to http
199
+ # response.
200
+ #
201
+ def delete_async(resource_group_name, system_topic_name, custom_headers:nil)
202
+ # Send request
203
+ promise = begin_delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers)
204
+
205
+ promise = promise.then do |response|
206
+ # Defining deserialization method.
207
+ deserialize_method = lambda do |parsed_response|
208
+ end
209
+
210
+ # Waiting for response.
211
+ @client.get_long_running_operation_result(response, deserialize_method)
212
+ end
213
+
214
+ promise
215
+ end
216
+
217
+ #
218
+ # Update a system topic.
219
+ #
220
+ # Asynchronously updates a system topic with the specified parameters.
221
+ #
222
+ # @param resource_group_name [String] The name of the resource group within the
223
+ # user's subscription.
224
+ # @param system_topic_name [String] Name of the system topic.
225
+ # @param system_topic_update_parameters [SystemTopicUpdateParameters]
226
+ # SystemTopic update information.
227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
228
+ # will be added to the HTTP request.
229
+ #
230
+ # @return [SystemTopic] operation results.
231
+ #
232
+ def update(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil)
233
+ response = update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers).value!
234
+ response.body unless response.nil?
235
+ end
236
+
237
+ #
238
+ # @param resource_group_name [String] The name of the resource group within the
239
+ # user's subscription.
240
+ # @param system_topic_name [String] Name of the system topic.
241
+ # @param system_topic_update_parameters [SystemTopicUpdateParameters]
242
+ # SystemTopic update information.
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [Concurrent::Promise] promise which provides async access to http
247
+ # response.
248
+ #
249
+ def update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil)
250
+ # Send request
251
+ promise = begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers)
252
+
253
+ promise = promise.then do |response|
254
+ # Defining deserialization method.
255
+ deserialize_method = lambda do |parsed_response|
256
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
257
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
258
+ end
259
+
260
+ # Waiting for response.
261
+ @client.get_long_running_operation_result(response, deserialize_method)
262
+ end
263
+
264
+ promise
265
+ end
266
+
267
+ #
268
+ # List system topics under an Azure subscription.
269
+ #
270
+ # List all the system topics under an Azure subscription.
271
+ #
272
+ # @param filter [String] The query used to filter the search results using
273
+ # OData syntax. Filtering is permitted on the 'name' property only and with
274
+ # limited number of OData operations. These operations are: the 'contains'
275
+ # function as well as the following logical operations: not, and, or, eq (for
276
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
277
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
278
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
279
+ # $filter=location eq 'westus'.
280
+ # @param top [Integer] The number of results to return per page for the list
281
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
282
+ # default number of results to be returned is 20 items per page.
283
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
284
+ # will be added to the HTTP request.
285
+ #
286
+ # @return [Array<SystemTopic>] operation results.
287
+ #
288
+ def list_by_subscription(filter:nil, top:nil, custom_headers:nil)
289
+ first_page = list_by_subscription_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
290
+ first_page.get_all_items
291
+ end
292
+
293
+ #
294
+ # List system topics under an Azure subscription.
295
+ #
296
+ # List all the system topics under an Azure subscription.
297
+ #
298
+ # @param filter [String] The query used to filter the search results using
299
+ # OData syntax. Filtering is permitted on the 'name' property only and with
300
+ # limited number of OData operations. These operations are: the 'contains'
301
+ # function as well as the following logical operations: not, and, or, eq (for
302
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
303
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
304
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
305
+ # $filter=location eq 'westus'.
306
+ # @param top [Integer] The number of results to return per page for the list
307
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
308
+ # default number of results to be returned is 20 items per page.
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
313
+ #
314
+ def list_by_subscription_with_http_info(filter:nil, top:nil, custom_headers:nil)
315
+ list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
316
+ end
317
+
318
+ #
319
+ # List system topics under an Azure subscription.
320
+ #
321
+ # List all the system topics under an Azure subscription.
322
+ #
323
+ # @param filter [String] The query used to filter the search results using
324
+ # OData syntax. Filtering is permitted on the 'name' property only and with
325
+ # limited number of OData operations. These operations are: the 'contains'
326
+ # function as well as the following logical operations: not, and, or, eq (for
327
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
328
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
329
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
330
+ # $filter=location eq 'westus'.
331
+ # @param top [Integer] The number of results to return per page for the list
332
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
333
+ # default number of results to be returned is 20 items per page.
334
+ # @param [Hash{String => String}] A hash of custom headers that will be added
335
+ # to the HTTP request.
336
+ #
337
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
338
+ #
339
+ def list_by_subscription_async(filter:nil, top:nil, custom_headers:nil)
340
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
342
+
343
+
344
+ request_headers = {}
345
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
346
+
347
+ # Set Headers
348
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/systemTopics'
351
+
352
+ request_url = @base_url || @client.base_url
353
+
354
+ options = {
355
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
+ path_params: {'subscriptionId' => @client.subscription_id},
357
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
358
+ headers: request_headers.merge(custom_headers || {}),
359
+ base_url: request_url
360
+ }
361
+ promise = @client.make_request_async(:get, path_template, options)
362
+
363
+ promise = promise.then do |result|
364
+ http_response = result.response
365
+ status_code = http_response.status
366
+ response_content = http_response.body
367
+ unless status_code == 200
368
+ error_model = JSON.load(response_content)
369
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
370
+ end
371
+
372
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
373
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
374
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
375
+ # Deserialize Response
376
+ if status_code == 200
377
+ begin
378
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
379
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult.mapper()
380
+ result.body = @client.deserialize(result_mapper, parsed_response)
381
+ rescue Exception => e
382
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
383
+ end
384
+ end
385
+
386
+ result
387
+ end
388
+
389
+ promise.execute
390
+ end
391
+
392
+ #
393
+ # List system topics under a resource group.
394
+ #
395
+ # List all the system topics under a resource group.
396
+ #
397
+ # @param resource_group_name [String] The name of the resource group within the
398
+ # user's subscription.
399
+ # @param filter [String] The query used to filter the search results using
400
+ # OData syntax. Filtering is permitted on the 'name' property only and with
401
+ # limited number of OData operations. These operations are: the 'contains'
402
+ # function as well as the following logical operations: not, and, or, eq (for
403
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
404
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
405
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
406
+ # $filter=location eq 'westus'.
407
+ # @param top [Integer] The number of results to return per page for the list
408
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
409
+ # default number of results to be returned is 20 items per page.
410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
411
+ # will be added to the HTTP request.
412
+ #
413
+ # @return [Array<SystemTopic>] operation results.
414
+ #
415
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
416
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
417
+ first_page.get_all_items
418
+ end
419
+
420
+ #
421
+ # List system topics under a resource group.
422
+ #
423
+ # List all the system topics under a resource group.
424
+ #
425
+ # @param resource_group_name [String] The name of the resource group within the
426
+ # user's subscription.
427
+ # @param filter [String] The query used to filter the search results using
428
+ # OData syntax. Filtering is permitted on the 'name' property only and with
429
+ # limited number of OData operations. These operations are: the 'contains'
430
+ # function as well as the following logical operations: not, and, or, eq (for
431
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
432
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
433
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
434
+ # $filter=location eq 'westus'.
435
+ # @param top [Integer] The number of results to return per page for the list
436
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
437
+ # default number of results to be returned is 20 items per page.
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
442
+ #
443
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
444
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
445
+ end
446
+
447
+ #
448
+ # List system topics under a resource group.
449
+ #
450
+ # List all the system topics under a resource group.
451
+ #
452
+ # @param resource_group_name [String] The name of the resource group within the
453
+ # user's subscription.
454
+ # @param filter [String] The query used to filter the search results using
455
+ # OData syntax. Filtering is permitted on the 'name' property only and with
456
+ # limited number of OData operations. These operations are: the 'contains'
457
+ # function as well as the following logical operations: not, and, or, eq (for
458
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
459
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
460
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
461
+ # $filter=location eq 'westus'.
462
+ # @param top [Integer] The number of results to return per page for the list
463
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
464
+ # default number of results to be returned is 20 items per page.
465
+ # @param [Hash{String => String}] A hash of custom headers that will be added
466
+ # to the HTTP request.
467
+ #
468
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
469
+ #
470
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
471
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
472
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
473
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
474
+
475
+
476
+ request_headers = {}
477
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
478
+
479
+ # Set Headers
480
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
481
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
482
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics'
483
+
484
+ request_url = @base_url || @client.base_url
485
+
486
+ options = {
487
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
488
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
489
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top},
490
+ headers: request_headers.merge(custom_headers || {}),
491
+ base_url: request_url
492
+ }
493
+ promise = @client.make_request_async(:get, path_template, options)
494
+
495
+ promise = promise.then do |result|
496
+ http_response = result.response
497
+ status_code = http_response.status
498
+ response_content = http_response.body
499
+ unless status_code == 200
500
+ error_model = JSON.load(response_content)
501
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
502
+ end
503
+
504
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
505
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
506
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
507
+ # Deserialize Response
508
+ if status_code == 200
509
+ begin
510
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
511
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult.mapper()
512
+ result.body = @client.deserialize(result_mapper, parsed_response)
513
+ rescue Exception => e
514
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
515
+ end
516
+ end
517
+
518
+ result
519
+ end
520
+
521
+ promise.execute
522
+ end
523
+
524
+ #
525
+ # Create a system topic.
526
+ #
527
+ # Asynchronously creates a new system topic with the specified parameters.
528
+ #
529
+ # @param resource_group_name [String] The name of the resource group within the
530
+ # user's subscription.
531
+ # @param system_topic_name [String] Name of the system topic.
532
+ # @param system_topic_info [SystemTopic] System Topic information.
533
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
534
+ # will be added to the HTTP request.
535
+ #
536
+ # @return [SystemTopic] operation results.
537
+ #
538
+ def begin_create_or_update(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil)
539
+ response = begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers).value!
540
+ response.body unless response.nil?
541
+ end
542
+
543
+ #
544
+ # Create a system topic.
545
+ #
546
+ # Asynchronously creates a new system topic with the specified parameters.
547
+ #
548
+ # @param resource_group_name [String] The name of the resource group within the
549
+ # user's subscription.
550
+ # @param system_topic_name [String] Name of the system topic.
551
+ # @param system_topic_info [SystemTopic] System Topic information.
552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
553
+ # will be added to the HTTP request.
554
+ #
555
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
556
+ #
557
+ def begin_create_or_update_with_http_info(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil)
558
+ begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:custom_headers).value!
559
+ end
560
+
561
+ #
562
+ # Create a system topic.
563
+ #
564
+ # Asynchronously creates a new system topic with the specified parameters.
565
+ #
566
+ # @param resource_group_name [String] The name of the resource group within the
567
+ # user's subscription.
568
+ # @param system_topic_name [String] Name of the system topic.
569
+ # @param system_topic_info [SystemTopic] System Topic information.
570
+ # @param [Hash{String => String}] A hash of custom headers that will be added
571
+ # to the HTTP request.
572
+ #
573
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
574
+ #
575
+ def begin_create_or_update_async(resource_group_name, system_topic_name, system_topic_info, custom_headers:nil)
576
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
577
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
578
+ fail ArgumentError, 'system_topic_name is nil' if system_topic_name.nil?
579
+ fail ArgumentError, 'system_topic_info is nil' if system_topic_info.nil?
580
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
581
+
582
+
583
+ request_headers = {}
584
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
585
+
586
+ # Set Headers
587
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
588
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
589
+
590
+ # Serialize Request
591
+ request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
592
+ request_content = @client.serialize(request_mapper, system_topic_info)
593
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
594
+
595
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'
596
+
597
+ request_url = @base_url || @client.base_url
598
+
599
+ options = {
600
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
601
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'systemTopicName' => system_topic_name},
602
+ query_params: {'api-version' => @client.api_version},
603
+ body: request_content,
604
+ headers: request_headers.merge(custom_headers || {}),
605
+ base_url: request_url
606
+ }
607
+ promise = @client.make_request_async(:put, path_template, options)
608
+
609
+ promise = promise.then do |result|
610
+ http_response = result.response
611
+ status_code = http_response.status
612
+ response_content = http_response.body
613
+ unless status_code == 200 || status_code == 201
614
+ error_model = JSON.load(response_content)
615
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
616
+ end
617
+
618
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
619
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
620
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
621
+ # Deserialize Response
622
+ if status_code == 200
623
+ begin
624
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
625
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
626
+ result.body = @client.deserialize(result_mapper, parsed_response)
627
+ rescue Exception => e
628
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
629
+ end
630
+ end
631
+ # Deserialize Response
632
+ if status_code == 201
633
+ begin
634
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
635
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
636
+ result.body = @client.deserialize(result_mapper, parsed_response)
637
+ rescue Exception => e
638
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
639
+ end
640
+ end
641
+
642
+ result
643
+ end
644
+
645
+ promise.execute
646
+ end
647
+
648
+ #
649
+ # Delete a system topic.
650
+ #
651
+ # Delete existing system topic.
652
+ #
653
+ # @param resource_group_name [String] The name of the resource group within the
654
+ # user's subscription.
655
+ # @param system_topic_name [String] Name of the system topic.
656
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
657
+ # will be added to the HTTP request.
658
+ #
659
+ #
660
+ def begin_delete(resource_group_name, system_topic_name, custom_headers:nil)
661
+ response = begin_delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value!
662
+ nil
663
+ end
664
+
665
+ #
666
+ # Delete a system topic.
667
+ #
668
+ # Delete existing system topic.
669
+ #
670
+ # @param resource_group_name [String] The name of the resource group within the
671
+ # user's subscription.
672
+ # @param system_topic_name [String] Name of the system topic.
673
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
674
+ # will be added to the HTTP request.
675
+ #
676
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
677
+ #
678
+ def begin_delete_with_http_info(resource_group_name, system_topic_name, custom_headers:nil)
679
+ begin_delete_async(resource_group_name, system_topic_name, custom_headers:custom_headers).value!
680
+ end
681
+
682
+ #
683
+ # Delete a system topic.
684
+ #
685
+ # Delete existing system topic.
686
+ #
687
+ # @param resource_group_name [String] The name of the resource group within the
688
+ # user's subscription.
689
+ # @param system_topic_name [String] Name of the system topic.
690
+ # @param [Hash{String => String}] A hash of custom headers that will be added
691
+ # to the HTTP request.
692
+ #
693
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
694
+ #
695
+ def begin_delete_async(resource_group_name, system_topic_name, custom_headers:nil)
696
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
697
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
698
+ fail ArgumentError, 'system_topic_name is nil' if system_topic_name.nil?
699
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
700
+
701
+
702
+ request_headers = {}
703
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
704
+
705
+ # Set Headers
706
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
707
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
708
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'
709
+
710
+ request_url = @base_url || @client.base_url
711
+
712
+ options = {
713
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
714
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'systemTopicName' => system_topic_name},
715
+ query_params: {'api-version' => @client.api_version},
716
+ headers: request_headers.merge(custom_headers || {}),
717
+ base_url: request_url
718
+ }
719
+ promise = @client.make_request_async(:delete, path_template, options)
720
+
721
+ promise = promise.then do |result|
722
+ http_response = result.response
723
+ status_code = http_response.status
724
+ response_content = http_response.body
725
+ unless status_code == 200 || status_code == 202 || status_code == 204
726
+ error_model = JSON.load(response_content)
727
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
728
+ end
729
+
730
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
731
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
732
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
733
+
734
+ result
735
+ end
736
+
737
+ promise.execute
738
+ end
739
+
740
+ #
741
+ # Update a system topic.
742
+ #
743
+ # Asynchronously updates a system topic with the specified parameters.
744
+ #
745
+ # @param resource_group_name [String] The name of the resource group within the
746
+ # user's subscription.
747
+ # @param system_topic_name [String] Name of the system topic.
748
+ # @param system_topic_update_parameters [SystemTopicUpdateParameters]
749
+ # SystemTopic update information.
750
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
751
+ # will be added to the HTTP request.
752
+ #
753
+ # @return [SystemTopic] operation results.
754
+ #
755
+ def begin_update(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil)
756
+ response = begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers).value!
757
+ response.body unless response.nil?
758
+ end
759
+
760
+ #
761
+ # Update a system topic.
762
+ #
763
+ # Asynchronously updates a system topic with the specified parameters.
764
+ #
765
+ # @param resource_group_name [String] The name of the resource group within the
766
+ # user's subscription.
767
+ # @param system_topic_name [String] Name of the system topic.
768
+ # @param system_topic_update_parameters [SystemTopicUpdateParameters]
769
+ # SystemTopic update information.
770
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
771
+ # will be added to the HTTP request.
772
+ #
773
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
774
+ #
775
+ def begin_update_with_http_info(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil)
776
+ begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:custom_headers).value!
777
+ end
778
+
779
+ #
780
+ # Update a system topic.
781
+ #
782
+ # Asynchronously updates a system topic with the specified parameters.
783
+ #
784
+ # @param resource_group_name [String] The name of the resource group within the
785
+ # user's subscription.
786
+ # @param system_topic_name [String] Name of the system topic.
787
+ # @param system_topic_update_parameters [SystemTopicUpdateParameters]
788
+ # SystemTopic update information.
789
+ # @param [Hash{String => String}] A hash of custom headers that will be added
790
+ # to the HTTP request.
791
+ #
792
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
793
+ #
794
+ def begin_update_async(resource_group_name, system_topic_name, system_topic_update_parameters, custom_headers:nil)
795
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
796
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
797
+ fail ArgumentError, 'system_topic_name is nil' if system_topic_name.nil?
798
+ fail ArgumentError, 'system_topic_update_parameters is nil' if system_topic_update_parameters.nil?
799
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
800
+
801
+
802
+ request_headers = {}
803
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
804
+
805
+ # Set Headers
806
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
807
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
808
+
809
+ # Serialize Request
810
+ request_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicUpdateParameters.mapper()
811
+ request_content = @client.serialize(request_mapper, system_topic_update_parameters)
812
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
813
+
814
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/systemTopics/{systemTopicName}'
815
+
816
+ request_url = @base_url || @client.base_url
817
+
818
+ options = {
819
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
820
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'systemTopicName' => system_topic_name},
821
+ query_params: {'api-version' => @client.api_version},
822
+ body: request_content,
823
+ headers: request_headers.merge(custom_headers || {}),
824
+ base_url: request_url
825
+ }
826
+ promise = @client.make_request_async(:patch, path_template, options)
827
+
828
+ promise = promise.then do |result|
829
+ http_response = result.response
830
+ status_code = http_response.status
831
+ response_content = http_response.body
832
+ unless status_code == 200 || status_code == 201
833
+ error_model = JSON.load(response_content)
834
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
835
+ end
836
+
837
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
838
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
839
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
840
+ # Deserialize Response
841
+ if status_code == 200
842
+ begin
843
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
844
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
845
+ result.body = @client.deserialize(result_mapper, parsed_response)
846
+ rescue Exception => e
847
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
848
+ end
849
+ end
850
+ # Deserialize Response
851
+ if status_code == 201
852
+ begin
853
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
854
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopic.mapper()
855
+ result.body = @client.deserialize(result_mapper, parsed_response)
856
+ rescue Exception => e
857
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
858
+ end
859
+ end
860
+
861
+ result
862
+ end
863
+
864
+ promise.execute
865
+ end
866
+
867
+ #
868
+ # List system topics under an Azure subscription.
869
+ #
870
+ # List all the system topics under an Azure subscription.
871
+ #
872
+ # @param next_page_link [String] The NextLink from the previous successful call
873
+ # to List operation.
874
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
875
+ # will be added to the HTTP request.
876
+ #
877
+ # @return [SystemTopicsListResult] operation results.
878
+ #
879
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
880
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
881
+ response.body unless response.nil?
882
+ end
883
+
884
+ #
885
+ # List system topics under an Azure subscription.
886
+ #
887
+ # List all the system topics under an Azure subscription.
888
+ #
889
+ # @param next_page_link [String] The NextLink from the previous successful call
890
+ # to List operation.
891
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
892
+ # will be added to the HTTP request.
893
+ #
894
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
895
+ #
896
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
897
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
898
+ end
899
+
900
+ #
901
+ # List system topics under an Azure subscription.
902
+ #
903
+ # List all the system topics under an Azure subscription.
904
+ #
905
+ # @param next_page_link [String] The NextLink from the previous successful call
906
+ # to List operation.
907
+ # @param [Hash{String => String}] A hash of custom headers that will be added
908
+ # to the HTTP request.
909
+ #
910
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
911
+ #
912
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
913
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
914
+
915
+
916
+ request_headers = {}
917
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
918
+
919
+ # Set Headers
920
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
921
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
922
+ path_template = '{nextLink}'
923
+
924
+ request_url = @base_url || @client.base_url
925
+
926
+ options = {
927
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
928
+ skip_encoding_path_params: {'nextLink' => next_page_link},
929
+ headers: request_headers.merge(custom_headers || {}),
930
+ base_url: request_url
931
+ }
932
+ promise = @client.make_request_async(:get, path_template, options)
933
+
934
+ promise = promise.then do |result|
935
+ http_response = result.response
936
+ status_code = http_response.status
937
+ response_content = http_response.body
938
+ unless status_code == 200
939
+ error_model = JSON.load(response_content)
940
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
941
+ end
942
+
943
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
944
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
945
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
946
+ # Deserialize Response
947
+ if status_code == 200
948
+ begin
949
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
950
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult.mapper()
951
+ result.body = @client.deserialize(result_mapper, parsed_response)
952
+ rescue Exception => e
953
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
954
+ end
955
+ end
956
+
957
+ result
958
+ end
959
+
960
+ promise.execute
961
+ end
962
+
963
+ #
964
+ # List system topics under a resource group.
965
+ #
966
+ # List all the system topics under a resource group.
967
+ #
968
+ # @param next_page_link [String] The NextLink from the previous successful call
969
+ # to List operation.
970
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
971
+ # will be added to the HTTP request.
972
+ #
973
+ # @return [SystemTopicsListResult] operation results.
974
+ #
975
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
976
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
977
+ response.body unless response.nil?
978
+ end
979
+
980
+ #
981
+ # List system topics under a resource group.
982
+ #
983
+ # List all the system topics under a resource group.
984
+ #
985
+ # @param next_page_link [String] The NextLink from the previous successful call
986
+ # to List operation.
987
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
988
+ # will be added to the HTTP request.
989
+ #
990
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
991
+ #
992
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
993
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
994
+ end
995
+
996
+ #
997
+ # List system topics under a resource group.
998
+ #
999
+ # List all the system topics under a resource group.
1000
+ #
1001
+ # @param next_page_link [String] The NextLink from the previous successful call
1002
+ # to List operation.
1003
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1004
+ # to the HTTP request.
1005
+ #
1006
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1007
+ #
1008
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1009
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1010
+
1011
+
1012
+ request_headers = {}
1013
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1014
+
1015
+ # Set Headers
1016
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1017
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1018
+ path_template = '{nextLink}'
1019
+
1020
+ request_url = @base_url || @client.base_url
1021
+
1022
+ options = {
1023
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1024
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1025
+ headers: request_headers.merge(custom_headers || {}),
1026
+ base_url: request_url
1027
+ }
1028
+ promise = @client.make_request_async(:get, path_template, options)
1029
+
1030
+ promise = promise.then do |result|
1031
+ http_response = result.response
1032
+ status_code = http_response.status
1033
+ response_content = http_response.body
1034
+ unless status_code == 200
1035
+ error_model = JSON.load(response_content)
1036
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1037
+ end
1038
+
1039
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1040
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1041
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1042
+ # Deserialize Response
1043
+ if status_code == 200
1044
+ begin
1045
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1046
+ result_mapper = Azure::EventGrid::Mgmt::V2020_10_15_preview::Models::SystemTopicsListResult.mapper()
1047
+ result.body = @client.deserialize(result_mapper, parsed_response)
1048
+ rescue Exception => e
1049
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1050
+ end
1051
+ end
1052
+
1053
+ result
1054
+ end
1055
+
1056
+ promise.execute
1057
+ end
1058
+
1059
+ #
1060
+ # List system topics under an Azure subscription.
1061
+ #
1062
+ # List all the system topics under an Azure subscription.
1063
+ #
1064
+ # @param filter [String] The query used to filter the search results using
1065
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1066
+ # limited number of OData operations. These operations are: the 'contains'
1067
+ # function as well as the following logical operations: not, and, or, eq (for
1068
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1069
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1070
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1071
+ # $filter=location eq 'westus'.
1072
+ # @param top [Integer] The number of results to return per page for the list
1073
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1074
+ # default number of results to be returned is 20 items per page.
1075
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1076
+ # will be added to the HTTP request.
1077
+ #
1078
+ # @return [SystemTopicsListResult] which provide lazy access to pages of the
1079
+ # response.
1080
+ #
1081
+ def list_by_subscription_as_lazy(filter:nil, top:nil, custom_headers:nil)
1082
+ response = list_by_subscription_async(filter:filter, top:top, custom_headers:custom_headers).value!
1083
+ unless response.nil?
1084
+ page = response.body
1085
+ page.next_method = Proc.new do |next_page_link|
1086
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1087
+ end
1088
+ page
1089
+ end
1090
+ end
1091
+
1092
+ #
1093
+ # List system topics under a resource group.
1094
+ #
1095
+ # List all the system topics under a resource group.
1096
+ #
1097
+ # @param resource_group_name [String] The name of the resource group within the
1098
+ # user's subscription.
1099
+ # @param filter [String] The query used to filter the search results using
1100
+ # OData syntax. Filtering is permitted on the 'name' property only and with
1101
+ # limited number of OData operations. These operations are: the 'contains'
1102
+ # function as well as the following logical operations: not, and, or, eq (for
1103
+ # equal), and ne (for not equal). No arithmetic operations are supported. The
1104
+ # following is a valid filter example: $filter=contains(namE, 'PATTERN') and
1105
+ # name ne 'PATTERN-1'. The following is not a valid filter example:
1106
+ # $filter=location eq 'westus'.
1107
+ # @param top [Integer] The number of results to return per page for the list
1108
+ # operation. Valid range for top parameter is 1 to 100. If not specified, the
1109
+ # default number of results to be returned is 20 items per page.
1110
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1111
+ # will be added to the HTTP request.
1112
+ #
1113
+ # @return [SystemTopicsListResult] which provide lazy access to pages of the
1114
+ # response.
1115
+ #
1116
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1117
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
1118
+ unless response.nil?
1119
+ page = response.body
1120
+ page.next_method = Proc.new do |next_page_link|
1121
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1122
+ end
1123
+ page
1124
+ end
1125
+ end
1126
+
1127
+ end
1128
+ end