azure_mgmt_subscriptions 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_subscriptions.gemspec +4 -5
  3. data/lib/azure_mgmt_subscriptions.rb +3 -34
  4. data/lib/generated/azure_mgmt_subscriptions.rb +36 -0
  5. data/lib/generated/azure_mgmt_subscriptions/models/location.rb +95 -0
  6. data/lib/generated/azure_mgmt_subscriptions/models/location_list_result.rb +52 -0
  7. data/lib/generated/azure_mgmt_subscriptions/models/subscription.rb +86 -0
  8. data/lib/generated/azure_mgmt_subscriptions/models/subscription_list_result.rb +93 -0
  9. data/lib/generated/azure_mgmt_subscriptions/models/subscription_policies.rb +54 -0
  10. data/lib/generated/azure_mgmt_subscriptions/models/tenant_id_description.rb +54 -0
  11. data/lib/generated/azure_mgmt_subscriptions/models/tenant_list_result.rb +93 -0
  12. data/lib/{azure_mgmt_subscriptions → generated/azure_mgmt_subscriptions}/module_definition.rb +0 -0
  13. data/lib/{azure_mgmt_subscriptions → generated/azure_mgmt_subscriptions}/subscription_client.rb +4 -4
  14. data/lib/{azure_mgmt_subscriptions → generated/azure_mgmt_subscriptions}/subscriptions.rb +37 -107
  15. data/lib/{azure_mgmt_subscriptions → generated/azure_mgmt_subscriptions}/tenants.rb +31 -11
  16. data/lib/{azure_mgmt_subscriptions → generated/azure_mgmt_subscriptions}/version.rb +1 -1
  17. metadata +34 -54
  18. data/lib/azure_mgmt_subscriptions/models/location.rb +0 -102
  19. data/lib/azure_mgmt_subscriptions/models/location_list_result.rb +0 -76
  20. data/lib/azure_mgmt_subscriptions/models/subscription.rb +0 -99
  21. data/lib/azure_mgmt_subscriptions/models/subscription_list_result.rb +0 -86
  22. data/lib/azure_mgmt_subscriptions/models/subscription_policies.rb +0 -65
  23. data/lib/azure_mgmt_subscriptions/models/tenant_id_description.rb +0 -65
  24. data/lib/azure_mgmt_subscriptions/models/tenant_list_result.rb +0 -86
@@ -28,11 +28,31 @@ module Azure::ARM::Subscriptions
28
28
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
29
  # will be added to the HTTP request.
30
30
  #
31
- # @return [TenantListResult] operation results.
31
+ # @return [TenantListResult] which provide lazy access to pages of the
32
+ # response.
32
33
  #
33
- def list(custom_headers = nil)
34
+ def list_as_lazy(custom_headers = nil)
34
35
  response = list_async(custom_headers).value!
35
- response.body unless response.nil?
36
+ unless response.nil?
37
+ page = response.body
38
+ page.next_method = Proc.new do |next_link|
39
+ list_next_async(next_link, custom_headers)
40
+ end
41
+ page
42
+ end
43
+ end
44
+
45
+ #
46
+ # Gets a list of the tenantIds.
47
+ #
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [Array<TenantIdDescription>] operation results.
52
+ #
53
+ def list(custom_headers = nil)
54
+ first_page = list_as_lazy(custom_headers)
55
+ first_page.get_all_items
36
56
  end
37
57
 
38
58
  #
@@ -57,6 +77,8 @@ module Azure::ARM::Subscriptions
57
77
  #
58
78
  def list_async(custom_headers = nil)
59
79
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
80
+
81
+
60
82
  request_headers = {}
61
83
 
62
84
  # Set Headers
@@ -91,10 +113,8 @@ module Azure::ARM::Subscriptions
91
113
  if status_code == 200
92
114
  begin
93
115
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
94
- unless parsed_response.nil?
95
- parsed_response = TenantListResult.deserialize_object(parsed_response)
96
- end
97
- result.body = parsed_response
116
+ result_mapper = TenantListResult.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
98
118
  rescue Exception => e
99
119
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
100
120
  end
@@ -147,6 +167,8 @@ module Azure::ARM::Subscriptions
147
167
  #
148
168
  def list_next_async(next_page_link, custom_headers = nil)
149
169
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
170
+
171
+
150
172
  request_headers = {}
151
173
 
152
174
  # Set Headers
@@ -181,10 +203,8 @@ module Azure::ARM::Subscriptions
181
203
  if status_code == 200
182
204
  begin
183
205
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
184
- unless parsed_response.nil?
185
- parsed_response = TenantListResult.deserialize_object(parsed_response)
186
- end
187
- result.body = parsed_response
206
+ result_mapper = TenantListResult.mapper()
207
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
188
208
  rescue Exception => e
189
209
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
190
210
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Subscriptions
7
- VERSION = '0.3.1'
7
+ VERSION = '0.4.0'
8
8
  end
metadata CHANGED
@@ -1,130 +1,110 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_subscriptions
3
3
  version: !ruby/object:Gem::Version
4
- version: !binary |-
5
- MC4zLjE=
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Microsoft Corporation
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-05-24 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - ~>
17
+ - - "~>"
19
18
  - !ruby/object:Gem::Version
20
19
  version: '1.9'
21
20
  type: :development
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
- - - ~>
24
+ - - "~>"
26
25
  - !ruby/object:Gem::Version
27
26
  version: '1.9'
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: rake
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
- - - ~>
31
+ - - "~>"
33
32
  - !ruby/object:Gem::Version
34
33
  version: '10'
35
34
  type: :development
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
- - - ~>
38
+ - - "~>"
40
39
  - !ruby/object:Gem::Version
41
40
  version: '10'
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rspec
44
43
  requirement: !ruby/object:Gem::Requirement
45
44
  requirements:
46
- - - ~>
45
+ - - "~>"
47
46
  - !ruby/object:Gem::Version
48
- version: !binary |-
49
- Mw==
47
+ version: '3'
50
48
  type: :development
51
49
  prerelease: false
52
50
  version_requirements: !ruby/object:Gem::Requirement
53
51
  requirements:
54
- - - ~>
52
+ - - "~>"
55
53
  - !ruby/object:Gem::Version
56
- version: !binary |-
57
- Mw==
54
+ version: '3'
58
55
  - !ruby/object:Gem::Dependency
59
56
  name: dotenv
60
57
  requirement: !ruby/object:Gem::Requirement
61
58
  requirements:
62
- - - ~>
59
+ - - "~>"
63
60
  - !ruby/object:Gem::Version
64
61
  version: '2'
65
62
  type: :development
66
63
  prerelease: false
67
64
  version_requirements: !ruby/object:Gem::Requirement
68
65
  requirements:
69
- - - ~>
66
+ - - "~>"
70
67
  - !ruby/object:Gem::Version
71
68
  version: '2'
72
- - !ruby/object:Gem::Dependency
73
- name: azure_mgmt_resources
74
- requirement: !ruby/object:Gem::Requirement
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: !binary |-
79
- MC4z
80
- type: :development
81
- prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - ~>
85
- - !ruby/object:Gem::Version
86
- version: !binary |-
87
- MC4z
88
69
  - !ruby/object:Gem::Dependency
89
70
  name: ms_rest_azure
90
71
  requirement: !ruby/object:Gem::Requirement
91
72
  requirements:
92
- - - ~>
73
+ - - "~>"
93
74
  - !ruby/object:Gem::Version
94
- version: !binary |-
95
- MC4yLjM=
75
+ version: 0.3.0
96
76
  type: :runtime
97
77
  prerelease: false
98
78
  version_requirements: !ruby/object:Gem::Requirement
99
79
  requirements:
100
- - - ~>
80
+ - - "~>"
101
81
  - !ruby/object:Gem::Version
102
- version: !binary |-
103
- MC4yLjM=
82
+ version: 0.3.0
104
83
  description: Microsoft Azure Subscription Management Client Library for Ruby
105
84
  email: azrubyteam@microsoft.com
106
85
  executables: []
107
86
  extensions: []
108
87
  extra_rdoc_files: []
109
88
  files:
110
- - .rspec
89
+ - ".rspec"
111
90
  - LICENSE.txt
112
91
  - Rakefile
113
92
  - azure_mgmt_subscriptions.gemspec
114
93
  - lib/azure_mgmt_subscriptions.rb
115
- - lib/azure_mgmt_subscriptions/models/location.rb
116
- - lib/azure_mgmt_subscriptions/models/location_list_result.rb
117
- - lib/azure_mgmt_subscriptions/models/subscription.rb
118
- - lib/azure_mgmt_subscriptions/models/subscription_list_result.rb
119
- - lib/azure_mgmt_subscriptions/models/subscription_policies.rb
120
- - lib/azure_mgmt_subscriptions/models/tenant_id_description.rb
121
- - lib/azure_mgmt_subscriptions/models/tenant_list_result.rb
122
- - lib/azure_mgmt_subscriptions/module_definition.rb
123
- - lib/azure_mgmt_subscriptions/subscription_client.rb
124
- - lib/azure_mgmt_subscriptions/subscriptions.rb
125
- - lib/azure_mgmt_subscriptions/tenants.rb
126
- - lib/azure_mgmt_subscriptions/version.rb
127
- homepage: http://github.com/azure/azure-sdk-ruby
94
+ - lib/generated/azure_mgmt_subscriptions.rb
95
+ - lib/generated/azure_mgmt_subscriptions/models/location.rb
96
+ - lib/generated/azure_mgmt_subscriptions/models/location_list_result.rb
97
+ - lib/generated/azure_mgmt_subscriptions/models/subscription.rb
98
+ - lib/generated/azure_mgmt_subscriptions/models/subscription_list_result.rb
99
+ - lib/generated/azure_mgmt_subscriptions/models/subscription_policies.rb
100
+ - lib/generated/azure_mgmt_subscriptions/models/tenant_id_description.rb
101
+ - lib/generated/azure_mgmt_subscriptions/models/tenant_list_result.rb
102
+ - lib/generated/azure_mgmt_subscriptions/module_definition.rb
103
+ - lib/generated/azure_mgmt_subscriptions/subscription_client.rb
104
+ - lib/generated/azure_mgmt_subscriptions/subscriptions.rb
105
+ - lib/generated/azure_mgmt_subscriptions/tenants.rb
106
+ - lib/generated/azure_mgmt_subscriptions/version.rb
107
+ homepage: https://aka.ms/azure-sdk-for-ruby
128
108
  licenses:
129
109
  - MIT
130
110
  metadata: {}
@@ -134,17 +114,17 @@ require_paths:
134
114
  - lib
135
115
  required_ruby_version: !ruby/object:Gem::Requirement
136
116
  requirements:
137
- - - ! '>='
117
+ - - ">="
138
118
  - !ruby/object:Gem::Version
139
119
  version: 1.9.3
140
120
  required_rubygems_version: !ruby/object:Gem::Requirement
141
121
  requirements:
142
- - - ! '>='
122
+ - - ">="
143
123
  - !ruby/object:Gem::Version
144
124
  version: '0'
145
125
  requirements: []
146
126
  rubyforge_project:
147
- rubygems_version: 2.4.5
127
+ rubygems_version: 2.4.6
148
128
  signing_key:
149
129
  specification_version: 4
150
130
  summary: Official ruby client library to consume Microsoft Azure Subscription Management
@@ -1,102 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::Subscriptions
7
- module Models
8
- #
9
- # Location information.
10
- #
11
- class Location
12
-
13
- include MsRestAzure
14
-
15
- # @return [String] Gets or sets the ID of the resource
16
- # (/subscriptions/SubscriptionId).
17
- attr_accessor :id
18
-
19
- # @return [String] Gets or sets the subscription Id.
20
- attr_accessor :subscription_id
21
-
22
- # @return [String] Gets or sets the location name
23
- attr_accessor :name
24
-
25
- # @return [String] Gets or sets the display name of the location
26
- attr_accessor :display_name
27
-
28
- # @return [String] Gets or sets the latitude of the location
29
- attr_accessor :latitude
30
-
31
- # @return [String] Gets or sets the longitude of the location
32
- attr_accessor :longitude
33
-
34
- #
35
- # Validate the object. Throws ValidationError if validation fails.
36
- #
37
- def validate
38
- # Nothing to validate
39
- end
40
-
41
- #
42
- # Serializes given Model object into Ruby Hash.
43
- # @param object Model object to serialize.
44
- # @return [Hash] Serialized object in form of Ruby Hash.
45
- #
46
- def self.serialize_object(object)
47
- object.validate
48
- output_object = {}
49
-
50
- serialized_property = object.id
51
- output_object['id'] = serialized_property unless serialized_property.nil?
52
-
53
- serialized_property = object.subscription_id
54
- output_object['subscriptionId'] = serialized_property unless serialized_property.nil?
55
-
56
- serialized_property = object.name
57
- output_object['name'] = serialized_property unless serialized_property.nil?
58
-
59
- serialized_property = object.display_name
60
- output_object['displayName'] = serialized_property unless serialized_property.nil?
61
-
62
- serialized_property = object.latitude
63
- output_object['latitude'] = serialized_property unless serialized_property.nil?
64
-
65
- serialized_property = object.longitude
66
- output_object['longitude'] = serialized_property unless serialized_property.nil?
67
-
68
- output_object
69
- end
70
-
71
- #
72
- # Deserializes given Ruby Hash into Model object.
73
- # @param object [Hash] Ruby Hash object to deserialize.
74
- # @return [Location] Deserialized object.
75
- #
76
- def self.deserialize_object(object)
77
- return if object.nil?
78
- output_object = Location.new
79
-
80
- deserialized_property = object['id']
81
- output_object.id = deserialized_property
82
-
83
- deserialized_property = object['subscriptionId']
84
- output_object.subscription_id = deserialized_property
85
-
86
- deserialized_property = object['name']
87
- output_object.name = deserialized_property
88
-
89
- deserialized_property = object['displayName']
90
- output_object.display_name = deserialized_property
91
-
92
- deserialized_property = object['latitude']
93
- output_object.latitude = deserialized_property
94
-
95
- deserialized_property = object['longitude']
96
- output_object.longitude = deserialized_property
97
-
98
- output_object
99
- end
100
- end
101
- end
102
- end
@@ -1,76 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::Subscriptions
7
- module Models
8
- #
9
- # Location list operation response.
10
- #
11
- class LocationListResult
12
-
13
- include MsRestAzure
14
-
15
- # @return [Array<Location>] Gets the locations.
16
- attr_accessor :value
17
-
18
- #
19
- # Validate the object. Throws ValidationError if validation fails.
20
- #
21
- def validate
22
- @value.each{ |e| e.validate if e.respond_to?(:validate) } unless @value.nil?
23
- end
24
-
25
- #
26
- # Serializes given Model object into Ruby Hash.
27
- # @param object Model object to serialize.
28
- # @return [Hash] Serialized object in form of Ruby Hash.
29
- #
30
- def self.serialize_object(object)
31
- object.validate
32
- output_object = {}
33
-
34
- serialized_property = object.value
35
- unless serialized_property.nil?
36
- serializedArray = []
37
- serialized_property.each do |element|
38
- unless element.nil?
39
- element = Location.serialize_object(element)
40
- end
41
- serializedArray.push(element)
42
- end
43
- serialized_property = serializedArray
44
- end
45
- output_object['value'] = serialized_property unless serialized_property.nil?
46
-
47
- output_object
48
- end
49
-
50
- #
51
- # Deserializes given Ruby Hash into Model object.
52
- # @param object [Hash] Ruby Hash object to deserialize.
53
- # @return [LocationListResult] Deserialized object.
54
- #
55
- def self.deserialize_object(object)
56
- return if object.nil?
57
- output_object = LocationListResult.new
58
-
59
- deserialized_property = object['value']
60
- unless deserialized_property.nil?
61
- deserialized_array = []
62
- deserialized_property.each do |element1|
63
- unless element1.nil?
64
- element1 = Location.deserialize_object(element1)
65
- end
66
- deserialized_array.push(element1)
67
- end
68
- deserialized_property = deserialized_array
69
- end
70
- output_object.value = deserialized_property
71
-
72
- output_object
73
- end
74
- end
75
- end
76
- end
@@ -1,99 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::Subscriptions
7
- module Models
8
- #
9
- # Subscription information.
10
- #
11
- class Subscription
12
-
13
- include MsRestAzure
14
-
15
- # @return [String] Gets or sets the ID of the resource
16
- # (/subscriptions/SubscriptionId).
17
- attr_accessor :id
18
-
19
- # @return [String] Gets or sets the subscription Id.
20
- attr_accessor :subscription_id
21
-
22
- # @return [String] Gets or sets the subscription display name
23
- attr_accessor :display_name
24
-
25
- # @return [String] Gets or sets the subscription state
26
- attr_accessor :state
27
-
28
- # @return [SubscriptionPolicies] Gets or sets the subscription policies.
29
- attr_accessor :subscription_policies
30
-
31
- #
32
- # Validate the object. Throws ValidationError if validation fails.
33
- #
34
- def validate
35
- @subscription_policies.validate unless @subscription_policies.nil?
36
- end
37
-
38
- #
39
- # Serializes given Model object into Ruby Hash.
40
- # @param object Model object to serialize.
41
- # @return [Hash] Serialized object in form of Ruby Hash.
42
- #
43
- def self.serialize_object(object)
44
- object.validate
45
- output_object = {}
46
-
47
- serialized_property = object.id
48
- output_object['id'] = serialized_property unless serialized_property.nil?
49
-
50
- serialized_property = object.subscription_id
51
- output_object['subscriptionId'] = serialized_property unless serialized_property.nil?
52
-
53
- serialized_property = object.display_name
54
- output_object['displayName'] = serialized_property unless serialized_property.nil?
55
-
56
- serialized_property = object.state
57
- output_object['state'] = serialized_property unless serialized_property.nil?
58
-
59
- serialized_property = object.subscription_policies
60
- unless serialized_property.nil?
61
- serialized_property = SubscriptionPolicies.serialize_object(serialized_property)
62
- end
63
- output_object['subscriptionPolicies'] = serialized_property unless serialized_property.nil?
64
-
65
- output_object
66
- end
67
-
68
- #
69
- # Deserializes given Ruby Hash into Model object.
70
- # @param object [Hash] Ruby Hash object to deserialize.
71
- # @return [Subscription] Deserialized object.
72
- #
73
- def self.deserialize_object(object)
74
- return if object.nil?
75
- output_object = Subscription.new
76
-
77
- deserialized_property = object['id']
78
- output_object.id = deserialized_property
79
-
80
- deserialized_property = object['subscriptionId']
81
- output_object.subscription_id = deserialized_property
82
-
83
- deserialized_property = object['displayName']
84
- output_object.display_name = deserialized_property
85
-
86
- deserialized_property = object['state']
87
- output_object.state = deserialized_property
88
-
89
- deserialized_property = object['subscriptionPolicies']
90
- unless deserialized_property.nil?
91
- deserialized_property = SubscriptionPolicies.deserialize_object(deserialized_property)
92
- end
93
- output_object.subscription_policies = deserialized_property
94
-
95
- output_object
96
- end
97
- end
98
- end
99
- end