azure_mgmt_policy_insights 0.17.7 → 0.17.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-09-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  3. data/lib/2017-10-17-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  4. data/lib/2017-12-12-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  5. data/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  6. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +43 -0
  7. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/models/query_options.rb +11 -0
  8. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_insights_client.rb +1 -1
  9. data/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/policy_states.rb +998 -32
  10. data/lib/2019-07-01/generated/azure_mgmt_policy_insights.rb +39 -0
  11. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/error_definition.rb +115 -0
  12. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/error_response.rb +47 -0
  13. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/query_options.rb +54 -0
  14. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation.rb +172 -0
  15. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployment.rb +124 -0
  16. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployment_summary.rb +75 -0
  17. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_deployments_list_result.rb +101 -0
  18. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_filters.rb +55 -0
  19. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/remediation_list_result.rb +100 -0
  20. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/resource_discovery_mode.rb +16 -0
  21. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/models/typed_error_info.rb +59 -0
  22. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/module_definition.rb +9 -0
  23. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/policy_insights_client.rb +131 -0
  24. data/lib/2019-07-01/generated/azure_mgmt_policy_insights/remediations.rb +3294 -0
  25. data/lib/2019-10-01/generated/azure_mgmt_policy_insights.rb +18 -13
  26. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/component_event_details.rb +132 -0
  27. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/component_state_details.rb +109 -0
  28. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/expression_evaluation_details.rb +12 -0
  29. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_event.rb +416 -0
  30. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_events_query_results.rb +125 -0
  31. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_state.rb +21 -0
  32. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/policy_states_query_results.rb +43 -0
  33. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/models/query_options.rb +12 -1
  34. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_events.rb +1961 -0
  35. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_insights_client.rb +5 -1
  36. data/lib/2019-10-01/generated/azure_mgmt_policy_insights/policy_states.rb +998 -32
  37. data/lib/azure_mgmt_policy_insights.rb +4 -3
  38. data/lib/profiles/latest/modules/policyinsights_profile_module.rb +23 -11
  39. data/lib/version.rb +1 -1
  40. metadata +23 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a82ea057dba685a52b14d6764b23046aceadfcf992aee8bfb71a4383a817266
4
- data.tar.gz: fa96d8dbf82c9da0dcf7fac9b9c28b4d95d55ca4e945eb6a592fdb8ef6f5194a
3
+ metadata.gz: 3862146b485c528bcc6f6445d410bc2b3dc7414e39c43b6e17fef80cb63bf098
4
+ data.tar.gz: b099f71d4403b438e3aa86ab889c8b160dc08f27dbd12a2594819fe7b0c94bc8
5
5
  SHA512:
6
- metadata.gz: 2e5244110dce7e702555aef70262b75c8e6c107ba20f1e33dddd67d4b86890634467e9aa05a06bf2f02041762656d49b118578bd20f97c36dc0da4fbe42a01e1
7
- data.tar.gz: e4b0a1bda9189b7328f06caa41ad85828f2decae9e48356d274aac6e4302ab49be23647cc0b1682861bf0cbc0589995e9e67cebe32ed4b322cc750f283635a0c
6
+ metadata.gz: 4ded113a9d059121cf9d6ea111f20ff68ed3fdf831320748f73b1121d6a933257c5781f54fb54a922b9b87ad7b87929afc468c8088a912d81b1d0a4fb83fc650
7
+ data.tar.gz: b7a8ea4227dcf8d4ebd1f21ea0805736b484a93ab732d6f8ab8400b10135acc28a0eedbbf360b16a7d02b13e6428f71731506f73cd2cd4b4deae8d0eccca686c
@@ -129,7 +129,7 @@ module Azure::PolicyInsights::Mgmt::V2017_08_09_preview
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_policy_insights'
132
- sdk_information = "#{sdk_information}/0.17.7"
132
+ sdk_information = "#{sdk_information}/0.17.8"
133
133
  add_user_agent_information(sdk_information)
134
134
  end
135
135
  end
@@ -129,7 +129,7 @@ module Azure::PolicyInsights::Mgmt::V2017_10_17_preview
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_policy_insights'
132
- sdk_information = "#{sdk_information}/0.17.7"
132
+ sdk_information = "#{sdk_information}/0.17.8"
133
133
  add_user_agent_information(sdk_information)
134
134
  end
135
135
  end
@@ -129,7 +129,7 @@ module Azure::PolicyInsights::Mgmt::V2017_12_12_preview
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_policy_insights'
132
- sdk_information = "#{sdk_information}/0.17.7"
132
+ sdk_information = "#{sdk_information}/0.17.8"
133
133
  add_user_agent_information(sdk_information)
134
134
  end
135
135
  end
@@ -129,7 +129,7 @@ module Azure::PolicyInsights::Mgmt::V2018_04_04
129
129
  #
130
130
  def add_telemetry
131
131
  sdk_information = 'azure_mgmt_policy_insights'
132
- sdk_information = "#{sdk_information}/0.17.7"
132
+ sdk_information = "#{sdk_information}/0.17.8"
133
133
  add_user_agent_information(sdk_information)
134
134
  end
135
135
  end
@@ -12,6 +12,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [String] OData context string; used by OData clients to resolve
16
17
  # type information based on metadata.
17
18
  attr_accessor :odatacontext
@@ -20,9 +21,43 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
20
21
  # state records returned.
21
22
  attr_accessor :odatacount
22
23
 
24
+ # @return [String] Odata next link; URL to get the next set of results.
25
+ attr_accessor :odatanext_link
26
+
23
27
  # @return [Array<PolicyState>] Query results.
24
28
  attr_accessor :value
25
29
 
30
+ # return [Proc] with next page method call.
31
+ attr_accessor :next_method
32
+
33
+ #
34
+ # Gets the rest of the items for the request, enabling auto-pagination.
35
+ #
36
+ # @return [Array<PolicyState>] operation results.
37
+ #
38
+ def get_all_items
39
+ items = @value
40
+ page = self
41
+ while page.odatanext_link != nil && !page.odatanext_link.strip.empty? do
42
+ page = page.get_next_page
43
+ items.concat(page.value)
44
+ end
45
+ items
46
+ end
47
+
48
+ #
49
+ # Gets the next page of results.
50
+ #
51
+ # @return [PolicyStatesQueryResults] with next page content.
52
+ #
53
+ def get_next_page
54
+ response = @next_method.call(@odatanext_link).value! unless @next_method.nil?
55
+ unless response.nil?
56
+ @odatanext_link = response.body.odatanext_link
57
+ @value = response.body.value
58
+ self
59
+ end
60
+ end
26
61
 
27
62
  #
28
63
  # Mapper for PolicyStatesQueryResults class as Ruby Hash.
@@ -56,6 +91,14 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
56
91
  name: 'Number'
57
92
  }
58
93
  },
94
+ odatanext_link: {
95
+ client_side_validation: true,
96
+ required: false,
97
+ serialized_name: '@odata\\.nextLink',
98
+ type: {
99
+ name: 'String'
100
+ }
101
+ },
59
102
  value: {
60
103
  client_side_validation: true,
61
104
  required: false,
@@ -41,6 +41,10 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
41
41
  # @return [String] OData apply expression for aggregations.
42
42
  attr_accessor :apply
43
43
 
44
+ # @return [String] Skiptoken is only provided if a previous response
45
+ # returned a partial result as a part of nextLink element.
46
+ attr_accessor :skip_token
47
+
44
48
  # @return [String] The $expand query parameter. For example, to expand
45
49
  # policyEvaluationDetails, use $expand=policyEvaluationDetails
46
50
  attr_accessor :expand
@@ -107,6 +111,13 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
107
111
  name: 'String'
108
112
  }
109
113
  },
114
+ skip_token: {
115
+ client_side_validation: true,
116
+ required: false,
117
+ type: {
118
+ name: 'String'
119
+ }
120
+ },
110
121
  expand: {
111
122
  client_side_validation: true,
112
123
  required: false,
@@ -136,7 +136,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
136
136
  #
137
137
  def add_telemetry
138
138
  sdk_information = 'azure_mgmt_policy_insights'
139
- sdk_information = "#{sdk_information}/0.17.7"
139
+ sdk_information = "#{sdk_information}/0.17.8"
140
140
  add_user_agent_information(sdk_information)
141
141
  end
142
142
  end
@@ -33,11 +33,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
33
33
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
34
  # will be added to the HTTP request.
35
35
  #
36
- # @return [PolicyStatesQueryResults] operation results.
36
+ # @return [Array<PolicyState>] operation results.
37
37
  #
38
38
  def list_query_results_for_management_group(policy_states_resource, management_group_name, query_options:nil, custom_headers:nil)
39
- response = list_query_results_for_management_group_async(policy_states_resource, management_group_name, query_options:query_options, custom_headers:custom_headers).value!
40
- response.body unless response.nil?
39
+ first_page = list_query_results_for_management_group_as_lazy(policy_states_resource, management_group_name, query_options:query_options, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
41
  end
42
42
 
43
43
  #
@@ -85,6 +85,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
85
85
  to = nil
86
86
  filter = nil
87
87
  apply = nil
88
+ skip_token = nil
88
89
  unless query_options.nil?
89
90
  top = query_options.Top
90
91
  end
@@ -106,6 +107,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
106
107
  unless query_options.nil?
107
108
  apply = query_options.Apply
108
109
  end
110
+ unless query_options.nil?
111
+ skip_token = query_options.SkipToken
112
+ end
109
113
 
110
114
  request_headers = {}
111
115
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -120,7 +124,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
120
124
  options = {
121
125
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
122
126
  path_params: {'policyStatesResource' => policy_states_resource,'managementGroupsNamespace' => management_groups_namespace,'managementGroupName' => management_group_name},
123
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
127
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
124
128
  headers: request_headers.merge(custom_headers || {}),
125
129
  base_url: request_url
126
130
  }
@@ -277,11 +281,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
277
281
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
282
  # will be added to the HTTP request.
279
283
  #
280
- # @return [PolicyStatesQueryResults] operation results.
284
+ # @return [Array<PolicyState>] operation results.
281
285
  #
282
286
  def list_query_results_for_subscription(policy_states_resource, subscription_id, query_options:nil, custom_headers:nil)
283
- response = list_query_results_for_subscription_async(policy_states_resource, subscription_id, query_options:query_options, custom_headers:custom_headers).value!
284
- response.body unless response.nil?
287
+ first_page = list_query_results_for_subscription_as_lazy(policy_states_resource, subscription_id, query_options:query_options, custom_headers:custom_headers)
288
+ first_page.get_all_items
285
289
  end
286
290
 
287
291
  #
@@ -328,6 +332,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
328
332
  to = nil
329
333
  filter = nil
330
334
  apply = nil
335
+ skip_token = nil
331
336
  unless query_options.nil?
332
337
  top = query_options.Top
333
338
  end
@@ -349,6 +354,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
349
354
  unless query_options.nil?
350
355
  apply = query_options.Apply
351
356
  end
357
+ unless query_options.nil?
358
+ skip_token = query_options.SkipToken
359
+ end
352
360
 
353
361
  request_headers = {}
354
362
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -363,7 +371,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
363
371
  options = {
364
372
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
373
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id},
366
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
374
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
367
375
  headers: request_headers.merge(custom_headers || {}),
368
376
  base_url: request_url
369
377
  }
@@ -520,11 +528,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
520
528
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
521
529
  # will be added to the HTTP request.
522
530
  #
523
- # @return [PolicyStatesQueryResults] operation results.
531
+ # @return [Array<PolicyState>] operation results.
524
532
  #
525
533
  def list_query_results_for_resource_group(policy_states_resource, subscription_id, resource_group_name, query_options:nil, custom_headers:nil)
526
- response = list_query_results_for_resource_group_async(policy_states_resource, subscription_id, resource_group_name, query_options:query_options, custom_headers:custom_headers).value!
527
- response.body unless response.nil?
534
+ first_page = list_query_results_for_resource_group_as_lazy(policy_states_resource, subscription_id, resource_group_name, query_options:query_options, custom_headers:custom_headers)
535
+ first_page.get_all_items
528
536
  end
529
537
 
530
538
  #
@@ -574,6 +582,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
574
582
  to = nil
575
583
  filter = nil
576
584
  apply = nil
585
+ skip_token = nil
577
586
  unless query_options.nil?
578
587
  top = query_options.Top
579
588
  end
@@ -595,6 +604,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
595
604
  unless query_options.nil?
596
605
  apply = query_options.Apply
597
606
  end
607
+ unless query_options.nil?
608
+ skip_token = query_options.SkipToken
609
+ end
598
610
 
599
611
  request_headers = {}
600
612
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -609,7 +621,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
609
621
  options = {
610
622
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
611
623
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name},
612
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
624
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
613
625
  headers: request_headers.merge(custom_headers || {}),
614
626
  base_url: request_url
615
627
  }
@@ -769,11 +781,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
769
781
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
770
782
  # will be added to the HTTP request.
771
783
  #
772
- # @return [PolicyStatesQueryResults] operation results.
784
+ # @return [Array<PolicyState>] operation results.
773
785
  #
774
786
  def list_query_results_for_resource(policy_states_resource, resource_id, query_options:nil, custom_headers:nil)
775
- response = list_query_results_for_resource_async(policy_states_resource, resource_id, query_options:query_options, custom_headers:custom_headers).value!
776
- response.body unless response.nil?
787
+ first_page = list_query_results_for_resource_as_lazy(policy_states_resource, resource_id, query_options:query_options, custom_headers:custom_headers)
788
+ first_page.get_all_items
777
789
  end
778
790
 
779
791
  #
@@ -821,6 +833,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
821
833
  filter = nil
822
834
  apply = nil
823
835
  expand = nil
836
+ skip_token = nil
824
837
  unless query_options.nil?
825
838
  top = query_options.Top
826
839
  end
@@ -845,6 +858,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
845
858
  unless query_options.nil?
846
859
  expand = query_options.Expand
847
860
  end
861
+ unless query_options.nil?
862
+ skip_token = query_options.SkipToken
863
+ end
848
864
 
849
865
  request_headers = {}
850
866
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -860,7 +876,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
860
876
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
861
877
  path_params: {'policyStatesResource' => policy_states_resource},
862
878
  skip_encoding_path_params: {'resourceId' => resource_id},
863
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$expand' => expand},
879
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$expand' => expand,'$skiptoken' => skip_token},
864
880
  headers: request_headers.merge(custom_headers || {}),
865
881
  base_url: request_url
866
882
  }
@@ -1018,11 +1034,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1018
1034
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1019
1035
  # will be added to the HTTP request.
1020
1036
  #
1021
- # @return [PolicyStatesQueryResults] operation results.
1037
+ # @return [Array<PolicyState>] operation results.
1022
1038
  #
1023
1039
  def list_query_results_for_policy_set_definition(policy_states_resource, subscription_id, policy_set_definition_name, query_options:nil, custom_headers:nil)
1024
- response = list_query_results_for_policy_set_definition_async(policy_states_resource, subscription_id, policy_set_definition_name, query_options:query_options, custom_headers:custom_headers).value!
1025
- response.body unless response.nil?
1040
+ first_page = list_query_results_for_policy_set_definition_as_lazy(policy_states_resource, subscription_id, policy_set_definition_name, query_options:query_options, custom_headers:custom_headers)
1041
+ first_page.get_all_items
1026
1042
  end
1027
1043
 
1028
1044
  #
@@ -1073,6 +1089,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1073
1089
  to = nil
1074
1090
  filter = nil
1075
1091
  apply = nil
1092
+ skip_token = nil
1076
1093
  unless query_options.nil?
1077
1094
  top = query_options.Top
1078
1095
  end
@@ -1094,6 +1111,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1094
1111
  unless query_options.nil?
1095
1112
  apply = query_options.Apply
1096
1113
  end
1114
+ unless query_options.nil?
1115
+ skip_token = query_options.SkipToken
1116
+ end
1097
1117
 
1098
1118
  request_headers = {}
1099
1119
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1108,7 +1128,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1108
1128
  options = {
1109
1129
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1110
1130
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policySetDefinitionName' => policy_set_definition_name},
1111
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1131
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
1112
1132
  headers: request_headers.merge(custom_headers || {}),
1113
1133
  base_url: request_url
1114
1134
  }
@@ -1270,11 +1290,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1270
1290
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1271
1291
  # will be added to the HTTP request.
1272
1292
  #
1273
- # @return [PolicyStatesQueryResults] operation results.
1293
+ # @return [Array<PolicyState>] operation results.
1274
1294
  #
1275
1295
  def list_query_results_for_policy_definition(policy_states_resource, subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
1276
- response = list_query_results_for_policy_definition_async(policy_states_resource, subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
1277
- response.body unless response.nil?
1296
+ first_page = list_query_results_for_policy_definition_as_lazy(policy_states_resource, subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers)
1297
+ first_page.get_all_items
1278
1298
  end
1279
1299
 
1280
1300
  #
@@ -1325,6 +1345,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1325
1345
  to = nil
1326
1346
  filter = nil
1327
1347
  apply = nil
1348
+ skip_token = nil
1328
1349
  unless query_options.nil?
1329
1350
  top = query_options.Top
1330
1351
  end
@@ -1346,6 +1367,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1346
1367
  unless query_options.nil?
1347
1368
  apply = query_options.Apply
1348
1369
  end
1370
+ unless query_options.nil?
1371
+ skip_token = query_options.SkipToken
1372
+ end
1349
1373
 
1350
1374
  request_headers = {}
1351
1375
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1360,7 +1384,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1360
1384
  options = {
1361
1385
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1362
1386
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policyDefinitionName' => policy_definition_name},
1363
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1387
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
1364
1388
  headers: request_headers.merge(custom_headers || {}),
1365
1389
  base_url: request_url
1366
1390
  }
@@ -1522,11 +1546,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1522
1546
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1523
1547
  # will be added to the HTTP request.
1524
1548
  #
1525
- # @return [PolicyStatesQueryResults] operation results.
1549
+ # @return [Array<PolicyState>] operation results.
1526
1550
  #
1527
1551
  def list_query_results_for_subscription_level_policy_assignment(policy_states_resource, subscription_id, policy_assignment_name, query_options:nil, custom_headers:nil)
1528
- response = list_query_results_for_subscription_level_policy_assignment_async(policy_states_resource, subscription_id, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
1529
- response.body unless response.nil?
1552
+ first_page = list_query_results_for_subscription_level_policy_assignment_as_lazy(policy_states_resource, subscription_id, policy_assignment_name, query_options:query_options, custom_headers:custom_headers)
1553
+ first_page.get_all_items
1530
1554
  end
1531
1555
 
1532
1556
  #
@@ -1577,6 +1601,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1577
1601
  to = nil
1578
1602
  filter = nil
1579
1603
  apply = nil
1604
+ skip_token = nil
1580
1605
  unless query_options.nil?
1581
1606
  top = query_options.Top
1582
1607
  end
@@ -1598,6 +1623,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1598
1623
  unless query_options.nil?
1599
1624
  apply = query_options.Apply
1600
1625
  end
1626
+ unless query_options.nil?
1627
+ skip_token = query_options.SkipToken
1628
+ end
1601
1629
 
1602
1630
  request_headers = {}
1603
1631
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1612,7 +1640,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1612
1640
  options = {
1613
1641
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1614
1642
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policyAssignmentName' => policy_assignment_name},
1615
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1643
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
1616
1644
  headers: request_headers.merge(custom_headers || {}),
1617
1645
  base_url: request_url
1618
1646
  }
@@ -1775,11 +1803,11 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1775
1803
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1776
1804
  # will be added to the HTTP request.
1777
1805
  #
1778
- # @return [PolicyStatesQueryResults] operation results.
1806
+ # @return [Array<PolicyState>] operation results.
1779
1807
  #
1780
1808
  def list_query_results_for_resource_group_level_policy_assignment(policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil)
1781
- response = list_query_results_for_resource_group_level_policy_assignment_async(policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
1782
- response.body unless response.nil?
1809
+ first_page = list_query_results_for_resource_group_level_policy_assignment_as_lazy(policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers)
1810
+ first_page.get_all_items
1783
1811
  end
1784
1812
 
1785
1813
  #
@@ -1833,6 +1861,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1833
1861
  to = nil
1834
1862
  filter = nil
1835
1863
  apply = nil
1864
+ skip_token = nil
1836
1865
  unless query_options.nil?
1837
1866
  top = query_options.Top
1838
1867
  end
@@ -1854,6 +1883,9 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1854
1883
  unless query_options.nil?
1855
1884
  apply = query_options.Apply
1856
1885
  end
1886
+ unless query_options.nil?
1887
+ skip_token = query_options.SkipToken
1888
+ end
1857
1889
 
1858
1890
  request_headers = {}
1859
1891
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1868,7 +1900,7 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
1868
1900
  options = {
1869
1901
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1870
1902
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'authorizationNamespace' => authorization_namespace,'policyAssignmentName' => policy_assignment_name},
1871
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1903
+ query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply,'$skiptoken' => skip_token},
1872
1904
  headers: request_headers.merge(custom_headers || {}),
1873
1905
  base_url: request_url
1874
1906
  }
@@ -2123,5 +2155,939 @@ module Azure::PolicyInsights::Mgmt::V2018_07_01_preview
2123
2155
  promise.execute
2124
2156
  end
2125
2157
 
2158
+ #
2159
+ # Queries policy states for the resources under the management group.
2160
+ #
2161
+ # @param next_page_link [String] The NextLink from the previous successful call
2162
+ # to List operation.
2163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2164
+ # will be added to the HTTP request.
2165
+ #
2166
+ # @return [PolicyStatesQueryResults] operation results.
2167
+ #
2168
+ def list_query_results_for_management_group_next(next_page_link, custom_headers:nil)
2169
+ response = list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
2170
+ response.body unless response.nil?
2171
+ end
2172
+
2173
+ #
2174
+ # Queries policy states for the resources under the management group.
2175
+ #
2176
+ # @param next_page_link [String] The NextLink from the previous successful call
2177
+ # to List operation.
2178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2179
+ # will be added to the HTTP request.
2180
+ #
2181
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2182
+ #
2183
+ def list_query_results_for_management_group_next_with_http_info(next_page_link, custom_headers:nil)
2184
+ list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
2185
+ end
2186
+
2187
+ #
2188
+ # Queries policy states for the resources under the management group.
2189
+ #
2190
+ # @param next_page_link [String] The NextLink from the previous successful call
2191
+ # to List operation.
2192
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2193
+ # to the HTTP request.
2194
+ #
2195
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2196
+ #
2197
+ def list_query_results_for_management_group_next_async(next_page_link, custom_headers:nil)
2198
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2199
+
2200
+
2201
+ request_headers = {}
2202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2203
+
2204
+ # Set Headers
2205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2207
+ path_template = '{nextLink}'
2208
+
2209
+ request_url = @base_url || @client.base_url
2210
+
2211
+ options = {
2212
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2213
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2214
+ headers: request_headers.merge(custom_headers || {}),
2215
+ base_url: request_url
2216
+ }
2217
+ promise = @client.make_request_async(:post, path_template, options)
2218
+
2219
+ promise = promise.then do |result|
2220
+ http_response = result.response
2221
+ status_code = http_response.status
2222
+ response_content = http_response.body
2223
+ unless status_code == 200
2224
+ error_model = JSON.load(response_content)
2225
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2226
+ end
2227
+
2228
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2229
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2230
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2231
+ # Deserialize Response
2232
+ if status_code == 200
2233
+ begin
2234
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2235
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2236
+ result.body = @client.deserialize(result_mapper, parsed_response)
2237
+ rescue Exception => e
2238
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2239
+ end
2240
+ end
2241
+
2242
+ result
2243
+ end
2244
+
2245
+ promise.execute
2246
+ end
2247
+
2248
+ #
2249
+ # Queries policy states for the resources under the subscription.
2250
+ #
2251
+ # @param next_page_link [String] The NextLink from the previous successful call
2252
+ # to List operation.
2253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2254
+ # will be added to the HTTP request.
2255
+ #
2256
+ # @return [PolicyStatesQueryResults] operation results.
2257
+ #
2258
+ def list_query_results_for_subscription_next(next_page_link, custom_headers:nil)
2259
+ response = list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2260
+ response.body unless response.nil?
2261
+ end
2262
+
2263
+ #
2264
+ # Queries policy states for the resources under the subscription.
2265
+ #
2266
+ # @param next_page_link [String] The NextLink from the previous successful call
2267
+ # to List operation.
2268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2269
+ # will be added to the HTTP request.
2270
+ #
2271
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2272
+ #
2273
+ def list_query_results_for_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2274
+ list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2275
+ end
2276
+
2277
+ #
2278
+ # Queries policy states for the resources under the subscription.
2279
+ #
2280
+ # @param next_page_link [String] The NextLink from the previous successful call
2281
+ # to List operation.
2282
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2283
+ # to the HTTP request.
2284
+ #
2285
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2286
+ #
2287
+ def list_query_results_for_subscription_next_async(next_page_link, custom_headers:nil)
2288
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2289
+
2290
+
2291
+ request_headers = {}
2292
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2293
+
2294
+ # Set Headers
2295
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2296
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2297
+ path_template = '{nextLink}'
2298
+
2299
+ request_url = @base_url || @client.base_url
2300
+
2301
+ options = {
2302
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2303
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2304
+ headers: request_headers.merge(custom_headers || {}),
2305
+ base_url: request_url
2306
+ }
2307
+ promise = @client.make_request_async(:post, path_template, options)
2308
+
2309
+ promise = promise.then do |result|
2310
+ http_response = result.response
2311
+ status_code = http_response.status
2312
+ response_content = http_response.body
2313
+ unless status_code == 200
2314
+ error_model = JSON.load(response_content)
2315
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2316
+ end
2317
+
2318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2319
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2320
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2321
+ # Deserialize Response
2322
+ if status_code == 200
2323
+ begin
2324
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2325
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2326
+ result.body = @client.deserialize(result_mapper, parsed_response)
2327
+ rescue Exception => e
2328
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2329
+ end
2330
+ end
2331
+
2332
+ result
2333
+ end
2334
+
2335
+ promise.execute
2336
+ end
2337
+
2338
+ #
2339
+ # Queries policy states for the resources under the resource group.
2340
+ #
2341
+ # @param next_page_link [String] The NextLink from the previous successful call
2342
+ # to List operation.
2343
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2344
+ # will be added to the HTTP request.
2345
+ #
2346
+ # @return [PolicyStatesQueryResults] operation results.
2347
+ #
2348
+ def list_query_results_for_resource_group_next(next_page_link, custom_headers:nil)
2349
+ response = list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2350
+ response.body unless response.nil?
2351
+ end
2352
+
2353
+ #
2354
+ # Queries policy states for the resources under the resource group.
2355
+ #
2356
+ # @param next_page_link [String] The NextLink from the previous successful call
2357
+ # to List operation.
2358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2359
+ # will be added to the HTTP request.
2360
+ #
2361
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2362
+ #
2363
+ def list_query_results_for_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2364
+ list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2365
+ end
2366
+
2367
+ #
2368
+ # Queries policy states for the resources under the resource group.
2369
+ #
2370
+ # @param next_page_link [String] The NextLink from the previous successful call
2371
+ # to List operation.
2372
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2373
+ # to the HTTP request.
2374
+ #
2375
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2376
+ #
2377
+ def list_query_results_for_resource_group_next_async(next_page_link, custom_headers:nil)
2378
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2379
+
2380
+
2381
+ request_headers = {}
2382
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2383
+
2384
+ # Set Headers
2385
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2386
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2387
+ path_template = '{nextLink}'
2388
+
2389
+ request_url = @base_url || @client.base_url
2390
+
2391
+ options = {
2392
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2393
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2394
+ headers: request_headers.merge(custom_headers || {}),
2395
+ base_url: request_url
2396
+ }
2397
+ promise = @client.make_request_async(:post, path_template, options)
2398
+
2399
+ promise = promise.then do |result|
2400
+ http_response = result.response
2401
+ status_code = http_response.status
2402
+ response_content = http_response.body
2403
+ unless status_code == 200
2404
+ error_model = JSON.load(response_content)
2405
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2406
+ end
2407
+
2408
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2409
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2410
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2411
+ # Deserialize Response
2412
+ if status_code == 200
2413
+ begin
2414
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2415
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2416
+ result.body = @client.deserialize(result_mapper, parsed_response)
2417
+ rescue Exception => e
2418
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2419
+ end
2420
+ end
2421
+
2422
+ result
2423
+ end
2424
+
2425
+ promise.execute
2426
+ end
2427
+
2428
+ #
2429
+ # Queries policy states for the resource.
2430
+ #
2431
+ # @param next_page_link [String] The NextLink from the previous successful call
2432
+ # to List operation.
2433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2434
+ # will be added to the HTTP request.
2435
+ #
2436
+ # @return [PolicyStatesQueryResults] operation results.
2437
+ #
2438
+ def list_query_results_for_resource_next(next_page_link, custom_headers:nil)
2439
+ response = list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
2440
+ response.body unless response.nil?
2441
+ end
2442
+
2443
+ #
2444
+ # Queries policy states for the resource.
2445
+ #
2446
+ # @param next_page_link [String] The NextLink from the previous successful call
2447
+ # to List operation.
2448
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2449
+ # will be added to the HTTP request.
2450
+ #
2451
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2452
+ #
2453
+ def list_query_results_for_resource_next_with_http_info(next_page_link, custom_headers:nil)
2454
+ list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
2455
+ end
2456
+
2457
+ #
2458
+ # Queries policy states for the resource.
2459
+ #
2460
+ # @param next_page_link [String] The NextLink from the previous successful call
2461
+ # to List operation.
2462
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2463
+ # to the HTTP request.
2464
+ #
2465
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2466
+ #
2467
+ def list_query_results_for_resource_next_async(next_page_link, custom_headers:nil)
2468
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2469
+
2470
+
2471
+ request_headers = {}
2472
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2473
+
2474
+ # Set Headers
2475
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2476
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2477
+ path_template = '{nextLink}'
2478
+
2479
+ request_url = @base_url || @client.base_url
2480
+
2481
+ options = {
2482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2483
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2484
+ headers: request_headers.merge(custom_headers || {}),
2485
+ base_url: request_url
2486
+ }
2487
+ promise = @client.make_request_async(:post, path_template, options)
2488
+
2489
+ promise = promise.then do |result|
2490
+ http_response = result.response
2491
+ status_code = http_response.status
2492
+ response_content = http_response.body
2493
+ unless status_code == 200
2494
+ error_model = JSON.load(response_content)
2495
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2496
+ end
2497
+
2498
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2499
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2500
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2501
+ # Deserialize Response
2502
+ if status_code == 200
2503
+ begin
2504
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2505
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2506
+ result.body = @client.deserialize(result_mapper, parsed_response)
2507
+ rescue Exception => e
2508
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2509
+ end
2510
+ end
2511
+
2512
+ result
2513
+ end
2514
+
2515
+ promise.execute
2516
+ end
2517
+
2518
+ #
2519
+ # Queries policy states for the subscription level policy set definition.
2520
+ #
2521
+ # @param next_page_link [String] The NextLink from the previous successful call
2522
+ # to List operation.
2523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2524
+ # will be added to the HTTP request.
2525
+ #
2526
+ # @return [PolicyStatesQueryResults] operation results.
2527
+ #
2528
+ def list_query_results_for_policy_set_definition_next(next_page_link, custom_headers:nil)
2529
+ response = list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2530
+ response.body unless response.nil?
2531
+ end
2532
+
2533
+ #
2534
+ # Queries policy states for the subscription level policy set definition.
2535
+ #
2536
+ # @param next_page_link [String] The NextLink from the previous successful call
2537
+ # to List operation.
2538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2539
+ # will be added to the HTTP request.
2540
+ #
2541
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2542
+ #
2543
+ def list_query_results_for_policy_set_definition_next_with_http_info(next_page_link, custom_headers:nil)
2544
+ list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2545
+ end
2546
+
2547
+ #
2548
+ # Queries policy states for the subscription level policy set definition.
2549
+ #
2550
+ # @param next_page_link [String] The NextLink from the previous successful call
2551
+ # to List operation.
2552
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2553
+ # to the HTTP request.
2554
+ #
2555
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2556
+ #
2557
+ def list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:nil)
2558
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2559
+
2560
+
2561
+ request_headers = {}
2562
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2563
+
2564
+ # Set Headers
2565
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2566
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2567
+ path_template = '{nextLink}'
2568
+
2569
+ request_url = @base_url || @client.base_url
2570
+
2571
+ options = {
2572
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2573
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2574
+ headers: request_headers.merge(custom_headers || {}),
2575
+ base_url: request_url
2576
+ }
2577
+ promise = @client.make_request_async(:post, path_template, options)
2578
+
2579
+ promise = promise.then do |result|
2580
+ http_response = result.response
2581
+ status_code = http_response.status
2582
+ response_content = http_response.body
2583
+ unless status_code == 200
2584
+ error_model = JSON.load(response_content)
2585
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2586
+ end
2587
+
2588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2589
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2590
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2591
+ # Deserialize Response
2592
+ if status_code == 200
2593
+ begin
2594
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2595
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2596
+ result.body = @client.deserialize(result_mapper, parsed_response)
2597
+ rescue Exception => e
2598
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2599
+ end
2600
+ end
2601
+
2602
+ result
2603
+ end
2604
+
2605
+ promise.execute
2606
+ end
2607
+
2608
+ #
2609
+ # Queries policy states for the subscription level policy definition.
2610
+ #
2611
+ # @param next_page_link [String] The NextLink from the previous successful call
2612
+ # to List operation.
2613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2614
+ # will be added to the HTTP request.
2615
+ #
2616
+ # @return [PolicyStatesQueryResults] operation results.
2617
+ #
2618
+ def list_query_results_for_policy_definition_next(next_page_link, custom_headers:nil)
2619
+ response = list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2620
+ response.body unless response.nil?
2621
+ end
2622
+
2623
+ #
2624
+ # Queries policy states for the subscription level policy definition.
2625
+ #
2626
+ # @param next_page_link [String] The NextLink from the previous successful call
2627
+ # to List operation.
2628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2629
+ # will be added to the HTTP request.
2630
+ #
2631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2632
+ #
2633
+ def list_query_results_for_policy_definition_next_with_http_info(next_page_link, custom_headers:nil)
2634
+ list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2635
+ end
2636
+
2637
+ #
2638
+ # Queries policy states for the subscription level policy definition.
2639
+ #
2640
+ # @param next_page_link [String] The NextLink from the previous successful call
2641
+ # to List operation.
2642
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2643
+ # to the HTTP request.
2644
+ #
2645
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2646
+ #
2647
+ def list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:nil)
2648
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2649
+
2650
+
2651
+ request_headers = {}
2652
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2653
+
2654
+ # Set Headers
2655
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2656
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2657
+ path_template = '{nextLink}'
2658
+
2659
+ request_url = @base_url || @client.base_url
2660
+
2661
+ options = {
2662
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2663
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2664
+ headers: request_headers.merge(custom_headers || {}),
2665
+ base_url: request_url
2666
+ }
2667
+ promise = @client.make_request_async(:post, path_template, options)
2668
+
2669
+ promise = promise.then do |result|
2670
+ http_response = result.response
2671
+ status_code = http_response.status
2672
+ response_content = http_response.body
2673
+ unless status_code == 200
2674
+ error_model = JSON.load(response_content)
2675
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2676
+ end
2677
+
2678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2681
+ # Deserialize Response
2682
+ if status_code == 200
2683
+ begin
2684
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2685
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2686
+ result.body = @client.deserialize(result_mapper, parsed_response)
2687
+ rescue Exception => e
2688
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2689
+ end
2690
+ end
2691
+
2692
+ result
2693
+ end
2694
+
2695
+ promise.execute
2696
+ end
2697
+
2698
+ #
2699
+ # Queries policy states for the subscription level policy assignment.
2700
+ #
2701
+ # @param next_page_link [String] The NextLink from the previous successful call
2702
+ # to List operation.
2703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2704
+ # will be added to the HTTP request.
2705
+ #
2706
+ # @return [PolicyStatesQueryResults] operation results.
2707
+ #
2708
+ def list_query_results_for_subscription_level_policy_assignment_next(next_page_link, custom_headers:nil)
2709
+ response = list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2710
+ response.body unless response.nil?
2711
+ end
2712
+
2713
+ #
2714
+ # Queries policy states for the subscription level policy assignment.
2715
+ #
2716
+ # @param next_page_link [String] The NextLink from the previous successful call
2717
+ # to List operation.
2718
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2719
+ # will be added to the HTTP request.
2720
+ #
2721
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2722
+ #
2723
+ def list_query_results_for_subscription_level_policy_assignment_next_with_http_info(next_page_link, custom_headers:nil)
2724
+ list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2725
+ end
2726
+
2727
+ #
2728
+ # Queries policy states for the subscription level policy assignment.
2729
+ #
2730
+ # @param next_page_link [String] The NextLink from the previous successful call
2731
+ # to List operation.
2732
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2733
+ # to the HTTP request.
2734
+ #
2735
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2736
+ #
2737
+ def list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:nil)
2738
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2739
+
2740
+
2741
+ request_headers = {}
2742
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2743
+
2744
+ # Set Headers
2745
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2746
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2747
+ path_template = '{nextLink}'
2748
+
2749
+ request_url = @base_url || @client.base_url
2750
+
2751
+ options = {
2752
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2753
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2754
+ headers: request_headers.merge(custom_headers || {}),
2755
+ base_url: request_url
2756
+ }
2757
+ promise = @client.make_request_async(:post, path_template, options)
2758
+
2759
+ promise = promise.then do |result|
2760
+ http_response = result.response
2761
+ status_code = http_response.status
2762
+ response_content = http_response.body
2763
+ unless status_code == 200
2764
+ error_model = JSON.load(response_content)
2765
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2766
+ end
2767
+
2768
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2769
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2770
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2771
+ # Deserialize Response
2772
+ if status_code == 200
2773
+ begin
2774
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2775
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2776
+ result.body = @client.deserialize(result_mapper, parsed_response)
2777
+ rescue Exception => e
2778
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2779
+ end
2780
+ end
2781
+
2782
+ result
2783
+ end
2784
+
2785
+ promise.execute
2786
+ end
2787
+
2788
+ #
2789
+ # Queries policy states for the resource group level policy assignment.
2790
+ #
2791
+ # @param next_page_link [String] The NextLink from the previous successful call
2792
+ # to List operation.
2793
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2794
+ # will be added to the HTTP request.
2795
+ #
2796
+ # @return [PolicyStatesQueryResults] operation results.
2797
+ #
2798
+ def list_query_results_for_resource_group_level_policy_assignment_next(next_page_link, custom_headers:nil)
2799
+ response = list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2800
+ response.body unless response.nil?
2801
+ end
2802
+
2803
+ #
2804
+ # Queries policy states for the resource group level policy assignment.
2805
+ #
2806
+ # @param next_page_link [String] The NextLink from the previous successful call
2807
+ # to List operation.
2808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2809
+ # will be added to the HTTP request.
2810
+ #
2811
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2812
+ #
2813
+ def list_query_results_for_resource_group_level_policy_assignment_next_with_http_info(next_page_link, custom_headers:nil)
2814
+ list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2815
+ end
2816
+
2817
+ #
2818
+ # Queries policy states for the resource group level policy assignment.
2819
+ #
2820
+ # @param next_page_link [String] The NextLink from the previous successful call
2821
+ # to List operation.
2822
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2823
+ # to the HTTP request.
2824
+ #
2825
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2826
+ #
2827
+ def list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:nil)
2828
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2829
+
2830
+
2831
+ request_headers = {}
2832
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2833
+
2834
+ # Set Headers
2835
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2836
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2837
+ path_template = '{nextLink}'
2838
+
2839
+ request_url = @base_url || @client.base_url
2840
+
2841
+ options = {
2842
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2843
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2844
+ headers: request_headers.merge(custom_headers || {}),
2845
+ base_url: request_url
2846
+ }
2847
+ promise = @client.make_request_async(:post, path_template, options)
2848
+
2849
+ promise = promise.then do |result|
2850
+ http_response = result.response
2851
+ status_code = http_response.status
2852
+ response_content = http_response.body
2853
+ unless status_code == 200
2854
+ error_model = JSON.load(response_content)
2855
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2856
+ end
2857
+
2858
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2859
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2860
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2861
+ # Deserialize Response
2862
+ if status_code == 200
2863
+ begin
2864
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2865
+ result_mapper = Azure::PolicyInsights::Mgmt::V2018_07_01_preview::Models::PolicyStatesQueryResults.mapper()
2866
+ result.body = @client.deserialize(result_mapper, parsed_response)
2867
+ rescue Exception => e
2868
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2869
+ end
2870
+ end
2871
+
2872
+ result
2873
+ end
2874
+
2875
+ promise.execute
2876
+ end
2877
+
2878
+ #
2879
+ # Queries policy states for the resources under the management group.
2880
+ #
2881
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
2882
+ # under PolicyStates resource type. In a given time range, 'latest' represents
2883
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
2884
+ # Possible values include: 'default', 'latest'
2885
+ # @param management_group_name [String] Management group name.
2886
+ # @param query_options [QueryOptions] Additional parameters for the operation
2887
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2888
+ # will be added to the HTTP request.
2889
+ #
2890
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
2891
+ # response.
2892
+ #
2893
+ def list_query_results_for_management_group_as_lazy(policy_states_resource, management_group_name, query_options:nil, custom_headers:nil)
2894
+ response = list_query_results_for_management_group_async(policy_states_resource, management_group_name, query_options:query_options, custom_headers:custom_headers).value!
2895
+ unless response.nil?
2896
+ page = response.body
2897
+ page.next_method = Proc.new do |next_page_link|
2898
+ list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers)
2899
+ end
2900
+ page
2901
+ end
2902
+ end
2903
+
2904
+ #
2905
+ # Queries policy states for the resources under the subscription.
2906
+ #
2907
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
2908
+ # under PolicyStates resource type. In a given time range, 'latest' represents
2909
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
2910
+ # Possible values include: 'default', 'latest'
2911
+ # @param subscription_id [String] Microsoft Azure subscription ID.
2912
+ # @param query_options [QueryOptions] Additional parameters for the operation
2913
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2914
+ # will be added to the HTTP request.
2915
+ #
2916
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
2917
+ # response.
2918
+ #
2919
+ def list_query_results_for_subscription_as_lazy(policy_states_resource, subscription_id, query_options:nil, custom_headers:nil)
2920
+ response = list_query_results_for_subscription_async(policy_states_resource, subscription_id, query_options:query_options, custom_headers:custom_headers).value!
2921
+ unless response.nil?
2922
+ page = response.body
2923
+ page.next_method = Proc.new do |next_page_link|
2924
+ list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers)
2925
+ end
2926
+ page
2927
+ end
2928
+ end
2929
+
2930
+ #
2931
+ # Queries policy states for the resources under the resource group.
2932
+ #
2933
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
2934
+ # under PolicyStates resource type. In a given time range, 'latest' represents
2935
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
2936
+ # Possible values include: 'default', 'latest'
2937
+ # @param subscription_id [String] Microsoft Azure subscription ID.
2938
+ # @param resource_group_name [String] Resource group name.
2939
+ # @param query_options [QueryOptions] Additional parameters for the operation
2940
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2941
+ # will be added to the HTTP request.
2942
+ #
2943
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
2944
+ # response.
2945
+ #
2946
+ def list_query_results_for_resource_group_as_lazy(policy_states_resource, subscription_id, resource_group_name, query_options:nil, custom_headers:nil)
2947
+ response = list_query_results_for_resource_group_async(policy_states_resource, subscription_id, resource_group_name, query_options:query_options, custom_headers:custom_headers).value!
2948
+ unless response.nil?
2949
+ page = response.body
2950
+ page.next_method = Proc.new do |next_page_link|
2951
+ list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2952
+ end
2953
+ page
2954
+ end
2955
+ end
2956
+
2957
+ #
2958
+ # Queries policy states for the resource.
2959
+ #
2960
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
2961
+ # under PolicyStates resource type. In a given time range, 'latest' represents
2962
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
2963
+ # Possible values include: 'default', 'latest'
2964
+ # @param resource_id [String] Resource ID.
2965
+ # @param query_options [QueryOptions] Additional parameters for the operation
2966
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2967
+ # will be added to the HTTP request.
2968
+ #
2969
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
2970
+ # response.
2971
+ #
2972
+ def list_query_results_for_resource_as_lazy(policy_states_resource, resource_id, query_options:nil, custom_headers:nil)
2973
+ response = list_query_results_for_resource_async(policy_states_resource, resource_id, query_options:query_options, custom_headers:custom_headers).value!
2974
+ unless response.nil?
2975
+ page = response.body
2976
+ page.next_method = Proc.new do |next_page_link|
2977
+ list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers)
2978
+ end
2979
+ page
2980
+ end
2981
+ end
2982
+
2983
+ #
2984
+ # Queries policy states for the subscription level policy set definition.
2985
+ #
2986
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
2987
+ # under PolicyStates resource type. In a given time range, 'latest' represents
2988
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
2989
+ # Possible values include: 'default', 'latest'
2990
+ # @param subscription_id [String] Microsoft Azure subscription ID.
2991
+ # @param policy_set_definition_name [String] Policy set definition name.
2992
+ # @param query_options [QueryOptions] Additional parameters for the operation
2993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2994
+ # will be added to the HTTP request.
2995
+ #
2996
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
2997
+ # response.
2998
+ #
2999
+ def list_query_results_for_policy_set_definition_as_lazy(policy_states_resource, subscription_id, policy_set_definition_name, query_options:nil, custom_headers:nil)
3000
+ response = list_query_results_for_policy_set_definition_async(policy_states_resource, subscription_id, policy_set_definition_name, query_options:query_options, custom_headers:custom_headers).value!
3001
+ unless response.nil?
3002
+ page = response.body
3003
+ page.next_method = Proc.new do |next_page_link|
3004
+ list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers)
3005
+ end
3006
+ page
3007
+ end
3008
+ end
3009
+
3010
+ #
3011
+ # Queries policy states for the subscription level policy definition.
3012
+ #
3013
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3014
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3015
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3016
+ # Possible values include: 'default', 'latest'
3017
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3018
+ # @param policy_definition_name [String] Policy definition name.
3019
+ # @param query_options [QueryOptions] Additional parameters for the operation
3020
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3021
+ # will be added to the HTTP request.
3022
+ #
3023
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3024
+ # response.
3025
+ #
3026
+ def list_query_results_for_policy_definition_as_lazy(policy_states_resource, subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
3027
+ response = list_query_results_for_policy_definition_async(policy_states_resource, subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
3028
+ unless response.nil?
3029
+ page = response.body
3030
+ page.next_method = Proc.new do |next_page_link|
3031
+ list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers)
3032
+ end
3033
+ page
3034
+ end
3035
+ end
3036
+
3037
+ #
3038
+ # Queries policy states for the subscription level policy assignment.
3039
+ #
3040
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3041
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3042
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3043
+ # Possible values include: 'default', 'latest'
3044
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3045
+ # @param policy_assignment_name [String] Policy assignment name.
3046
+ # @param query_options [QueryOptions] Additional parameters for the operation
3047
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3048
+ # will be added to the HTTP request.
3049
+ #
3050
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3051
+ # response.
3052
+ #
3053
+ def list_query_results_for_subscription_level_policy_assignment_as_lazy(policy_states_resource, subscription_id, policy_assignment_name, query_options:nil, custom_headers:nil)
3054
+ response = list_query_results_for_subscription_level_policy_assignment_async(policy_states_resource, subscription_id, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
3055
+ unless response.nil?
3056
+ page = response.body
3057
+ page.next_method = Proc.new do |next_page_link|
3058
+ list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers)
3059
+ end
3060
+ page
3061
+ end
3062
+ end
3063
+
3064
+ #
3065
+ # Queries policy states for the resource group level policy assignment.
3066
+ #
3067
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3068
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3069
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3070
+ # Possible values include: 'default', 'latest'
3071
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3072
+ # @param resource_group_name [String] Resource group name.
3073
+ # @param policy_assignment_name [String] Policy assignment name.
3074
+ # @param query_options [QueryOptions] Additional parameters for the operation
3075
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3076
+ # will be added to the HTTP request.
3077
+ #
3078
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3079
+ # response.
3080
+ #
3081
+ def list_query_results_for_resource_group_level_policy_assignment_as_lazy(policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil)
3082
+ response = list_query_results_for_resource_group_level_policy_assignment_async(policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
3083
+ unless response.nil?
3084
+ page = response.body
3085
+ page.next_method = Proc.new do |next_page_link|
3086
+ list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers)
3087
+ end
3088
+ page
3089
+ end
3090
+ end
3091
+
2126
3092
  end
2127
3093
  end