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