azure_mgmt_policy 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,8 @@
4
4
 
5
5
  require 'azure_mgmt_policy'
6
6
 
7
- module Azure::Policy::Profiles::Latest::Mgmt
7
+ module Azure::Policy::Profiles::Latest
8
+ module Mgmt
8
9
  PolicyDefinitions = Azure::Policy::Mgmt::V2016_12_01::PolicyDefinitions
9
10
  PolicyAssignments = Azure::Policy::Mgmt::V2017_06_01_preview::PolicyAssignments
10
11
  PolicySetDefinitions = Azure::Policy::Mgmt::V2017_06_01_preview::PolicySetDefinitions
@@ -24,9 +25,9 @@ module Azure::Policy::Profiles::Latest::Mgmt
24
25
  end
25
26
 
26
27
  #
27
- # Policy
28
+ # PolicyManagementClass
28
29
  #
29
- class PolicyClass
30
+ class PolicyManagementClass
30
31
  attr_reader :policy_definitions, :policy_assignments, :policy_set_definitions, :configurable, :base_url, :options, :model_classes
31
32
 
32
33
  def initialize(options = {})
@@ -38,58 +39,79 @@ module Azure::Policy::Profiles::Latest::Mgmt
38
39
 
39
40
  reset!(options)
40
41
 
41
- @configurable, @base_url, @options = self, nil, nil
42
+ @configurable = self
43
+ @base_url = options[:base_url].nil? ? nil:options[:base_url]
44
+ @options = options[:options].nil? ? nil:options[:options]
42
45
 
43
- client_0 = Azure::Policy::Mgmt::V2016_12_01::PolicyClient.new(configurable.credentials, base_url, options)
44
- if(client_0.respond_to?(:subscription_id))
45
- client_0.subscription_id = configurable.subscription_id
46
+ @client_0 = Azure::Policy::Mgmt::V2016_12_01::PolicyClient.new(configurable.credentials, base_url, options)
47
+ if(@client_0.respond_to?(:subscription_id))
48
+ @client_0.subscription_id = configurable.subscription_id
46
49
  end
47
- @policy_definitions = client_0.policy_definitions
50
+ add_telemetry(@client_0)
51
+ @policy_definitions = @client_0.policy_definitions
48
52
 
49
- client_1 = Azure::Policy::Mgmt::V2017_06_01_preview::PolicyClient.new(configurable.credentials, base_url, options)
50
- if(client_1.respond_to?(:subscription_id))
51
- client_1.subscription_id = configurable.subscription_id
53
+ @client_1 = Azure::Policy::Mgmt::V2017_06_01_preview::PolicyClient.new(configurable.credentials, base_url, options)
54
+ if(@client_1.respond_to?(:subscription_id))
55
+ @client_1.subscription_id = configurable.subscription_id
52
56
  end
53
- @policy_assignments = client_1.policy_assignments
54
- @policy_set_definitions = client_1.policy_set_definitions
57
+ add_telemetry(@client_1)
58
+ @policy_assignments = @client_1.policy_assignments
59
+ @policy_set_definitions = @client_1.policy_set_definitions
55
60
 
56
61
  @model_classes = ModelClasses.new
57
62
  end
58
63
 
59
- class ModelClasses
60
- def policy_definition
61
- Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition
62
- end
63
- def policy_definition_list_result
64
- Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult
65
- end
66
- def policy_mode
67
- Azure::Policy::Mgmt::V2016_12_01::Models::PolicyMode
68
- end
69
- def error_response
70
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::ErrorResponse
71
- end
72
- def policy_definition_reference
73
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyDefinitionReference
74
- end
75
- def policy_assignment
76
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyAssignment
77
- end
78
- def policy_set_definition
79
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition
80
- end
81
- def policy_sku
82
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySku
83
- end
84
- def policy_set_definition_list_result
85
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult
86
- end
87
- def policy_assignment_list_result
88
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyAssignmentListResult
89
- end
90
- def policy_type
91
- Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyType
64
+ def add_telemetry(client)
65
+ profile_information = 'Profiles/Latest/Policy/Mgmt'
66
+ client.add_user_agent_information(profile_information)
67
+ end
68
+
69
+ def method_missing(method, *args)
70
+ if @client_1.respond_to?method
71
+ @client_1.send(method, *args)
72
+ elsif @client_0.respond_to?method
73
+ @client_0.send(method, *args)
74
+ else
75
+ super
92
76
  end
93
77
  end
78
+
79
+ end
80
+
81
+ class ModelClasses
82
+ def policy_definition
83
+ Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinition
84
+ end
85
+ def policy_definition_list_result
86
+ Azure::Policy::Mgmt::V2016_12_01::Models::PolicyDefinitionListResult
87
+ end
88
+ def policy_mode
89
+ Azure::Policy::Mgmt::V2016_12_01::Models::PolicyMode
90
+ end
91
+ def error_response
92
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::ErrorResponse
93
+ end
94
+ def policy_definition_reference
95
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyDefinitionReference
96
+ end
97
+ def policy_assignment
98
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyAssignment
99
+ end
100
+ def policy_set_definition
101
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinition
102
+ end
103
+ def policy_sku
104
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySku
105
+ end
106
+ def policy_set_definition_list_result
107
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicySetDefinitionListResult
108
+ end
109
+ def policy_assignment_list_result
110
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyAssignmentListResult
111
+ end
112
+ def policy_type
113
+ Azure::Policy::Mgmt::V2017_06_01_preview::Models::PolicyType
114
+ end
94
115
  end
116
+ end
95
117
  end
@@ -5,17 +5,36 @@
5
5
  require 'profiles/latest/policy_module_definition'
6
6
  require 'profiles/latest/modules/policy_profile_module'
7
7
 
8
- module Azure::Policy::Profiles::Latest::Mgmt
9
- #
10
- # Client class for the Latest profile SDK.
11
- #
12
- class Client < PolicyClass
13
- include MsRestAzure::Common::Configurable
8
+ module Azure::Policy::Profiles::Latest
9
+ module Mgmt
10
+ #
11
+ # Client class for the Latest profile SDK.
12
+ #
13
+ class Client < PolicyManagementClass
14
+ include MsRestAzure::Common::Configurable
14
15
 
16
+ #
17
+ # Initializes a new instance of the Client class.
18
+ # @param options [Hash] hash of client options.
19
+ # options = {
20
+ # tenant_id: 'YOUR TENANT ID',
21
+ # client_id: 'YOUR CLIENT ID',
22
+ # client_secret: 'YOUR CLIENT SECRET',
23
+ # subscription_id: 'YOUR SUBSCRIPTION ID',
24
+ # credentials: credentials,
25
+ # active_directory_settings: active_directory_settings,
26
+ # base_url: 'YOUR BASE URL',
27
+ # options: options
28
+ # }
29
+ # 'credentials' are optional and if not passed in the hash, will be obtained
30
+ # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
31
+ #
32
+ # Also, base_url, active_directory_settings & options are optional.
33
+ #
34
+ def initialize(options = {})
35
+ super(options)
36
+ end
15
37
 
16
- def initialize(options = {})
17
- super(options)
18
38
  end
19
-
20
39
  end
21
40
  end
@@ -6,4 +6,3 @@ module Azure end
6
6
  module Azure::Policy end
7
7
  module Azure::Policy::Profiles end
8
8
  module Azure::Policy::Profiles::Latest end
9
- module Azure::Policy::Profiles::Latest::Mgmt end
@@ -4,7 +4,8 @@
4
4
 
5
5
  require 'azure_mgmt_policy'
6
6
 
7
- module Azure::Policy::Profiles::V2017_03_09::Mgmt
7
+ module Azure::Policy::Profiles::V2017_03_09
8
+ module Mgmt
8
9
  PolicyAssignments = Azure::Policy::Mgmt::V2015_10_01_preview::PolicyAssignments
9
10
  PolicyDefinitions = Azure::Policy::Mgmt::V2015_10_01_preview::PolicyDefinitions
10
11
 
@@ -17,9 +18,9 @@ module Azure::Policy::Profiles::V2017_03_09::Mgmt
17
18
  end
18
19
 
19
20
  #
20
- # Policy
21
+ # PolicyManagementClass
21
22
  #
22
- class PolicyClass
23
+ class PolicyManagementClass
23
24
  attr_reader :policy_assignments, :policy_definitions, :configurable, :base_url, :options, :model_classes
24
25
 
25
26
  def initialize(options = {})
@@ -31,34 +32,52 @@ module Azure::Policy::Profiles::V2017_03_09::Mgmt
31
32
 
32
33
  reset!(options)
33
34
 
34
- @configurable, @base_url, @options = self, nil, nil
35
+ @configurable = self
36
+ @base_url = options[:base_url].nil? ? nil:options[:base_url]
37
+ @options = options[:options].nil? ? nil:options[:options]
35
38
 
36
- client_0 = Azure::Policy::Mgmt::V2015_10_01_preview::PolicyClient.new(configurable.credentials, base_url, options)
37
- if(client_0.respond_to?(:subscription_id))
38
- client_0.subscription_id = configurable.subscription_id
39
+ @client_0 = Azure::Policy::Mgmt::V2015_10_01_preview::PolicyClient.new(configurable.credentials, base_url, options)
40
+ if(@client_0.respond_to?(:subscription_id))
41
+ @client_0.subscription_id = configurable.subscription_id
39
42
  end
40
- @policy_assignments = client_0.policy_assignments
41
- @policy_definitions = client_0.policy_definitions
43
+ add_telemetry(@client_0)
44
+ @policy_assignments = @client_0.policy_assignments
45
+ @policy_definitions = @client_0.policy_definitions
42
46
 
43
47
  @model_classes = ModelClasses.new
44
48
  end
45
49
 
46
- class ModelClasses
47
- def policy_assignment
48
- Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyAssignment
49
- end
50
- def policy_definition
51
- Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyDefinition
52
- end
53
- def policy_assignment_list_result
54
- Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyAssignmentListResult
55
- end
56
- def policy_definition_list_result
57
- Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyDefinitionListResult
58
- end
59
- def policy_type
60
- Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyType
50
+ def add_telemetry(client)
51
+ profile_information = 'Profiles/V2017_03_09/Policy/Mgmt'
52
+ client.add_user_agent_information(profile_information)
53
+ end
54
+
55
+ def method_missing(method, *args)
56
+ if @client_0.respond_to?method
57
+ @client_0.send(method, *args)
58
+ else
59
+ super
61
60
  end
62
61
  end
62
+
63
+ end
64
+
65
+ class ModelClasses
66
+ def policy_assignment
67
+ Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyAssignment
68
+ end
69
+ def policy_definition
70
+ Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyDefinition
71
+ end
72
+ def policy_assignment_list_result
73
+ Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyAssignmentListResult
74
+ end
75
+ def policy_definition_list_result
76
+ Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyDefinitionListResult
77
+ end
78
+ def policy_type
79
+ Azure::Policy::Mgmt::V2015_10_01_preview::Models::PolicyType
80
+ end
63
81
  end
82
+ end
64
83
  end
@@ -6,4 +6,3 @@ module Azure end
6
6
  module Azure::Policy end
7
7
  module Azure::Policy::Profiles end
8
8
  module Azure::Policy::Profiles::V2017_03_09 end
9
- module Azure::Policy::Profiles::V2017_03_09::Mgmt end
@@ -5,17 +5,36 @@
5
5
  require 'profiles/v2017_03_09/policy_module_definition'
6
6
  require 'profiles/v2017_03_09/modules/policy_profile_module'
7
7
 
8
- module Azure::Policy::Profiles::V2017_03_09::Mgmt
9
- #
10
- # Client class for the V2017_03_09 profile SDK.
11
- #
12
- class Client < PolicyClass
13
- include MsRestAzure::Common::Configurable
8
+ module Azure::Policy::Profiles::V2017_03_09
9
+ module Mgmt
10
+ #
11
+ # Client class for the V2017_03_09 profile SDK.
12
+ #
13
+ class Client < PolicyManagementClass
14
+ include MsRestAzure::Common::Configurable
14
15
 
16
+ #
17
+ # Initializes a new instance of the Client class.
18
+ # @param options [Hash] hash of client options.
19
+ # options = {
20
+ # tenant_id: 'YOUR TENANT ID',
21
+ # client_id: 'YOUR CLIENT ID',
22
+ # client_secret: 'YOUR CLIENT SECRET',
23
+ # subscription_id: 'YOUR SUBSCRIPTION ID',
24
+ # credentials: credentials,
25
+ # active_directory_settings: active_directory_settings,
26
+ # base_url: 'YOUR BASE URL',
27
+ # options: options
28
+ # }
29
+ # 'credentials' are optional and if not passed in the hash, will be obtained
30
+ # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
31
+ #
32
+ # Also, base_url, active_directory_settings & options are optional.
33
+ #
34
+ def initialize(options = {})
35
+ super(options)
36
+ end
15
37
 
16
- def initialize(options = {})
17
- super(options)
18
38
  end
19
-
20
39
  end
21
40
  end
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::Policy::Mgmt
6
- VERSION = '0.15.2'
6
+ VERSION = '0.16.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-19 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  version: '0'
166
166
  requirements: []
167
167
  rubyforge_project:
168
- rubygems_version: 2.5.1
168
+ rubygems_version: 2.6.10
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: Official Ruby client library to consume Microsoft Azure Resource Policy Management