azure_mgmt_resource_health 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-01-01/generated/azure_mgmt_resource_health.rb +45 -0
  4. data/lib/2015-01-01/generated/azure_mgmt_resource_health/availability_statuses.rb +856 -0
  5. data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
  6. data/lib/2015-01-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
  7. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
  8. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  9. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  10. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +212 -0
  11. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
  12. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  13. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  14. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  15. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  16. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  17. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  18. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  19. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  20. data/lib/2015-01-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  21. data/lib/2015-01-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  22. data/lib/2015-01-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  23. data/lib/2015-01-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
  24. data/lib/2017-07-01/generated/azure_mgmt_resource_health.rb +45 -0
  25. data/lib/2017-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +863 -0
  26. data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb +384 -0
  27. data/lib/2017-07-01/generated/azure_mgmt_resource_health/child_resources.rb +271 -0
  28. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +17 -0
  29. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  30. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  31. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +253 -0
  32. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb +73 -0
  33. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  34. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  35. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  36. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  37. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  38. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  39. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  40. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  41. data/lib/2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  42. data/lib/2017-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  43. data/lib/2017-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  44. data/lib/2017-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +145 -0
  45. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health.rb +74 -0
  46. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
  47. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
  48. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/impacted_resources.rb +240 -0
  49. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/metadata.rb +318 -0
  50. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
  51. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  52. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  53. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
  54. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
  55. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
  56. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  57. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event.rb +336 -0
  58. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
  59. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
  60. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
  61. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
  62. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
  63. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
  64. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
  65. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/events.rb +99 -0
  66. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
  67. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
  68. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_list_result.rb +100 -0
  69. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_resource_status.rb +123 -0
  70. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
  71. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
  72. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link.rb +95 -0
  73. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
  74. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
  75. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
  76. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +98 -0
  77. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
  78. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  79. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  80. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  81. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
  82. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  83. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/reason_type_values.rb +17 -0
  84. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  85. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
  86. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
  87. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  88. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  89. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  90. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
  91. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/models/update.rb +59 -0
  92. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  93. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/operations.rb +109 -0
  94. data/lib/2018-07-01-preview/generated/azure_mgmt_resource_health/resource_health_client.rb +152 -0
  95. data/lib/2018-07-01/generated/azure_mgmt_resource_health.rb +69 -0
  96. data/lib/2018-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb +842 -0
  97. data/lib/2018-07-01/generated/azure_mgmt_resource_health/events_operations.rb +463 -0
  98. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb +18 -0
  99. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb +93 -0
  100. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb +100 -0
  101. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb +251 -0
  102. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved.rb +73 -0
  103. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/azure_entity_resource.rb +75 -0
  104. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/error_response.rb +71 -0
  105. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event.rb +336 -0
  106. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_level_values.rb +17 -0
  107. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_article.rb +46 -0
  108. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions.rb +79 -0
  109. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_properties_recommended_actions_actions_item.rb +59 -0
  110. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_source_values.rb +16 -0
  111. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_status_values.rb +16 -0
  112. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/event_type_values.rb +18 -0
  113. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/events.rb +99 -0
  114. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/faq.rb +68 -0
  115. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impact.rb +67 -0
  116. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/impacted_service_region.rb +110 -0
  117. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/level_values.rb +16 -0
  118. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link.rb +95 -0
  119. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_display_text.rb +57 -0
  120. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/link_type_values.rb +16 -0
  121. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity.rb +134 -0
  122. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_entity_list_result.rb +66 -0
  123. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/metadata_supported_value_detail.rb +57 -0
  124. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation.rb +58 -0
  125. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb +79 -0
  126. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb +56 -0
  127. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/proxy_resource.rb +63 -0
  128. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb +16 -0
  129. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb +70 -0
  130. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/resource.rb +83 -0
  131. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/scenario.rb +15 -0
  132. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb +95 -0
  133. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb +79 -0
  134. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb +46 -0
  135. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/tracked_resource.rb +92 -0
  136. data/lib/2018-07-01/generated/azure_mgmt_resource_health/models/update.rb +59 -0
  137. data/lib/2018-07-01/generated/azure_mgmt_resource_health/module_definition.rb +9 -0
  138. data/lib/2018-07-01/generated/azure_mgmt_resource_health/operations.rb +109 -0
  139. data/lib/2018-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb +147 -0
  140. data/lib/azure_mgmt_resource_health.rb +9 -0
  141. data/lib/module_definition.rb +7 -0
  142. data/lib/profiles/latest/modules/resourcehealth_profile_module.rb +123 -0
  143. data/lib/profiles/latest/resourcehealth_latest_profile_client.rb +40 -0
  144. data/lib/profiles/latest/resourcehealth_module_definition.rb +8 -0
  145. data/lib/version.rb +7 -0
  146. metadata +261 -0
@@ -0,0 +1,79 @@
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::ResourceHealth::Mgmt::V2015_01_01
7
+ module Models
8
+ #
9
+ # Properties of the service impacting event.
10
+ #
11
+ class ServiceImpactingEventIncidentProperties
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Title of the incident.
16
+ attr_accessor :title
17
+
18
+ # @return [String] Service impacted by the event.
19
+ attr_accessor :service
20
+
21
+ # @return [String] Region impacted by the event.
22
+ attr_accessor :region
23
+
24
+ # @return [String] Type of Event.
25
+ attr_accessor :incident_type
26
+
27
+
28
+ #
29
+ # Mapper for ServiceImpactingEventIncidentProperties class as Ruby Hash.
30
+ # This will be used for serialization/deserialization.
31
+ #
32
+ def self.mapper()
33
+ {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'serviceImpactingEvent_incidentProperties',
37
+ type: {
38
+ name: 'Composite',
39
+ class_name: 'ServiceImpactingEventIncidentProperties',
40
+ model_properties: {
41
+ title: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'title',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ service: {
50
+ client_side_validation: true,
51
+ required: false,
52
+ serialized_name: 'service',
53
+ type: {
54
+ name: 'String'
55
+ }
56
+ },
57
+ region: {
58
+ client_side_validation: true,
59
+ required: false,
60
+ serialized_name: 'region',
61
+ type: {
62
+ name: 'String'
63
+ }
64
+ },
65
+ incident_type: {
66
+ client_side_validation: true,
67
+ required: false,
68
+ serialized_name: 'incidentType',
69
+ type: {
70
+ name: 'String'
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,46 @@
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::ResourceHealth::Mgmt::V2015_01_01
7
+ module Models
8
+ #
9
+ # Status of the service impacting event.
10
+ #
11
+ class ServiceImpactingEventStatus
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Current status of the event
16
+ attr_accessor :value
17
+
18
+
19
+ #
20
+ # Mapper for ServiceImpactingEventStatus class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'serviceImpactingEvent_status',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'ServiceImpactingEventStatus',
31
+ model_properties: {
32
+ value: {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'value',
36
+ type: {
37
+ name: 'String'
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::ResourceHealth end
8
+ module Azure::ResourceHealth::Mgmt end
9
+ module Azure::ResourceHealth::Mgmt::V2015_01_01 end
@@ -0,0 +1,109 @@
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::ResourceHealth::Mgmt::V2015_01_01
7
+ #
8
+ # The Resource Health Client.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceHealthClient] reference to the ResourceHealthClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists available operations for the resourcehealth resource provider
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [OperationListResult] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists available operations for the resourcehealth resource provider
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists available operations for the resourcehealth resource provider
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.ResourceHealth/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::ResourceHealth::Mgmt::V2015_01_01::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ end
109
+ end
@@ -0,0 +1,145 @@
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::ResourceHealth::Mgmt::V2015_01_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ResourceHealthClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [AvailabilityStatuses] availability_statuses
41
+ attr_reader :availability_statuses
42
+
43
+ # @return [ChildAvailabilityStatuses] child_availability_statuses
44
+ attr_reader :child_availability_statuses
45
+
46
+ # @return [ChildResources] child_resources
47
+ attr_reader :child_resources
48
+
49
+ # @return [Operations] operations
50
+ attr_reader :operations
51
+
52
+ #
53
+ # Creates initializes a new instance of the ResourceHealthClient class.
54
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
55
+ # @param base_url [String] the base URI of the service.
56
+ # @param options [Array] filters to be applied to the HTTP requests.
57
+ #
58
+ def initialize(credentials = nil, base_url = nil, options = nil)
59
+ super(credentials, options)
60
+ @base_url = base_url || 'https://management.azure.com'
61
+
62
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
63
+ @credentials = credentials
64
+
65
+ @availability_statuses = AvailabilityStatuses.new(self)
66
+ @child_availability_statuses = ChildAvailabilityStatuses.new(self)
67
+ @child_resources = ChildResources.new(self)
68
+ @operations = Operations.new(self)
69
+ @api_version = '2015-01-01'
70
+ @accept_language = 'en-US'
71
+ @long_running_operation_retry_timeout = 30
72
+ @generate_client_request_id = true
73
+ add_telemetry
74
+ end
75
+
76
+ #
77
+ # Makes a request and returns the body of the response.
78
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
79
+ # @param path [String] the path, relative to {base_url}.
80
+ # @param options [Hash{String=>String}] specifying any request options like :body.
81
+ # @return [Hash{String=>String}] containing the body of the response.
82
+ # Example:
83
+ #
84
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
85
+ # path = "/path"
86
+ # options = {
87
+ # body: request_content,
88
+ # query_params: {'api-version' => '2016-02-01'}
89
+ # }
90
+ # result = @client.make_request(:put, path, options)
91
+ #
92
+ def make_request(method, path, options = {})
93
+ result = make_request_with_http_info(method, path, options)
94
+ result.body unless result.nil?
95
+ end
96
+
97
+ #
98
+ # Makes a request and returns the operation response.
99
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
100
+ # @param path [String] the path, relative to {base_url}.
101
+ # @param options [Hash{String=>String}] specifying any request options like :body.
102
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
103
+ #
104
+ def make_request_with_http_info(method, path, options = {})
105
+ result = make_request_async(method, path, options).value!
106
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
107
+ result
108
+ end
109
+
110
+ #
111
+ # Makes a request asynchronously.
112
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
113
+ # @param path [String] the path, relative to {base_url}.
114
+ # @param options [Hash{String=>String}] specifying any request options like :body.
115
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
116
+ #
117
+ def make_request_async(method, path, options = {})
118
+ fail ArgumentError, 'method is nil' if method.nil?
119
+ fail ArgumentError, 'path is nil' if path.nil?
120
+
121
+ request_url = options[:base_url] || @base_url
122
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
123
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
124
+ end
125
+
126
+ request_headers = @request_headers
127
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
128
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
129
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
130
+
131
+ super(request_url, method, path, options)
132
+ end
133
+
134
+
135
+ private
136
+ #
137
+ # Adds telemetry information.
138
+ #
139
+ def add_telemetry
140
+ sdk_information = 'azure_mgmt_resource_health'
141
+ sdk_information = "#{sdk_information}/0.17.0"
142
+ add_user_agent_information(sdk_information)
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,45 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-07-01/generated/azure_mgmt_resource_health/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ResourceHealth::Mgmt::V2017_07_01
23
+ autoload :AvailabilityStatuses, '2017-07-01/generated/azure_mgmt_resource_health/availability_statuses.rb'
24
+ autoload :ChildAvailabilityStatuses, '2017-07-01/generated/azure_mgmt_resource_health/child_availability_statuses.rb'
25
+ autoload :ChildResources, '2017-07-01/generated/azure_mgmt_resource_health/child_resources.rb'
26
+ autoload :Operations, '2017-07-01/generated/azure_mgmt_resource_health/operations.rb'
27
+ autoload :ResourceHealthClient, '2017-07-01/generated/azure_mgmt_resource_health/resource_health_client.rb'
28
+
29
+ module Models
30
+ autoload :AvailabilityStatus, '2017-07-01/generated/azure_mgmt_resource_health/models/availability_status.rb'
31
+ autoload :AvailabilityStatusPropertiesRecentlyResolvedState, '2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties_recently_resolved_state.rb'
32
+ autoload :AvailabilityStatusListResult, '2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_list_result.rb'
33
+ autoload :ServiceImpactingEventStatus, '2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_status.rb'
34
+ autoload :OperationDisplay, '2017-07-01/generated/azure_mgmt_resource_health/models/operation_display.rb'
35
+ autoload :ServiceImpactingEvent, '2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event.rb'
36
+ autoload :Operation, '2017-07-01/generated/azure_mgmt_resource_health/models/operation.rb'
37
+ autoload :RecommendedAction, '2017-07-01/generated/azure_mgmt_resource_health/models/recommended_action.rb'
38
+ autoload :OperationListResult, '2017-07-01/generated/azure_mgmt_resource_health/models/operation_list_result.rb'
39
+ autoload :AvailabilityStatusProperties, '2017-07-01/generated/azure_mgmt_resource_health/models/availability_status_properties.rb'
40
+ autoload :ErrorResponse, '2017-07-01/generated/azure_mgmt_resource_health/models/error_response.rb'
41
+ autoload :ServiceImpactingEventIncidentProperties, '2017-07-01/generated/azure_mgmt_resource_health/models/service_impacting_event_incident_properties.rb'
42
+ autoload :AvailabilityStateValues, '2017-07-01/generated/azure_mgmt_resource_health/models/availability_state_values.rb'
43
+ autoload :ReasonChronicityTypes, '2017-07-01/generated/azure_mgmt_resource_health/models/reason_chronicity_types.rb'
44
+ end
45
+ end
@@ -0,0 +1,863 @@
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::ResourceHealth::Mgmt::V2017_07_01
7
+ #
8
+ # The Resource Health Client.
9
+ #
10
+ class AvailabilityStatuses
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AvailabilityStatuses class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceHealthClient] reference to the ResourceHealthClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the current availability status for all the resources in the
26
+ # subscription. Use the nextLink property in the response to get the next page
27
+ # of availability statuses.
28
+ #
29
+ # @param filter [String] The filter to apply on the operation. For more
30
+ # information please see
31
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
32
+ # @param expand [String] Setting $expand=recommendedactions in url query
33
+ # expands the recommendedactions in the response.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [Array<AvailabilityStatus>] operation results.
38
+ #
39
+ def list_by_subscription_id(filter:nil, expand:nil, custom_headers:nil)
40
+ first_page = list_by_subscription_id_as_lazy(filter:filter, expand:expand, custom_headers:custom_headers)
41
+ first_page.get_all_items
42
+ end
43
+
44
+ #
45
+ # Lists the current availability status for all the resources in the
46
+ # subscription. Use the nextLink property in the response to get the next page
47
+ # of availability statuses.
48
+ #
49
+ # @param filter [String] The filter to apply on the operation. For more
50
+ # information please see
51
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
52
+ # @param expand [String] Setting $expand=recommendedactions in url query
53
+ # expands the recommendedactions in the response.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_by_subscription_id_with_http_info(filter:nil, expand:nil, custom_headers:nil)
60
+ list_by_subscription_id_async(filter:filter, expand:expand, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Lists the current availability status for all the resources in the
65
+ # subscription. Use the nextLink property in the response to get the next page
66
+ # of availability statuses.
67
+ #
68
+ # @param filter [String] The filter to apply on the operation. For more
69
+ # information please see
70
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
71
+ # @param expand [String] Setting $expand=recommendedactions in url query
72
+ # expands the recommendedactions in the response.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def list_by_subscription_id_async(filter:nil, expand:nil, custom_headers:nil)
79
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
80
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/availabilityStatuses'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id},
96
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 200
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
119
+ result.body = @client.deserialize(result_mapper, parsed_response)
120
+ rescue Exception => e
121
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
122
+ end
123
+ end
124
+
125
+ result
126
+ end
127
+
128
+ promise.execute
129
+ end
130
+
131
+ #
132
+ # Lists the current availability status for all the resources in the resource
133
+ # group. Use the nextLink property in the response to get the next page of
134
+ # availability statuses.
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group.
137
+ # @param filter [String] The filter to apply on the operation. For more
138
+ # information please see
139
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
140
+ # @param expand [String] Setting $expand=recommendedactions in url query
141
+ # expands the recommendedactions in the response.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [Array<AvailabilityStatus>] operation results.
146
+ #
147
+ def list_by_resource_group(resource_group_name, filter:nil, expand:nil, custom_headers:nil)
148
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, expand:expand, custom_headers:custom_headers)
149
+ first_page.get_all_items
150
+ end
151
+
152
+ #
153
+ # Lists the current availability status for all the resources in the resource
154
+ # group. Use the nextLink property in the response to get the next page of
155
+ # availability statuses.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group.
158
+ # @param filter [String] The filter to apply on the operation. For more
159
+ # information please see
160
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
161
+ # @param expand [String] Setting $expand=recommendedactions in url query
162
+ # expands the recommendedactions in the response.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
167
+ #
168
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, expand:nil, custom_headers:nil)
169
+ list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, custom_headers:custom_headers).value!
170
+ end
171
+
172
+ #
173
+ # Lists the current availability status for all the resources in the resource
174
+ # group. Use the nextLink property in the response to get the next page of
175
+ # availability statuses.
176
+ #
177
+ # @param resource_group_name [String] The name of the resource group.
178
+ # @param filter [String] The filter to apply on the operation. For more
179
+ # information please see
180
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
181
+ # @param expand [String] Setting $expand=recommendedactions in url query
182
+ # expands the recommendedactions in the response.
183
+ # @param [Hash{String => String}] A hash of custom headers that will be added
184
+ # to the HTTP request.
185
+ #
186
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
187
+ #
188
+ def list_by_resource_group_async(resource_group_name, filter:nil, expand:nil, custom_headers:nil)
189
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
190
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
191
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
192
+
193
+
194
+ request_headers = {}
195
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
196
+
197
+ # Set Headers
198
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
199
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
200
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceHealth/availabilityStatuses'
201
+
202
+ request_url = @base_url || @client.base_url
203
+
204
+ options = {
205
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
206
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
207
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
208
+ headers: request_headers.merge(custom_headers || {}),
209
+ base_url: request_url
210
+ }
211
+ promise = @client.make_request_async(:get, path_template, options)
212
+
213
+ promise = promise.then do |result|
214
+ http_response = result.response
215
+ status_code = http_response.status
216
+ response_content = http_response.body
217
+ unless status_code == 200
218
+ error_model = JSON.load(response_content)
219
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
220
+ end
221
+
222
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
223
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
224
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
225
+ # Deserialize Response
226
+ if status_code == 200
227
+ begin
228
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
229
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
230
+ result.body = @client.deserialize(result_mapper, parsed_response)
231
+ rescue Exception => e
232
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
233
+ end
234
+ end
235
+
236
+ result
237
+ end
238
+
239
+ promise.execute
240
+ end
241
+
242
+ #
243
+ # Gets current availability status for a single resource
244
+ #
245
+ # @param resource_uri [String] The fully qualified ID of the resource,
246
+ # including the resource name and resource type. Currently the API support not
247
+ # nested and one nesting level resource types :
248
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
249
+ # and
250
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
251
+ # @param filter [String] The filter to apply on the operation. For more
252
+ # information please see
253
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
254
+ # @param expand [String] Setting $expand=recommendedactions in url query
255
+ # expands the recommendedactions in the response.
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [AvailabilityStatus] operation results.
260
+ #
261
+ def get_by_resource(resource_uri, filter:nil, expand:nil, custom_headers:nil)
262
+ response = get_by_resource_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
263
+ response.body unless response.nil?
264
+ end
265
+
266
+ #
267
+ # Gets current availability status for a single resource
268
+ #
269
+ # @param resource_uri [String] The fully qualified ID of the resource,
270
+ # including the resource name and resource type. Currently the API support not
271
+ # nested and one nesting level resource types :
272
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
273
+ # and
274
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
275
+ # @param filter [String] The filter to apply on the operation. For more
276
+ # information please see
277
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
278
+ # @param expand [String] Setting $expand=recommendedactions in url query
279
+ # expands the recommendedactions in the response.
280
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
281
+ # will be added to the HTTP request.
282
+ #
283
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
284
+ #
285
+ def get_by_resource_with_http_info(resource_uri, filter:nil, expand:nil, custom_headers:nil)
286
+ get_by_resource_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
287
+ end
288
+
289
+ #
290
+ # Gets current availability status for a single resource
291
+ #
292
+ # @param resource_uri [String] The fully qualified ID of the resource,
293
+ # including the resource name and resource type. Currently the API support not
294
+ # nested and one nesting level resource types :
295
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
296
+ # and
297
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
298
+ # @param filter [String] The filter to apply on the operation. For more
299
+ # information please see
300
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
301
+ # @param expand [String] Setting $expand=recommendedactions in url query
302
+ # expands the recommendedactions in the response.
303
+ # @param [Hash{String => String}] A hash of custom headers that will be added
304
+ # to the HTTP request.
305
+ #
306
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
307
+ #
308
+ def get_by_resource_async(resource_uri, filter:nil, expand:nil, custom_headers:nil)
309
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
310
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
311
+
312
+
313
+ request_headers = {}
314
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
315
+
316
+ # Set Headers
317
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
318
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
319
+ path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses/current'
320
+
321
+ request_url = @base_url || @client.base_url
322
+
323
+ options = {
324
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
325
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
326
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
327
+ headers: request_headers.merge(custom_headers || {}),
328
+ base_url: request_url
329
+ }
330
+ promise = @client.make_request_async(:get, path_template, options)
331
+
332
+ promise = promise.then do |result|
333
+ http_response = result.response
334
+ status_code = http_response.status
335
+ response_content = http_response.body
336
+ unless status_code == 200
337
+ error_model = JSON.load(response_content)
338
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
339
+ end
340
+
341
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
342
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
343
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
344
+ # Deserialize Response
345
+ if status_code == 200
346
+ begin
347
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
348
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatus.mapper()
349
+ result.body = @client.deserialize(result_mapper, parsed_response)
350
+ rescue Exception => e
351
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
352
+ end
353
+ end
354
+
355
+ result
356
+ end
357
+
358
+ promise.execute
359
+ end
360
+
361
+ #
362
+ # Lists all historical availability transitions and impacting events for a
363
+ # single resource. Use the nextLink property in the response to get the next
364
+ # page of availability status
365
+ #
366
+ # @param resource_uri [String] The fully qualified ID of the resource,
367
+ # including the resource name and resource type. Currently the API support not
368
+ # nested and one nesting level resource types :
369
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
370
+ # and
371
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
372
+ # @param filter [String] The filter to apply on the operation. For more
373
+ # information please see
374
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
375
+ # @param expand [String] Setting $expand=recommendedactions in url query
376
+ # expands the recommendedactions in the response.
377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
378
+ # will be added to the HTTP request.
379
+ #
380
+ # @return [Array<AvailabilityStatus>] operation results.
381
+ #
382
+ def list(resource_uri, filter:nil, expand:nil, custom_headers:nil)
383
+ first_page = list_as_lazy(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers)
384
+ first_page.get_all_items
385
+ end
386
+
387
+ #
388
+ # Lists all historical availability transitions and impacting events for a
389
+ # single resource. Use the nextLink property in the response to get the next
390
+ # page of availability status
391
+ #
392
+ # @param resource_uri [String] The fully qualified ID of the resource,
393
+ # including the resource name and resource type. Currently the API support not
394
+ # nested and one nesting level resource types :
395
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
396
+ # and
397
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
398
+ # @param filter [String] The filter to apply on the operation. For more
399
+ # information please see
400
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
401
+ # @param expand [String] Setting $expand=recommendedactions in url query
402
+ # expands the recommendedactions in the response.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
407
+ #
408
+ def list_with_http_info(resource_uri, filter:nil, expand:nil, custom_headers:nil)
409
+ list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
410
+ end
411
+
412
+ #
413
+ # Lists all historical availability transitions and impacting events for a
414
+ # single resource. Use the nextLink property in the response to get the next
415
+ # page of availability status
416
+ #
417
+ # @param resource_uri [String] The fully qualified ID of the resource,
418
+ # including the resource name and resource type. Currently the API support not
419
+ # nested and one nesting level resource types :
420
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
421
+ # and
422
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
423
+ # @param filter [String] The filter to apply on the operation. For more
424
+ # information please see
425
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
426
+ # @param expand [String] Setting $expand=recommendedactions in url query
427
+ # expands the recommendedactions in the response.
428
+ # @param [Hash{String => String}] A hash of custom headers that will be added
429
+ # to the HTTP request.
430
+ #
431
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
432
+ #
433
+ def list_async(resource_uri, filter:nil, expand:nil, custom_headers:nil)
434
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
435
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
436
+
437
+
438
+ request_headers = {}
439
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
440
+
441
+ # Set Headers
442
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
443
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
444
+ path_template = '{resourceUri}/providers/Microsoft.ResourceHealth/availabilityStatuses'
445
+
446
+ request_url = @base_url || @client.base_url
447
+
448
+ options = {
449
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
450
+ skip_encoding_path_params: {'resourceUri' => resource_uri},
451
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand},
452
+ headers: request_headers.merge(custom_headers || {}),
453
+ base_url: request_url
454
+ }
455
+ promise = @client.make_request_async(:get, path_template, options)
456
+
457
+ promise = promise.then do |result|
458
+ http_response = result.response
459
+ status_code = http_response.status
460
+ response_content = http_response.body
461
+ unless status_code == 200
462
+ error_model = JSON.load(response_content)
463
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
464
+ end
465
+
466
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
467
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
468
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
469
+ # Deserialize Response
470
+ if status_code == 200
471
+ begin
472
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
473
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
474
+ result.body = @client.deserialize(result_mapper, parsed_response)
475
+ rescue Exception => e
476
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
477
+ end
478
+ end
479
+
480
+ result
481
+ end
482
+
483
+ promise.execute
484
+ end
485
+
486
+ #
487
+ # Lists the current availability status for all the resources in the
488
+ # subscription. Use the nextLink property in the response to get the next page
489
+ # of availability statuses.
490
+ #
491
+ # @param next_page_link [String] The NextLink from the previous successful call
492
+ # to List operation.
493
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
494
+ # will be added to the HTTP request.
495
+ #
496
+ # @return [AvailabilityStatusListResult] operation results.
497
+ #
498
+ def list_by_subscription_id_next(next_page_link, custom_headers:nil)
499
+ response = list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers).value!
500
+ response.body unless response.nil?
501
+ end
502
+
503
+ #
504
+ # Lists the current availability status for all the resources in the
505
+ # subscription. Use the nextLink property in the response to get the next page
506
+ # of availability statuses.
507
+ #
508
+ # @param next_page_link [String] The NextLink from the previous successful call
509
+ # to List operation.
510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
+ # will be added to the HTTP request.
512
+ #
513
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
514
+ #
515
+ def list_by_subscription_id_next_with_http_info(next_page_link, custom_headers:nil)
516
+ list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers).value!
517
+ end
518
+
519
+ #
520
+ # Lists the current availability status for all the resources in the
521
+ # subscription. Use the nextLink property in the response to get the next page
522
+ # of availability statuses.
523
+ #
524
+ # @param next_page_link [String] The NextLink from the previous successful call
525
+ # to List operation.
526
+ # @param [Hash{String => String}] A hash of custom headers that will be added
527
+ # to the HTTP request.
528
+ #
529
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
530
+ #
531
+ def list_by_subscription_id_next_async(next_page_link, custom_headers:nil)
532
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
533
+
534
+
535
+ request_headers = {}
536
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
537
+
538
+ # Set Headers
539
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
540
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
541
+ path_template = '{nextLink}'
542
+
543
+ request_url = @base_url || @client.base_url
544
+
545
+ options = {
546
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
547
+ skip_encoding_path_params: {'nextLink' => next_page_link},
548
+ headers: request_headers.merge(custom_headers || {}),
549
+ base_url: request_url
550
+ }
551
+ promise = @client.make_request_async(:get, path_template, options)
552
+
553
+ promise = promise.then do |result|
554
+ http_response = result.response
555
+ status_code = http_response.status
556
+ response_content = http_response.body
557
+ unless status_code == 200
558
+ error_model = JSON.load(response_content)
559
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
560
+ end
561
+
562
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
563
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
564
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
565
+ # Deserialize Response
566
+ if status_code == 200
567
+ begin
568
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
569
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
570
+ result.body = @client.deserialize(result_mapper, parsed_response)
571
+ rescue Exception => e
572
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
573
+ end
574
+ end
575
+
576
+ result
577
+ end
578
+
579
+ promise.execute
580
+ end
581
+
582
+ #
583
+ # Lists the current availability status for all the resources in the resource
584
+ # group. Use the nextLink property in the response to get the next page of
585
+ # availability statuses.
586
+ #
587
+ # @param next_page_link [String] The NextLink from the previous successful call
588
+ # to List operation.
589
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
590
+ # will be added to the HTTP request.
591
+ #
592
+ # @return [AvailabilityStatusListResult] operation results.
593
+ #
594
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
595
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
596
+ response.body unless response.nil?
597
+ end
598
+
599
+ #
600
+ # Lists the current availability status for all the resources in the resource
601
+ # group. Use the nextLink property in the response to get the next page of
602
+ # availability statuses.
603
+ #
604
+ # @param next_page_link [String] The NextLink from the previous successful call
605
+ # to List operation.
606
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
+ # will be added to the HTTP request.
608
+ #
609
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
610
+ #
611
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
612
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
613
+ end
614
+
615
+ #
616
+ # Lists the current availability status for all the resources in the resource
617
+ # group. Use the nextLink property in the response to get the next page of
618
+ # availability statuses.
619
+ #
620
+ # @param next_page_link [String] The NextLink from the previous successful call
621
+ # to List operation.
622
+ # @param [Hash{String => String}] A hash of custom headers that will be added
623
+ # to the HTTP request.
624
+ #
625
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
626
+ #
627
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
628
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
629
+
630
+
631
+ request_headers = {}
632
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
633
+
634
+ # Set Headers
635
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
636
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
637
+ path_template = '{nextLink}'
638
+
639
+ request_url = @base_url || @client.base_url
640
+
641
+ options = {
642
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
643
+ skip_encoding_path_params: {'nextLink' => next_page_link},
644
+ headers: request_headers.merge(custom_headers || {}),
645
+ base_url: request_url
646
+ }
647
+ promise = @client.make_request_async(:get, path_template, options)
648
+
649
+ promise = promise.then do |result|
650
+ http_response = result.response
651
+ status_code = http_response.status
652
+ response_content = http_response.body
653
+ unless status_code == 200
654
+ error_model = JSON.load(response_content)
655
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
656
+ end
657
+
658
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
659
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
660
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
661
+ # Deserialize Response
662
+ if status_code == 200
663
+ begin
664
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
665
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
666
+ result.body = @client.deserialize(result_mapper, parsed_response)
667
+ rescue Exception => e
668
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
669
+ end
670
+ end
671
+
672
+ result
673
+ end
674
+
675
+ promise.execute
676
+ end
677
+
678
+ #
679
+ # Lists all historical availability transitions and impacting events for a
680
+ # single resource. Use the nextLink property in the response to get the next
681
+ # page of availability status
682
+ #
683
+ # @param next_page_link [String] The NextLink from the previous successful call
684
+ # to List operation.
685
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
686
+ # will be added to the HTTP request.
687
+ #
688
+ # @return [AvailabilityStatusListResult] operation results.
689
+ #
690
+ def list_next(next_page_link, custom_headers:nil)
691
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
692
+ response.body unless response.nil?
693
+ end
694
+
695
+ #
696
+ # Lists all historical availability transitions and impacting events for a
697
+ # single resource. Use the nextLink property in the response to get the next
698
+ # page of availability status
699
+ #
700
+ # @param next_page_link [String] The NextLink from the previous successful call
701
+ # to List operation.
702
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
703
+ # will be added to the HTTP request.
704
+ #
705
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
706
+ #
707
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
708
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
709
+ end
710
+
711
+ #
712
+ # Lists all historical availability transitions and impacting events for a
713
+ # single resource. Use the nextLink property in the response to get the next
714
+ # page of availability status
715
+ #
716
+ # @param next_page_link [String] The NextLink from the previous successful call
717
+ # to List operation.
718
+ # @param [Hash{String => String}] A hash of custom headers that will be added
719
+ # to the HTTP request.
720
+ #
721
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
722
+ #
723
+ def list_next_async(next_page_link, custom_headers:nil)
724
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
725
+
726
+
727
+ request_headers = {}
728
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
729
+
730
+ # Set Headers
731
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
732
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
733
+ path_template = '{nextLink}'
734
+
735
+ request_url = @base_url || @client.base_url
736
+
737
+ options = {
738
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
739
+ skip_encoding_path_params: {'nextLink' => next_page_link},
740
+ headers: request_headers.merge(custom_headers || {}),
741
+ base_url: request_url
742
+ }
743
+ promise = @client.make_request_async(:get, path_template, options)
744
+
745
+ promise = promise.then do |result|
746
+ http_response = result.response
747
+ status_code = http_response.status
748
+ response_content = http_response.body
749
+ unless status_code == 200
750
+ error_model = JSON.load(response_content)
751
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
752
+ end
753
+
754
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
755
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
756
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
757
+ # Deserialize Response
758
+ if status_code == 200
759
+ begin
760
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
761
+ result_mapper = Azure::ResourceHealth::Mgmt::V2017_07_01::Models::AvailabilityStatusListResult.mapper()
762
+ result.body = @client.deserialize(result_mapper, parsed_response)
763
+ rescue Exception => e
764
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
765
+ end
766
+ end
767
+
768
+ result
769
+ end
770
+
771
+ promise.execute
772
+ end
773
+
774
+ #
775
+ # Lists the current availability status for all the resources in the
776
+ # subscription. Use the nextLink property in the response to get the next page
777
+ # of availability statuses.
778
+ #
779
+ # @param filter [String] The filter to apply on the operation. For more
780
+ # information please see
781
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
782
+ # @param expand [String] Setting $expand=recommendedactions in url query
783
+ # expands the recommendedactions in the response.
784
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
785
+ # will be added to the HTTP request.
786
+ #
787
+ # @return [AvailabilityStatusListResult] which provide lazy access to pages of
788
+ # the response.
789
+ #
790
+ def list_by_subscription_id_as_lazy(filter:nil, expand:nil, custom_headers:nil)
791
+ response = list_by_subscription_id_async(filter:filter, expand:expand, custom_headers:custom_headers).value!
792
+ unless response.nil?
793
+ page = response.body
794
+ page.next_method = Proc.new do |next_page_link|
795
+ list_by_subscription_id_next_async(next_page_link, custom_headers:custom_headers)
796
+ end
797
+ page
798
+ end
799
+ end
800
+
801
+ #
802
+ # Lists the current availability status for all the resources in the resource
803
+ # group. Use the nextLink property in the response to get the next page of
804
+ # availability statuses.
805
+ #
806
+ # @param resource_group_name [String] The name of the resource group.
807
+ # @param filter [String] The filter to apply on the operation. For more
808
+ # information please see
809
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
810
+ # @param expand [String] Setting $expand=recommendedactions in url query
811
+ # expands the recommendedactions in the response.
812
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
813
+ # will be added to the HTTP request.
814
+ #
815
+ # @return [AvailabilityStatusListResult] which provide lazy access to pages of
816
+ # the response.
817
+ #
818
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, expand:nil, custom_headers:nil)
819
+ response = list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, custom_headers:custom_headers).value!
820
+ unless response.nil?
821
+ page = response.body
822
+ page.next_method = Proc.new do |next_page_link|
823
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
824
+ end
825
+ page
826
+ end
827
+ end
828
+
829
+ #
830
+ # Lists all historical availability transitions and impacting events for a
831
+ # single resource. Use the nextLink property in the response to get the next
832
+ # page of availability status
833
+ #
834
+ # @param resource_uri [String] The fully qualified ID of the resource,
835
+ # including the resource name and resource type. Currently the API support not
836
+ # nested and one nesting level resource types :
837
+ # /subscriptions/{subscriptionId}/resourceGroups/{resource-group-name}/providers/{resource-provider-name}/{resource-type}/{resource-name}
838
+ # and
839
+ # /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resource-provider-name}/{parentResourceType}/{parentResourceName}/{resourceType}/{resourceName}
840
+ # @param filter [String] The filter to apply on the operation. For more
841
+ # information please see
842
+ # https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN
843
+ # @param expand [String] Setting $expand=recommendedactions in url query
844
+ # expands the recommendedactions in the response.
845
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
846
+ # will be added to the HTTP request.
847
+ #
848
+ # @return [AvailabilityStatusListResult] which provide lazy access to pages of
849
+ # the response.
850
+ #
851
+ def list_as_lazy(resource_uri, filter:nil, expand:nil, custom_headers:nil)
852
+ response = list_async(resource_uri, filter:filter, expand:expand, custom_headers:custom_headers).value!
853
+ unless response.nil?
854
+ page = response.body
855
+ page.next_method = Proc.new do |next_page_link|
856
+ list_next_async(next_page_link, custom_headers:custom_headers)
857
+ end
858
+ page
859
+ end
860
+ end
861
+
862
+ end
863
+ end