azure_mgmt_policy 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-10-01-preview/generated/azure_mgmt_policy.rb +34 -0
  3. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_assignment.rb +94 -0
  4. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
  5. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_definition.rb +98 -0
  6. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_definition_list_result.rb +94 -0
  7. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
  8. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/module_definition.rb +9 -0
  9. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
  10. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_client.rb +133 -0
  11. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/policy_definitions.rb +492 -0
  12. data/lib/2015-10-01-preview/generated/azure_mgmt_policy/version.rb +8 -0
  13. data/lib/2016-04-01/generated/azure_mgmt_policy.rb +34 -0
  14. data/lib/2016-04-01/generated/azure_mgmt_policy/models/policy_assignment.rb +94 -0
  15. data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_assignment_list_result.rb +1 -1
  16. data/lib/2016-04-01/generated/azure_mgmt_policy/models/policy_definition.rb +98 -0
  17. data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_definition_list_result.rb +1 -1
  18. data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/models/policy_type.rb +1 -1
  19. data/lib/2016-04-01/generated/azure_mgmt_policy/module_definition.rb +9 -0
  20. data/lib/2016-04-01/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
  21. data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/policy_client.rb +7 -7
  22. data/lib/2016-04-01/generated/azure_mgmt_policy/policy_definitions.rb +492 -0
  23. data/lib/{generated → 2016-04-01/generated}/azure_mgmt_policy/version.rb +2 -2
  24. data/lib/2016-12-01/generated/azure_mgmt_policy.rb +35 -0
  25. data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_assignment.rb +116 -0
  26. data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
  27. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/models/policy_definition.rb +1 -1
  28. data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_definition_list_result.rb +94 -0
  29. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/models/policy_mode.rb +1 -1
  30. data/lib/2016-12-01/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
  31. data/lib/2016-12-01/generated/azure_mgmt_policy/module_definition.rb +9 -0
  32. data/lib/2016-12-01/generated/azure_mgmt_policy/policy_assignments.rb +1318 -0
  33. data/lib/2016-12-01/generated/azure_mgmt_policy/policy_client.rb +133 -0
  34. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_policy/policy_definitions.rb +34 -34
  35. data/lib/{generated/azure_mgmt_policy/module_definition.rb → 2016-12-01/generated/azure_mgmt_policy/version.rb} +3 -3
  36. data/lib/2017-06-01-preview/generated/azure_mgmt_policy.rb +37 -0
  37. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/error_response.rb +1 -1
  38. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_assignment.rb +1 -1
  39. data/lib/2017-06-01-preview/generated/azure_mgmt_policy/models/policy_assignment_list_result.rb +94 -0
  40. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_definition_reference.rb +1 -1
  41. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_set_definition.rb +1 -1
  42. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_set_definition_list_result.rb +1 -1
  43. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/models/policy_sku.rb +1 -1
  44. data/lib/2017-06-01-preview/generated/azure_mgmt_policy/models/policy_type.rb +17 -0
  45. data/lib/2017-06-01-preview/generated/azure_mgmt_policy/module_definition.rb +9 -0
  46. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/policy_assignments.rb +33 -33
  47. data/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_client.rb +133 -0
  48. data/lib/{generated → 2017-06-01-preview/generated}/azure_mgmt_policy/policy_set_definitions.rb +36 -36
  49. data/lib/2017-06-01-preview/generated/azure_mgmt_policy/version.rb +8 -0
  50. data/lib/azure_mgmt_policy.rb +6 -1
  51. data/lib/module_definition.rb +7 -0
  52. data/lib/profiles/common/configurable.rb +73 -0
  53. data/lib/profiles/common/default.rb +68 -0
  54. data/lib/profiles/latest/modules/policy_profile_module.rb +95 -0
  55. data/lib/profiles/latest/policy_latest_profile_client.rb +33 -0
  56. data/lib/profiles/latest/policy_module_definition.rb +9 -0
  57. data/lib/profiles/v2017_03_09/modules/policy_profile_module.rb +64 -0
  58. data/lib/profiles/v2017_03_09/policy_module_definition.rb +9 -0
  59. data/lib/profiles/v2017_03_09/policy_v2017_03_09_profile_client.rb +33 -0
  60. data/lib/version.rb +7 -0
  61. metadata +60 -20
  62. data/lib/generated/azure_mgmt_policy.rb +0 -41
@@ -0,0 +1,133 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Policy::Mgmt::V2017_06_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class PolicyClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The ID of the target subscription.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The API version to use for the operation.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] Gets or sets the preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
30
+ # Running Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
34
+ # is generated and included in each request. Default is true.
35
+ attr_accessor :generate_client_request_id
36
+
37
+ # @return [PolicyAssignments] policy_assignments
38
+ attr_reader :policy_assignments
39
+
40
+ # @return [PolicySetDefinitions] policy_set_definitions
41
+ attr_reader :policy_set_definitions
42
+
43
+ #
44
+ # Creates initializes a new instance of the PolicyClient class.
45
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
46
+ # @param base_url [String] the base URI of the service.
47
+ # @param options [Array] filters to be applied to the HTTP requests.
48
+ #
49
+ def initialize(credentials = nil, base_url = nil, options = nil)
50
+ super(credentials, options)
51
+ @base_url = base_url || 'https://management.azure.com'
52
+
53
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
54
+ @credentials = credentials
55
+
56
+ @policy_assignments = PolicyAssignments.new(self)
57
+ @policy_set_definitions = PolicySetDefinitions.new(self)
58
+ @api_version = '2017-06-01-preview'
59
+ @accept_language = 'en-US'
60
+ @long_running_operation_retry_timeout = 30
61
+ @generate_client_request_id = true
62
+ add_telemetry
63
+ end
64
+
65
+ #
66
+ # Makes a request and returns the body of the response.
67
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
68
+ # @param path [String] the path, relative to {base_url}.
69
+ # @param options [Hash{String=>String}] specifying any request options like :body.
70
+ # @return [Hash{String=>String}] containing the body of the response.
71
+ # Example:
72
+ #
73
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
74
+ # path = "/path"
75
+ # options = {
76
+ # body: request_content,
77
+ # query_params: {'api-version' => '2016-02-01'}
78
+ # }
79
+ # result = @client.make_request(:put, path, options)
80
+ #
81
+ def make_request(method, path, options = {})
82
+ result = make_request_with_http_info(method, path, options)
83
+ result.body unless result.nil?
84
+ end
85
+
86
+ #
87
+ # Makes a request and returns the operation response.
88
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
89
+ # @param path [String] the path, relative to {base_url}.
90
+ # @param options [Hash{String=>String}] specifying any request options like :body.
91
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
92
+ #
93
+ def make_request_with_http_info(method, path, options = {})
94
+ result = make_request_async(method, path, options).value!
95
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
96
+ result
97
+ end
98
+
99
+ #
100
+ # Makes a request asynchronously.
101
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
102
+ # @param path [String] the path, relative to {base_url}.
103
+ # @param options [Hash{String=>String}] specifying any request options like :body.
104
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
105
+ #
106
+ def make_request_async(method, path, options = {})
107
+ fail ArgumentError, 'method is nil' if method.nil?
108
+ fail ArgumentError, 'path is nil' if path.nil?
109
+
110
+ request_url = options[:base_url] || @base_url
111
+
112
+ request_headers = @request_headers
113
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
114
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
115
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
116
+
117
+ super(request_url, method, path, options)
118
+ end
119
+
120
+
121
+ private
122
+ #
123
+ # Adds telemetry information.
124
+ #
125
+ def add_telemetry
126
+ sdk_information = 'azure_mgmt_policy'
127
+ if defined? Azure::Policy::Mgmt::V2017_06_01_preview::VERSION
128
+ sdk_information = "#{sdk_information}/#{Azure::Policy::Mgmt::V2017_06_01_preview::VERSION}"
129
+ end
130
+ add_user_agent_information(sdk_information)
131
+ end
132
+ end
133
+ end
@@ -3,7 +3,7 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure::ARM::Policy
6
+ module Azure::Policy::Mgmt::V2017_06_01_preview
7
7
  #
8
8
  # To manage and control access to your resources, you can define customized
9
9
  # policies and assign them at a scope.
@@ -67,7 +67,7 @@ module Azure::ARM::Policy
67
67
  def create_or_update_async(policy_set_definition_name, parameters, custom_headers = nil)
68
68
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
69
69
  fail ArgumentError, 'parameters is nil' if parameters.nil?
70
- api_version = '2017-06-01-preview'
70
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
71
71
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
72
 
73
73
 
@@ -80,7 +80,7 @@ module Azure::ARM::Policy
80
80
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
81
 
82
82
  # Serialize Request
83
- request_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
83
+ request_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
84
84
  request_content = @client.serialize(request_mapper, parameters)
85
85
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
86
86
 
@@ -91,7 +91,7 @@ module Azure::ARM::Policy
91
91
  options = {
92
92
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
93
93
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'subscriptionId' => @client.subscription_id},
94
- query_params: {'api-version' => api_version},
94
+ query_params: {'api-version' => @client.api_version},
95
95
  body: request_content,
96
96
  headers: request_headers.merge(custom_headers || {}),
97
97
  base_url: request_url
@@ -112,7 +112,7 @@ module Azure::ARM::Policy
112
112
  if status_code == 201
113
113
  begin
114
114
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
115
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
116
116
  result.body = @client.deserialize(result_mapper, parsed_response)
117
117
  rescue Exception => e
118
118
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -122,7 +122,7 @@ module Azure::ARM::Policy
122
122
  if status_code == 200
123
123
  begin
124
124
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
125
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
125
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
126
126
  result.body = @client.deserialize(result_mapper, parsed_response)
127
127
  rescue Exception => e
128
128
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -175,7 +175,7 @@ module Azure::ARM::Policy
175
175
  #
176
176
  def delete_async(policy_set_definition_name, custom_headers = nil)
177
177
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
178
- api_version = '2017-06-01-preview'
178
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
179
179
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
180
180
 
181
181
 
@@ -191,7 +191,7 @@ module Azure::ARM::Policy
191
191
  options = {
192
192
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
193
193
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'subscriptionId' => @client.subscription_id},
194
- query_params: {'api-version' => api_version},
194
+ query_params: {'api-version' => @client.api_version},
195
195
  headers: request_headers.merge(custom_headers || {}),
196
196
  base_url: request_url
197
197
  }
@@ -255,7 +255,7 @@ module Azure::ARM::Policy
255
255
  #
256
256
  def get_async(policy_set_definition_name, custom_headers = nil)
257
257
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
258
- api_version = '2017-06-01-preview'
258
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
259
259
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
260
260
 
261
261
 
@@ -271,7 +271,7 @@ module Azure::ARM::Policy
271
271
  options = {
272
272
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
273
273
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'subscriptionId' => @client.subscription_id},
274
- query_params: {'api-version' => api_version},
274
+ query_params: {'api-version' => @client.api_version},
275
275
  headers: request_headers.merge(custom_headers || {}),
276
276
  base_url: request_url
277
277
  }
@@ -291,7 +291,7 @@ module Azure::ARM::Policy
291
291
  if status_code == 200
292
292
  begin
293
293
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
294
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
294
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
295
295
  result.body = @client.deserialize(result_mapper, parsed_response)
296
296
  rescue Exception => e
297
297
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -345,7 +345,7 @@ module Azure::ARM::Policy
345
345
  #
346
346
  def get_built_in_async(policy_set_definition_name, custom_headers = nil)
347
347
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
348
- api_version = '2017-06-01-preview'
348
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
349
349
 
350
350
 
351
351
  request_headers = {}
@@ -360,7 +360,7 @@ module Azure::ARM::Policy
360
360
  options = {
361
361
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
362
362
  path_params: {'policySetDefinitionName' => policy_set_definition_name},
363
- query_params: {'api-version' => api_version},
363
+ query_params: {'api-version' => @client.api_version},
364
364
  headers: request_headers.merge(custom_headers || {}),
365
365
  base_url: request_url
366
366
  }
@@ -380,7 +380,7 @@ module Azure::ARM::Policy
380
380
  if status_code == 200
381
381
  begin
382
382
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
383
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
383
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
384
384
  result.body = @client.deserialize(result_mapper, parsed_response)
385
385
  rescue Exception => e
386
386
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -427,7 +427,7 @@ module Azure::ARM::Policy
427
427
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
428
428
  #
429
429
  def list_async(custom_headers = nil)
430
- api_version = '2017-06-01-preview'
430
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
431
431
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
432
432
 
433
433
 
@@ -443,7 +443,7 @@ module Azure::ARM::Policy
443
443
  options = {
444
444
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
445
445
  path_params: {'subscriptionId' => @client.subscription_id},
446
- query_params: {'api-version' => api_version},
446
+ query_params: {'api-version' => @client.api_version},
447
447
  headers: request_headers.merge(custom_headers || {}),
448
448
  base_url: request_url
449
449
  }
@@ -463,7 +463,7 @@ module Azure::ARM::Policy
463
463
  if status_code == 200
464
464
  begin
465
465
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
466
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
466
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
467
467
  result.body = @client.deserialize(result_mapper, parsed_response)
468
468
  rescue Exception => e
469
469
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -510,7 +510,7 @@ module Azure::ARM::Policy
510
510
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
511
511
  #
512
512
  def list_built_in_async(custom_headers = nil)
513
- api_version = '2017-06-01-preview'
513
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
514
514
 
515
515
 
516
516
  request_headers = {}
@@ -524,7 +524,7 @@ module Azure::ARM::Policy
524
524
 
525
525
  options = {
526
526
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
527
- query_params: {'api-version' => api_version},
527
+ query_params: {'api-version' => @client.api_version},
528
528
  headers: request_headers.merge(custom_headers || {}),
529
529
  base_url: request_url
530
530
  }
@@ -544,7 +544,7 @@ module Azure::ARM::Policy
544
544
  if status_code == 200
545
545
  begin
546
546
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
547
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
548
548
  result.body = @client.deserialize(result_mapper, parsed_response)
549
549
  rescue Exception => e
550
550
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -605,7 +605,7 @@ module Azure::ARM::Policy
605
605
  def create_or_update_at_management_group_async(policy_set_definition_name, parameters, management_group_id, custom_headers = nil)
606
606
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
607
607
  fail ArgumentError, 'parameters is nil' if parameters.nil?
608
- api_version = '2017-06-01-preview'
608
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
609
609
  fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
610
610
 
611
611
 
@@ -618,7 +618,7 @@ module Azure::ARM::Policy
618
618
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
619
619
 
620
620
  # Serialize Request
621
- request_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
621
+ request_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
622
622
  request_content = @client.serialize(request_mapper, parameters)
623
623
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
624
624
 
@@ -629,7 +629,7 @@ module Azure::ARM::Policy
629
629
  options = {
630
630
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
631
631
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'managementGroupId' => management_group_id},
632
- query_params: {'api-version' => api_version},
632
+ query_params: {'api-version' => @client.api_version},
633
633
  body: request_content,
634
634
  headers: request_headers.merge(custom_headers || {}),
635
635
  base_url: request_url
@@ -650,7 +650,7 @@ module Azure::ARM::Policy
650
650
  if status_code == 201
651
651
  begin
652
652
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
653
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
653
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
654
654
  result.body = @client.deserialize(result_mapper, parsed_response)
655
655
  rescue Exception => e
656
656
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -660,7 +660,7 @@ module Azure::ARM::Policy
660
660
  if status_code == 200
661
661
  begin
662
662
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
663
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
663
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
664
664
  result.body = @client.deserialize(result_mapper, parsed_response)
665
665
  rescue Exception => e
666
666
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -716,7 +716,7 @@ module Azure::ARM::Policy
716
716
  #
717
717
  def delete_at_management_group_async(policy_set_definition_name, management_group_id, custom_headers = nil)
718
718
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
719
- api_version = '2017-06-01-preview'
719
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
720
720
  fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
721
721
 
722
722
 
@@ -732,7 +732,7 @@ module Azure::ARM::Policy
732
732
  options = {
733
733
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
734
734
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'managementGroupId' => management_group_id},
735
- query_params: {'api-version' => api_version},
735
+ query_params: {'api-version' => @client.api_version},
736
736
  headers: request_headers.merge(custom_headers || {}),
737
737
  base_url: request_url
738
738
  }
@@ -799,7 +799,7 @@ module Azure::ARM::Policy
799
799
  #
800
800
  def get_at_management_group_async(policy_set_definition_name, management_group_id, custom_headers = nil)
801
801
  fail ArgumentError, 'policy_set_definition_name is nil' if policy_set_definition_name.nil?
802
- api_version = '2017-06-01-preview'
802
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
803
803
  fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
804
804
 
805
805
 
@@ -815,7 +815,7 @@ module Azure::ARM::Policy
815
815
  options = {
816
816
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
817
817
  path_params: {'policySetDefinitionName' => policy_set_definition_name,'managementGroupId' => management_group_id},
818
- query_params: {'api-version' => api_version},
818
+ query_params: {'api-version' => @client.api_version},
819
819
  headers: request_headers.merge(custom_headers || {}),
820
820
  base_url: request_url
821
821
  }
@@ -835,7 +835,7 @@ module Azure::ARM::Policy
835
835
  if status_code == 200
836
836
  begin
837
837
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
838
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinition.mapper()
838
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition.mapper()
839
839
  result.body = @client.deserialize(result_mapper, parsed_response)
840
840
  rescue Exception => e
841
841
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -885,7 +885,7 @@ module Azure::ARM::Policy
885
885
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
886
886
  #
887
887
  def list_by_management_group_async(management_group_id, custom_headers = nil)
888
- api_version = '2017-06-01-preview'
888
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
889
889
  fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
890
890
 
891
891
 
@@ -901,7 +901,7 @@ module Azure::ARM::Policy
901
901
  options = {
902
902
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
903
903
  path_params: {'managementGroupId' => management_group_id},
904
- query_params: {'api-version' => api_version},
904
+ query_params: {'api-version' => @client.api_version},
905
905
  headers: request_headers.merge(custom_headers || {}),
906
906
  base_url: request_url
907
907
  }
@@ -921,7 +921,7 @@ module Azure::ARM::Policy
921
921
  if status_code == 200
922
922
  begin
923
923
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
924
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
924
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
925
925
  result.body = @client.deserialize(result_mapper, parsed_response)
926
926
  rescue Exception => e
927
927
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1008,7 +1008,7 @@ module Azure::ARM::Policy
1008
1008
  if status_code == 200
1009
1009
  begin
1010
1010
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1011
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
1011
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
1012
1012
  result.body = @client.deserialize(result_mapper, parsed_response)
1013
1013
  rescue Exception => e
1014
1014
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1095,7 +1095,7 @@ module Azure::ARM::Policy
1095
1095
  if status_code == 200
1096
1096
  begin
1097
1097
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1098
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
1098
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
1099
1099
  result.body = @client.deserialize(result_mapper, parsed_response)
1100
1100
  rescue Exception => e
1101
1101
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1182,7 +1182,7 @@ module Azure::ARM::Policy
1182
1182
  if status_code == 200
1183
1183
  begin
1184
1184
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1185
- result_mapper = Azure::ARM::Policy::Models::PolicySetDefinitionListResult.mapper()
1185
+ result_mapper = Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult.mapper()
1186
1186
  result.body = @client.deserialize(result_mapper, parsed_response)
1187
1187
  rescue Exception => e
1188
1188
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Policy::Mgmt::V2017_06_01_preview
7
+ VERSION = '0.15.0'
8
+ end