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
@@ -32,6 +32,9 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
32
32
  # generated and included in each request. Default is true.
33
33
  attr_accessor :generate_client_request_id
34
34
 
35
+ # @return [PolicyEvents] policy_events
36
+ attr_reader :policy_events
37
+
35
38
  # @return [PolicyStates] policy_states
36
39
  attr_reader :policy_states
37
40
 
@@ -54,6 +57,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
54
57
  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
55
58
  @credentials = credentials
56
59
 
60
+ @policy_events = PolicyEvents.new(self)
57
61
  @policy_states = PolicyStates.new(self)
58
62
  @operations = Operations.new(self)
59
63
  @policy_metadata_operations = PolicyMetadataOperations.new(self)
@@ -129,7 +133,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
129
133
  #
130
134
  def add_telemetry
131
135
  sdk_information = 'azure_mgmt_policy_insights'
132
- sdk_information = "#{sdk_information}/0.17.7"
136
+ sdk_information = "#{sdk_information}/0.17.8"
133
137
  add_user_agent_information(sdk_information)
134
138
  end
135
139
  end
@@ -33,11 +33,11 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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::V2019_10_01
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
  }
@@ -1094,11 +1110,11 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1094
1110
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1095
1111
  # will be added to the HTTP request.
1096
1112
  #
1097
- # @return [PolicyStatesQueryResults] operation results.
1113
+ # @return [Array<PolicyState>] operation results.
1098
1114
  #
1099
1115
  def list_query_results_for_policy_set_definition(policy_states_resource, subscription_id, policy_set_definition_name, query_options:nil, custom_headers:nil)
1100
- 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!
1101
- response.body unless response.nil?
1116
+ 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)
1117
+ first_page.get_all_items
1102
1118
  end
1103
1119
 
1104
1120
  #
@@ -1149,6 +1165,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1149
1165
  to = nil
1150
1166
  filter = nil
1151
1167
  apply = nil
1168
+ skip_token = nil
1152
1169
  unless query_options.nil?
1153
1170
  top = query_options.Top
1154
1171
  end
@@ -1170,6 +1187,9 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1170
1187
  unless query_options.nil?
1171
1188
  apply = query_options.Apply
1172
1189
  end
1190
+ unless query_options.nil?
1191
+ skip_token = query_options.SkipToken
1192
+ end
1173
1193
 
1174
1194
  request_headers = {}
1175
1195
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1184,7 +1204,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1184
1204
  options = {
1185
1205
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1186
1206
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policySetDefinitionName' => policy_set_definition_name},
1187
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1207
+ 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},
1188
1208
  headers: request_headers.merge(custom_headers || {}),
1189
1209
  base_url: request_url
1190
1210
  }
@@ -1346,11 +1366,11 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1346
1366
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1347
1367
  # will be added to the HTTP request.
1348
1368
  #
1349
- # @return [PolicyStatesQueryResults] operation results.
1369
+ # @return [Array<PolicyState>] operation results.
1350
1370
  #
1351
1371
  def list_query_results_for_policy_definition(policy_states_resource, subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
1352
- 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!
1353
- response.body unless response.nil?
1372
+ 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)
1373
+ first_page.get_all_items
1354
1374
  end
1355
1375
 
1356
1376
  #
@@ -1401,6 +1421,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1401
1421
  to = nil
1402
1422
  filter = nil
1403
1423
  apply = nil
1424
+ skip_token = nil
1404
1425
  unless query_options.nil?
1405
1426
  top = query_options.Top
1406
1427
  end
@@ -1422,6 +1443,9 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1422
1443
  unless query_options.nil?
1423
1444
  apply = query_options.Apply
1424
1445
  end
1446
+ unless query_options.nil?
1447
+ skip_token = query_options.SkipToken
1448
+ end
1425
1449
 
1426
1450
  request_headers = {}
1427
1451
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1436,7 +1460,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1436
1460
  options = {
1437
1461
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1438
1462
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policyDefinitionName' => policy_definition_name},
1439
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1463
+ 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},
1440
1464
  headers: request_headers.merge(custom_headers || {}),
1441
1465
  base_url: request_url
1442
1466
  }
@@ -1598,11 +1622,11 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1598
1622
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1599
1623
  # will be added to the HTTP request.
1600
1624
  #
1601
- # @return [PolicyStatesQueryResults] operation results.
1625
+ # @return [Array<PolicyState>] operation results.
1602
1626
  #
1603
1627
  def list_query_results_for_subscription_level_policy_assignment(policy_states_resource, subscription_id, policy_assignment_name, query_options:nil, custom_headers:nil)
1604
- 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!
1605
- response.body unless response.nil?
1628
+ 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)
1629
+ first_page.get_all_items
1606
1630
  end
1607
1631
 
1608
1632
  #
@@ -1653,6 +1677,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1653
1677
  to = nil
1654
1678
  filter = nil
1655
1679
  apply = nil
1680
+ skip_token = nil
1656
1681
  unless query_options.nil?
1657
1682
  top = query_options.Top
1658
1683
  end
@@ -1674,6 +1699,9 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1674
1699
  unless query_options.nil?
1675
1700
  apply = query_options.Apply
1676
1701
  end
1702
+ unless query_options.nil?
1703
+ skip_token = query_options.SkipToken
1704
+ end
1677
1705
 
1678
1706
  request_headers = {}
1679
1707
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1688,7 +1716,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1688
1716
  options = {
1689
1717
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1690
1718
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'authorizationNamespace' => authorization_namespace,'policyAssignmentName' => policy_assignment_name},
1691
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1719
+ 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},
1692
1720
  headers: request_headers.merge(custom_headers || {}),
1693
1721
  base_url: request_url
1694
1722
  }
@@ -1851,11 +1879,11 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1851
1879
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1852
1880
  # will be added to the HTTP request.
1853
1881
  #
1854
- # @return [PolicyStatesQueryResults] operation results.
1882
+ # @return [Array<PolicyState>] operation results.
1855
1883
  #
1856
1884
  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)
1857
- 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!
1858
- response.body unless response.nil?
1885
+ 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)
1886
+ first_page.get_all_items
1859
1887
  end
1860
1888
 
1861
1889
  #
@@ -1909,6 +1937,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1909
1937
  to = nil
1910
1938
  filter = nil
1911
1939
  apply = nil
1940
+ skip_token = nil
1912
1941
  unless query_options.nil?
1913
1942
  top = query_options.Top
1914
1943
  end
@@ -1930,6 +1959,9 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1930
1959
  unless query_options.nil?
1931
1960
  apply = query_options.Apply
1932
1961
  end
1962
+ unless query_options.nil?
1963
+ skip_token = query_options.SkipToken
1964
+ end
1933
1965
 
1934
1966
  request_headers = {}
1935
1967
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
@@ -1944,7 +1976,7 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
1944
1976
  options = {
1945
1977
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1946
1978
  path_params: {'policyStatesResource' => policy_states_resource,'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'authorizationNamespace' => authorization_namespace,'policyAssignmentName' => policy_assignment_name},
1947
- query_params: {'api-version' => @client.api_version,'$top' => top,'$orderby' => order_by,'$select' => select,'$from' => from,'$to' => to,'$filter' => filter,'$apply' => apply},
1979
+ 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},
1948
1980
  headers: request_headers.merge(custom_headers || {}),
1949
1981
  base_url: request_url
1950
1982
  }
@@ -2263,5 +2295,939 @@ module Azure::PolicyInsights::Mgmt::V2019_10_01
2263
2295
  promise.execute
2264
2296
  end
2265
2297
 
2298
+ #
2299
+ # Queries policy states for the resources under the management group.
2300
+ #
2301
+ # @param next_page_link [String] The NextLink from the previous successful call
2302
+ # to List operation.
2303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2304
+ # will be added to the HTTP request.
2305
+ #
2306
+ # @return [PolicyStatesQueryResults] operation results.
2307
+ #
2308
+ def list_query_results_for_management_group_next(next_page_link, custom_headers:nil)
2309
+ response = list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
2310
+ response.body unless response.nil?
2311
+ end
2312
+
2313
+ #
2314
+ # Queries policy states for the resources under the management group.
2315
+ #
2316
+ # @param next_page_link [String] The NextLink from the previous successful call
2317
+ # to List operation.
2318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2319
+ # will be added to the HTTP request.
2320
+ #
2321
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2322
+ #
2323
+ def list_query_results_for_management_group_next_with_http_info(next_page_link, custom_headers:nil)
2324
+ list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
2325
+ end
2326
+
2327
+ #
2328
+ # Queries policy states for the resources under the management group.
2329
+ #
2330
+ # @param next_page_link [String] The NextLink from the previous successful call
2331
+ # to List operation.
2332
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2333
+ # to the HTTP request.
2334
+ #
2335
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2336
+ #
2337
+ def list_query_results_for_management_group_next_async(next_page_link, custom_headers:nil)
2338
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2339
+
2340
+
2341
+ request_headers = {}
2342
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2343
+
2344
+ # Set Headers
2345
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2346
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2347
+ path_template = '{nextLink}'
2348
+
2349
+ request_url = @base_url || @client.base_url
2350
+
2351
+ options = {
2352
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2353
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2354
+ headers: request_headers.merge(custom_headers || {}),
2355
+ base_url: request_url
2356
+ }
2357
+ promise = @client.make_request_async(:post, path_template, options)
2358
+
2359
+ promise = promise.then do |result|
2360
+ http_response = result.response
2361
+ status_code = http_response.status
2362
+ response_content = http_response.body
2363
+ unless status_code == 200
2364
+ error_model = JSON.load(response_content)
2365
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2366
+ end
2367
+
2368
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2369
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2370
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2371
+ # Deserialize Response
2372
+ if status_code == 200
2373
+ begin
2374
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2375
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2376
+ result.body = @client.deserialize(result_mapper, parsed_response)
2377
+ rescue Exception => e
2378
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2379
+ end
2380
+ end
2381
+
2382
+ result
2383
+ end
2384
+
2385
+ promise.execute
2386
+ end
2387
+
2388
+ #
2389
+ # Queries policy states for the resources under the subscription.
2390
+ #
2391
+ # @param next_page_link [String] The NextLink from the previous successful call
2392
+ # to List operation.
2393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2394
+ # will be added to the HTTP request.
2395
+ #
2396
+ # @return [PolicyStatesQueryResults] operation results.
2397
+ #
2398
+ def list_query_results_for_subscription_next(next_page_link, custom_headers:nil)
2399
+ response = list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2400
+ response.body unless response.nil?
2401
+ end
2402
+
2403
+ #
2404
+ # Queries policy states for the resources under the subscription.
2405
+ #
2406
+ # @param next_page_link [String] The NextLink from the previous successful call
2407
+ # to List operation.
2408
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2409
+ # will be added to the HTTP request.
2410
+ #
2411
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2412
+ #
2413
+ def list_query_results_for_subscription_next_with_http_info(next_page_link, custom_headers:nil)
2414
+ list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
2415
+ end
2416
+
2417
+ #
2418
+ # Queries policy states for the resources under the subscription.
2419
+ #
2420
+ # @param next_page_link [String] The NextLink from the previous successful call
2421
+ # to List operation.
2422
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2423
+ # to the HTTP request.
2424
+ #
2425
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2426
+ #
2427
+ def list_query_results_for_subscription_next_async(next_page_link, custom_headers:nil)
2428
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2429
+
2430
+
2431
+ request_headers = {}
2432
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2433
+
2434
+ # Set Headers
2435
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2436
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2437
+ path_template = '{nextLink}'
2438
+
2439
+ request_url = @base_url || @client.base_url
2440
+
2441
+ options = {
2442
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2443
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2444
+ headers: request_headers.merge(custom_headers || {}),
2445
+ base_url: request_url
2446
+ }
2447
+ promise = @client.make_request_async(:post, path_template, options)
2448
+
2449
+ promise = promise.then do |result|
2450
+ http_response = result.response
2451
+ status_code = http_response.status
2452
+ response_content = http_response.body
2453
+ unless status_code == 200
2454
+ error_model = JSON.load(response_content)
2455
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2456
+ end
2457
+
2458
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2459
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2460
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2461
+ # Deserialize Response
2462
+ if status_code == 200
2463
+ begin
2464
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2465
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2466
+ result.body = @client.deserialize(result_mapper, parsed_response)
2467
+ rescue Exception => e
2468
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2469
+ end
2470
+ end
2471
+
2472
+ result
2473
+ end
2474
+
2475
+ promise.execute
2476
+ end
2477
+
2478
+ #
2479
+ # Queries policy states for the resources under the resource group.
2480
+ #
2481
+ # @param next_page_link [String] The NextLink from the previous successful call
2482
+ # to List operation.
2483
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2484
+ # will be added to the HTTP request.
2485
+ #
2486
+ # @return [PolicyStatesQueryResults] operation results.
2487
+ #
2488
+ def list_query_results_for_resource_group_next(next_page_link, custom_headers:nil)
2489
+ response = list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2490
+ response.body unless response.nil?
2491
+ end
2492
+
2493
+ #
2494
+ # Queries policy states for the resources under the resource group.
2495
+ #
2496
+ # @param next_page_link [String] The NextLink from the previous successful call
2497
+ # to List operation.
2498
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2499
+ # will be added to the HTTP request.
2500
+ #
2501
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2502
+ #
2503
+ def list_query_results_for_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2504
+ list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2505
+ end
2506
+
2507
+ #
2508
+ # Queries policy states for the resources under the resource group.
2509
+ #
2510
+ # @param next_page_link [String] The NextLink from the previous successful call
2511
+ # to List operation.
2512
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2513
+ # to the HTTP request.
2514
+ #
2515
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2516
+ #
2517
+ def list_query_results_for_resource_group_next_async(next_page_link, custom_headers:nil)
2518
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2519
+
2520
+
2521
+ request_headers = {}
2522
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2523
+
2524
+ # Set Headers
2525
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2526
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2527
+ path_template = '{nextLink}'
2528
+
2529
+ request_url = @base_url || @client.base_url
2530
+
2531
+ options = {
2532
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2533
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2534
+ headers: request_headers.merge(custom_headers || {}),
2535
+ base_url: request_url
2536
+ }
2537
+ promise = @client.make_request_async(:post, path_template, options)
2538
+
2539
+ promise = promise.then do |result|
2540
+ http_response = result.response
2541
+ status_code = http_response.status
2542
+ response_content = http_response.body
2543
+ unless status_code == 200
2544
+ error_model = JSON.load(response_content)
2545
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2546
+ end
2547
+
2548
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2549
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2550
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2551
+ # Deserialize Response
2552
+ if status_code == 200
2553
+ begin
2554
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2555
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2556
+ result.body = @client.deserialize(result_mapper, parsed_response)
2557
+ rescue Exception => e
2558
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2559
+ end
2560
+ end
2561
+
2562
+ result
2563
+ end
2564
+
2565
+ promise.execute
2566
+ end
2567
+
2568
+ #
2569
+ # Queries policy states for the resource.
2570
+ #
2571
+ # @param next_page_link [String] The NextLink from the previous successful call
2572
+ # to List operation.
2573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2574
+ # will be added to the HTTP request.
2575
+ #
2576
+ # @return [PolicyStatesQueryResults] operation results.
2577
+ #
2578
+ def list_query_results_for_resource_next(next_page_link, custom_headers:nil)
2579
+ response = list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
2580
+ response.body unless response.nil?
2581
+ end
2582
+
2583
+ #
2584
+ # Queries policy states for the resource.
2585
+ #
2586
+ # @param next_page_link [String] The NextLink from the previous successful call
2587
+ # to List operation.
2588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2589
+ # will be added to the HTTP request.
2590
+ #
2591
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2592
+ #
2593
+ def list_query_results_for_resource_next_with_http_info(next_page_link, custom_headers:nil)
2594
+ list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers).value!
2595
+ end
2596
+
2597
+ #
2598
+ # Queries policy states for the resource.
2599
+ #
2600
+ # @param next_page_link [String] The NextLink from the previous successful call
2601
+ # to List operation.
2602
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2603
+ # to the HTTP request.
2604
+ #
2605
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2606
+ #
2607
+ def list_query_results_for_resource_next_async(next_page_link, custom_headers:nil)
2608
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2609
+
2610
+
2611
+ request_headers = {}
2612
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2613
+
2614
+ # Set Headers
2615
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2616
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2617
+ path_template = '{nextLink}'
2618
+
2619
+ request_url = @base_url || @client.base_url
2620
+
2621
+ options = {
2622
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2623
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2624
+ headers: request_headers.merge(custom_headers || {}),
2625
+ base_url: request_url
2626
+ }
2627
+ promise = @client.make_request_async(:post, path_template, options)
2628
+
2629
+ promise = promise.then do |result|
2630
+ http_response = result.response
2631
+ status_code = http_response.status
2632
+ response_content = http_response.body
2633
+ unless status_code == 200
2634
+ error_model = JSON.load(response_content)
2635
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2636
+ end
2637
+
2638
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2639
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2640
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2641
+ # Deserialize Response
2642
+ if status_code == 200
2643
+ begin
2644
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2645
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2646
+ result.body = @client.deserialize(result_mapper, parsed_response)
2647
+ rescue Exception => e
2648
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2649
+ end
2650
+ end
2651
+
2652
+ result
2653
+ end
2654
+
2655
+ promise.execute
2656
+ end
2657
+
2658
+ #
2659
+ # Queries policy states for the subscription level policy set definition.
2660
+ #
2661
+ # @param next_page_link [String] The NextLink from the previous successful call
2662
+ # to List operation.
2663
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2664
+ # will be added to the HTTP request.
2665
+ #
2666
+ # @return [PolicyStatesQueryResults] operation results.
2667
+ #
2668
+ def list_query_results_for_policy_set_definition_next(next_page_link, custom_headers:nil)
2669
+ response = list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2670
+ response.body unless response.nil?
2671
+ end
2672
+
2673
+ #
2674
+ # Queries policy states for the subscription level policy set definition.
2675
+ #
2676
+ # @param next_page_link [String] The NextLink from the previous successful call
2677
+ # to List operation.
2678
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2679
+ # will be added to the HTTP request.
2680
+ #
2681
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2682
+ #
2683
+ def list_query_results_for_policy_set_definition_next_with_http_info(next_page_link, custom_headers:nil)
2684
+ list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2685
+ end
2686
+
2687
+ #
2688
+ # Queries policy states for the subscription level policy set definition.
2689
+ #
2690
+ # @param next_page_link [String] The NextLink from the previous successful call
2691
+ # to List operation.
2692
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2693
+ # to the HTTP request.
2694
+ #
2695
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2696
+ #
2697
+ def list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:nil)
2698
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2699
+
2700
+
2701
+ request_headers = {}
2702
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2703
+
2704
+ # Set Headers
2705
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2706
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2707
+ path_template = '{nextLink}'
2708
+
2709
+ request_url = @base_url || @client.base_url
2710
+
2711
+ options = {
2712
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2713
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2714
+ headers: request_headers.merge(custom_headers || {}),
2715
+ base_url: request_url
2716
+ }
2717
+ promise = @client.make_request_async(:post, path_template, options)
2718
+
2719
+ promise = promise.then do |result|
2720
+ http_response = result.response
2721
+ status_code = http_response.status
2722
+ response_content = http_response.body
2723
+ unless status_code == 200
2724
+ error_model = JSON.load(response_content)
2725
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2726
+ end
2727
+
2728
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2729
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2730
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2731
+ # Deserialize Response
2732
+ if status_code == 200
2733
+ begin
2734
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2735
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2736
+ result.body = @client.deserialize(result_mapper, parsed_response)
2737
+ rescue Exception => e
2738
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2739
+ end
2740
+ end
2741
+
2742
+ result
2743
+ end
2744
+
2745
+ promise.execute
2746
+ end
2747
+
2748
+ #
2749
+ # Queries policy states for the subscription level policy definition.
2750
+ #
2751
+ # @param next_page_link [String] The NextLink from the previous successful call
2752
+ # to List operation.
2753
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2754
+ # will be added to the HTTP request.
2755
+ #
2756
+ # @return [PolicyStatesQueryResults] operation results.
2757
+ #
2758
+ def list_query_results_for_policy_definition_next(next_page_link, custom_headers:nil)
2759
+ response = list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2760
+ response.body unless response.nil?
2761
+ end
2762
+
2763
+ #
2764
+ # Queries policy states for the subscription level policy definition.
2765
+ #
2766
+ # @param next_page_link [String] The NextLink from the previous successful call
2767
+ # to List operation.
2768
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2769
+ # will be added to the HTTP request.
2770
+ #
2771
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2772
+ #
2773
+ def list_query_results_for_policy_definition_next_with_http_info(next_page_link, custom_headers:nil)
2774
+ list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers).value!
2775
+ end
2776
+
2777
+ #
2778
+ # Queries policy states for the subscription level policy definition.
2779
+ #
2780
+ # @param next_page_link [String] The NextLink from the previous successful call
2781
+ # to List operation.
2782
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2783
+ # to the HTTP request.
2784
+ #
2785
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2786
+ #
2787
+ def list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:nil)
2788
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2789
+
2790
+
2791
+ request_headers = {}
2792
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2793
+
2794
+ # Set Headers
2795
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2796
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2797
+ path_template = '{nextLink}'
2798
+
2799
+ request_url = @base_url || @client.base_url
2800
+
2801
+ options = {
2802
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2803
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2804
+ headers: request_headers.merge(custom_headers || {}),
2805
+ base_url: request_url
2806
+ }
2807
+ promise = @client.make_request_async(:post, path_template, options)
2808
+
2809
+ promise = promise.then do |result|
2810
+ http_response = result.response
2811
+ status_code = http_response.status
2812
+ response_content = http_response.body
2813
+ unless status_code == 200
2814
+ error_model = JSON.load(response_content)
2815
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2816
+ end
2817
+
2818
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2819
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2820
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2821
+ # Deserialize Response
2822
+ if status_code == 200
2823
+ begin
2824
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2825
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2826
+ result.body = @client.deserialize(result_mapper, parsed_response)
2827
+ rescue Exception => e
2828
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2829
+ end
2830
+ end
2831
+
2832
+ result
2833
+ end
2834
+
2835
+ promise.execute
2836
+ end
2837
+
2838
+ #
2839
+ # Queries policy states for the subscription level policy assignment.
2840
+ #
2841
+ # @param next_page_link [String] The NextLink from the previous successful call
2842
+ # to List operation.
2843
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2844
+ # will be added to the HTTP request.
2845
+ #
2846
+ # @return [PolicyStatesQueryResults] operation results.
2847
+ #
2848
+ def list_query_results_for_subscription_level_policy_assignment_next(next_page_link, custom_headers:nil)
2849
+ response = list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2850
+ response.body unless response.nil?
2851
+ end
2852
+
2853
+ #
2854
+ # Queries policy states for the subscription level policy assignment.
2855
+ #
2856
+ # @param next_page_link [String] The NextLink from the previous successful call
2857
+ # to List operation.
2858
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2859
+ # will be added to the HTTP request.
2860
+ #
2861
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2862
+ #
2863
+ def list_query_results_for_subscription_level_policy_assignment_next_with_http_info(next_page_link, custom_headers:nil)
2864
+ list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2865
+ end
2866
+
2867
+ #
2868
+ # Queries policy states for the subscription level policy assignment.
2869
+ #
2870
+ # @param next_page_link [String] The NextLink from the previous successful call
2871
+ # to List operation.
2872
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2873
+ # to the HTTP request.
2874
+ #
2875
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2876
+ #
2877
+ def list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:nil)
2878
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2879
+
2880
+
2881
+ request_headers = {}
2882
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2883
+
2884
+ # Set Headers
2885
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2886
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2887
+ path_template = '{nextLink}'
2888
+
2889
+ request_url = @base_url || @client.base_url
2890
+
2891
+ options = {
2892
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2893
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2894
+ headers: request_headers.merge(custom_headers || {}),
2895
+ base_url: request_url
2896
+ }
2897
+ promise = @client.make_request_async(:post, path_template, options)
2898
+
2899
+ promise = promise.then do |result|
2900
+ http_response = result.response
2901
+ status_code = http_response.status
2902
+ response_content = http_response.body
2903
+ unless status_code == 200
2904
+ error_model = JSON.load(response_content)
2905
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2906
+ end
2907
+
2908
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2909
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2910
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2911
+ # Deserialize Response
2912
+ if status_code == 200
2913
+ begin
2914
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2915
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
2916
+ result.body = @client.deserialize(result_mapper, parsed_response)
2917
+ rescue Exception => e
2918
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2919
+ end
2920
+ end
2921
+
2922
+ result
2923
+ end
2924
+
2925
+ promise.execute
2926
+ end
2927
+
2928
+ #
2929
+ # Queries policy states for the resource group level policy assignment.
2930
+ #
2931
+ # @param next_page_link [String] The NextLink from the previous successful call
2932
+ # to List operation.
2933
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2934
+ # will be added to the HTTP request.
2935
+ #
2936
+ # @return [PolicyStatesQueryResults] operation results.
2937
+ #
2938
+ def list_query_results_for_resource_group_level_policy_assignment_next(next_page_link, custom_headers:nil)
2939
+ response = list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2940
+ response.body unless response.nil?
2941
+ end
2942
+
2943
+ #
2944
+ # Queries policy states for the resource group level policy assignment.
2945
+ #
2946
+ # @param next_page_link [String] The NextLink from the previous successful call
2947
+ # to List operation.
2948
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2949
+ # will be added to the HTTP request.
2950
+ #
2951
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2952
+ #
2953
+ def list_query_results_for_resource_group_level_policy_assignment_next_with_http_info(next_page_link, custom_headers:nil)
2954
+ list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers).value!
2955
+ end
2956
+
2957
+ #
2958
+ # Queries policy states for the resource group level policy assignment.
2959
+ #
2960
+ # @param next_page_link [String] The NextLink from the previous successful call
2961
+ # to List operation.
2962
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2963
+ # to the HTTP request.
2964
+ #
2965
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2966
+ #
2967
+ def list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:nil)
2968
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2969
+
2970
+
2971
+ request_headers = {}
2972
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2973
+
2974
+ # Set Headers
2975
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2976
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2977
+ path_template = '{nextLink}'
2978
+
2979
+ request_url = @base_url || @client.base_url
2980
+
2981
+ options = {
2982
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2983
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2984
+ headers: request_headers.merge(custom_headers || {}),
2985
+ base_url: request_url
2986
+ }
2987
+ promise = @client.make_request_async(:post, path_template, options)
2988
+
2989
+ promise = promise.then do |result|
2990
+ http_response = result.response
2991
+ status_code = http_response.status
2992
+ response_content = http_response.body
2993
+ unless status_code == 200
2994
+ error_model = JSON.load(response_content)
2995
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2996
+ end
2997
+
2998
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2999
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3000
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3001
+ # Deserialize Response
3002
+ if status_code == 200
3003
+ begin
3004
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3005
+ result_mapper = Azure::PolicyInsights::Mgmt::V2019_10_01::Models::PolicyStatesQueryResults.mapper()
3006
+ result.body = @client.deserialize(result_mapper, parsed_response)
3007
+ rescue Exception => e
3008
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3009
+ end
3010
+ end
3011
+
3012
+ result
3013
+ end
3014
+
3015
+ promise.execute
3016
+ end
3017
+
3018
+ #
3019
+ # Queries policy states for the resources under the management group.
3020
+ #
3021
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3022
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3023
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3024
+ # Possible values include: 'default', 'latest'
3025
+ # @param management_group_name [String] Management group name.
3026
+ # @param query_options [QueryOptions] Additional parameters for the operation
3027
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3028
+ # will be added to the HTTP request.
3029
+ #
3030
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3031
+ # response.
3032
+ #
3033
+ def list_query_results_for_management_group_as_lazy(policy_states_resource, management_group_name, query_options:nil, custom_headers:nil)
3034
+ response = list_query_results_for_management_group_async(policy_states_resource, management_group_name, query_options:query_options, custom_headers:custom_headers).value!
3035
+ unless response.nil?
3036
+ page = response.body
3037
+ page.next_method = Proc.new do |next_page_link|
3038
+ list_query_results_for_management_group_next_async(next_page_link, custom_headers:custom_headers)
3039
+ end
3040
+ page
3041
+ end
3042
+ end
3043
+
3044
+ #
3045
+ # Queries policy states for the resources under the subscription.
3046
+ #
3047
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3048
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3049
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3050
+ # Possible values include: 'default', 'latest'
3051
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3052
+ # @param query_options [QueryOptions] Additional parameters for the operation
3053
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3054
+ # will be added to the HTTP request.
3055
+ #
3056
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3057
+ # response.
3058
+ #
3059
+ def list_query_results_for_subscription_as_lazy(policy_states_resource, subscription_id, query_options:nil, custom_headers:nil)
3060
+ response = list_query_results_for_subscription_async(policy_states_resource, subscription_id, query_options:query_options, custom_headers:custom_headers).value!
3061
+ unless response.nil?
3062
+ page = response.body
3063
+ page.next_method = Proc.new do |next_page_link|
3064
+ list_query_results_for_subscription_next_async(next_page_link, custom_headers:custom_headers)
3065
+ end
3066
+ page
3067
+ end
3068
+ end
3069
+
3070
+ #
3071
+ # Queries policy states for the resources under the resource group.
3072
+ #
3073
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3074
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3075
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3076
+ # Possible values include: 'default', 'latest'
3077
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3078
+ # @param resource_group_name [String] Resource group name.
3079
+ # @param query_options [QueryOptions] Additional parameters for the operation
3080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3081
+ # will be added to the HTTP request.
3082
+ #
3083
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3084
+ # response.
3085
+ #
3086
+ def list_query_results_for_resource_group_as_lazy(policy_states_resource, subscription_id, resource_group_name, query_options:nil, custom_headers:nil)
3087
+ 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!
3088
+ unless response.nil?
3089
+ page = response.body
3090
+ page.next_method = Proc.new do |next_page_link|
3091
+ list_query_results_for_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3092
+ end
3093
+ page
3094
+ end
3095
+ end
3096
+
3097
+ #
3098
+ # Queries policy states for the resource.
3099
+ #
3100
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3101
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3102
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3103
+ # Possible values include: 'default', 'latest'
3104
+ # @param resource_id [String] Resource ID.
3105
+ # @param query_options [QueryOptions] Additional parameters for the operation
3106
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3107
+ # will be added to the HTTP request.
3108
+ #
3109
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3110
+ # response.
3111
+ #
3112
+ def list_query_results_for_resource_as_lazy(policy_states_resource, resource_id, query_options:nil, custom_headers:nil)
3113
+ response = list_query_results_for_resource_async(policy_states_resource, resource_id, query_options:query_options, custom_headers:custom_headers).value!
3114
+ unless response.nil?
3115
+ page = response.body
3116
+ page.next_method = Proc.new do |next_page_link|
3117
+ list_query_results_for_resource_next_async(next_page_link, custom_headers:custom_headers)
3118
+ end
3119
+ page
3120
+ end
3121
+ end
3122
+
3123
+ #
3124
+ # Queries policy states for the subscription level policy set definition.
3125
+ #
3126
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3127
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3128
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3129
+ # Possible values include: 'default', 'latest'
3130
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3131
+ # @param policy_set_definition_name [String] Policy set definition name.
3132
+ # @param query_options [QueryOptions] Additional parameters for the operation
3133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3134
+ # will be added to the HTTP request.
3135
+ #
3136
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3137
+ # response.
3138
+ #
3139
+ 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)
3140
+ 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!
3141
+ unless response.nil?
3142
+ page = response.body
3143
+ page.next_method = Proc.new do |next_page_link|
3144
+ list_query_results_for_policy_set_definition_next_async(next_page_link, custom_headers:custom_headers)
3145
+ end
3146
+ page
3147
+ end
3148
+ end
3149
+
3150
+ #
3151
+ # Queries policy states for the subscription level policy definition.
3152
+ #
3153
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3154
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3155
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3156
+ # Possible values include: 'default', 'latest'
3157
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3158
+ # @param policy_definition_name [String] Policy definition name.
3159
+ # @param query_options [QueryOptions] Additional parameters for the operation
3160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3161
+ # will be added to the HTTP request.
3162
+ #
3163
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3164
+ # response.
3165
+ #
3166
+ def list_query_results_for_policy_definition_as_lazy(policy_states_resource, subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
3167
+ 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!
3168
+ unless response.nil?
3169
+ page = response.body
3170
+ page.next_method = Proc.new do |next_page_link|
3171
+ list_query_results_for_policy_definition_next_async(next_page_link, custom_headers:custom_headers)
3172
+ end
3173
+ page
3174
+ end
3175
+ end
3176
+
3177
+ #
3178
+ # Queries policy states for the subscription level policy assignment.
3179
+ #
3180
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3181
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3182
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3183
+ # Possible values include: 'default', 'latest'
3184
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3185
+ # @param policy_assignment_name [String] Policy assignment name.
3186
+ # @param query_options [QueryOptions] Additional parameters for the operation
3187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3188
+ # will be added to the HTTP request.
3189
+ #
3190
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3191
+ # response.
3192
+ #
3193
+ 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)
3194
+ 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!
3195
+ unless response.nil?
3196
+ page = response.body
3197
+ page.next_method = Proc.new do |next_page_link|
3198
+ list_query_results_for_subscription_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers)
3199
+ end
3200
+ page
3201
+ end
3202
+ end
3203
+
3204
+ #
3205
+ # Queries policy states for the resource group level policy assignment.
3206
+ #
3207
+ # @param policy_states_resource [PolicyStatesResource] The virtual resource
3208
+ # under PolicyStates resource type. In a given time range, 'latest' represents
3209
+ # the latest policy state(s), whereas 'default' represents all policy state(s).
3210
+ # Possible values include: 'default', 'latest'
3211
+ # @param subscription_id [String] Microsoft Azure subscription ID.
3212
+ # @param resource_group_name [String] Resource group name.
3213
+ # @param policy_assignment_name [String] Policy assignment name.
3214
+ # @param query_options [QueryOptions] Additional parameters for the operation
3215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3216
+ # will be added to the HTTP request.
3217
+ #
3218
+ # @return [PolicyStatesQueryResults] which provide lazy access to pages of the
3219
+ # response.
3220
+ #
3221
+ 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)
3222
+ 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!
3223
+ unless response.nil?
3224
+ page = response.body
3225
+ page.next_method = Proc.new do |next_page_link|
3226
+ list_query_results_for_resource_group_level_policy_assignment_next_async(next_page_link, custom_headers:custom_headers)
3227
+ end
3228
+ page
3229
+ end
3230
+ end
3231
+
2266
3232
  end
2267
3233
  end