azure_mgmt_storage 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 (58) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_storage.gemspec +4 -5
  3. data/lib/azure_mgmt_storage.rb +3 -57
  4. data/lib/generated/azure_mgmt_storage.rb +56 -0
  5. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/access_tier.rb +0 -0
  6. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/account_status.rb +0 -0
  7. data/lib/generated/azure_mgmt_storage/models/check_name_availability_result.rb +73 -0
  8. data/lib/generated/azure_mgmt_storage/models/custom_domain.rb +57 -0
  9. data/lib/generated/azure_mgmt_storage/models/encryption.rb +59 -0
  10. data/lib/generated/azure_mgmt_storage/models/encryption_service.rb +60 -0
  11. data/lib/generated/azure_mgmt_storage/models/encryption_services.rb +45 -0
  12. data/lib/generated/azure_mgmt_storage/models/endpoints.rb +79 -0
  13. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/key_permission.rb +0 -0
  14. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/kind.rb +0 -0
  15. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/provisioning_state.rb +0 -0
  16. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/reason.rb +0 -0
  17. data/lib/generated/azure_mgmt_storage/models/sku.rb +61 -0
  18. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/sku_name.rb +0 -0
  19. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/sku_tier.rb +0 -0
  20. data/lib/generated/azure_mgmt_storage/models/storage_account.rb +269 -0
  21. data/lib/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +57 -0
  22. data/lib/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +134 -0
  23. data/lib/generated/azure_mgmt_storage/models/storage_account_key.rb +69 -0
  24. data/lib/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +54 -0
  25. data/lib/generated/azure_mgmt_storage/models/storage_account_list_result.rb +54 -0
  26. data/lib/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +44 -0
  27. data/lib/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +108 -0
  28. data/lib/generated/azure_mgmt_storage/models/usage.rb +84 -0
  29. data/lib/generated/azure_mgmt_storage/models/usage_list_result.rb +52 -0
  30. data/lib/generated/azure_mgmt_storage/models/usage_name.rb +56 -0
  31. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/models/usage_unit.rb +0 -0
  32. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/module_definition.rb +0 -0
  33. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/storage_accounts.rb +81 -66
  34. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/storage_management_client.rb +4 -4
  35. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/usage_operations.rb +4 -4
  36. data/lib/{azure_mgmt_storage → generated/azure_mgmt_storage}/version.rb +1 -1
  37. metadata +54 -77
  38. data/lib/azure_mgmt_storage/models/check_name_availability_result.rb +0 -82
  39. data/lib/azure_mgmt_storage/models/custom_domain.rb +0 -68
  40. data/lib/azure_mgmt_storage/models/encryption.rb +0 -73
  41. data/lib/azure_mgmt_storage/models/encryption_service.rb +0 -72
  42. data/lib/azure_mgmt_storage/models/encryption_services.rb +0 -62
  43. data/lib/azure_mgmt_storage/models/endpoints.rb +0 -84
  44. data/lib/azure_mgmt_storage/models/sku.rb +0 -77
  45. data/lib/azure_mgmt_storage/models/storage_account.rb +0 -122
  46. data/lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +0 -67
  47. data/lib/azure_mgmt_storage/models/storage_account_create_parameters.rb +0 -122
  48. data/lib/azure_mgmt_storage/models/storage_account_key.rb +0 -78
  49. data/lib/azure_mgmt_storage/models/storage_account_list_keys_result.rb +0 -77
  50. data/lib/azure_mgmt_storage/models/storage_account_list_result.rb +0 -77
  51. data/lib/azure_mgmt_storage/models/storage_account_properties.rb +0 -227
  52. data/lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb +0 -100
  53. data/lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb +0 -98
  54. data/lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +0 -56
  55. data/lib/azure_mgmt_storage/models/storage_account_update_parameters.rb +0 -94
  56. data/lib/azure_mgmt_storage/models/usage.rb +0 -99
  57. data/lib/azure_mgmt_storage/models/usage_list_result.rb +0 -76
  58. data/lib/azure_mgmt_storage/models/usage_name.rb +0 -65
@@ -8,13 +8,13 @@ module Azure::ARM::Storage
8
8
  # A service client - single point of access to the REST API.
9
9
  #
10
10
  class StorageManagementClient < MsRestAzure::AzureServiceClient
11
- include Azure::ARM::Storage::Models
11
+ include MsRest::Serialization
12
12
  include MsRestAzure
13
13
 
14
14
  # @return [String] the base URI of the service.
15
15
  attr_accessor :base_url
16
16
 
17
- # @return Gets Azure subscription credentials.
17
+ # @return Credentials needed for the client to connect to Azure.
18
18
  attr_reader :credentials
19
19
 
20
20
  # @return [String] Gets subscription credentials which uniquely identify
@@ -40,10 +40,10 @@ module Azure::ARM::Storage
40
40
  # subscription.
41
41
  attr_accessor :credentials
42
42
 
43
- # @return storage_accounts
43
+ # @return [StorageAccounts] storage_accounts
44
44
  attr_reader :storage_accounts
45
45
 
46
- # @return usage_operations
46
+ # @return [UsageOperations] usage_operations
47
47
  attr_reader :usage_operations
48
48
 
49
49
  #
@@ -61,6 +61,8 @@ module Azure::ARM::Storage
61
61
  def list_async(custom_headers = nil)
62
62
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
63
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
64
+
65
+
64
66
  request_headers = {}
65
67
 
66
68
  # Set Headers
@@ -96,10 +98,8 @@ module Azure::ARM::Storage
96
98
  if status_code == 200
97
99
  begin
98
100
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
- unless parsed_response.nil?
100
- parsed_response = UsageListResult.deserialize_object(parsed_response)
101
- end
102
- result.body = parsed_response
101
+ result_mapper = UsageListResult.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
103
103
  rescue Exception => e
104
104
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
105
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::Storage
7
- VERSION = '0.3.1'
7
+ VERSION = '0.4.0'
8
8
  end
metadata CHANGED
@@ -1,154 +1,131 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_storage
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 Storage 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
  - README.md
113
92
  - Rakefile
114
93
  - azure_mgmt_storage.gemspec
115
94
  - lib/azure_mgmt_storage.rb
116
- - lib/azure_mgmt_storage/models/access_tier.rb
117
- - lib/azure_mgmt_storage/models/account_status.rb
118
- - lib/azure_mgmt_storage/models/check_name_availability_result.rb
119
- - lib/azure_mgmt_storage/models/custom_domain.rb
120
- - lib/azure_mgmt_storage/models/encryption.rb
121
- - lib/azure_mgmt_storage/models/encryption_service.rb
122
- - lib/azure_mgmt_storage/models/encryption_services.rb
123
- - lib/azure_mgmt_storage/models/endpoints.rb
124
- - lib/azure_mgmt_storage/models/key_permission.rb
125
- - lib/azure_mgmt_storage/models/kind.rb
126
- - lib/azure_mgmt_storage/models/provisioning_state.rb
127
- - lib/azure_mgmt_storage/models/reason.rb
128
- - lib/azure_mgmt_storage/models/sku.rb
129
- - lib/azure_mgmt_storage/models/sku_name.rb
130
- - lib/azure_mgmt_storage/models/sku_tier.rb
131
- - lib/azure_mgmt_storage/models/storage_account.rb
132
- - lib/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb
133
- - lib/azure_mgmt_storage/models/storage_account_create_parameters.rb
134
- - lib/azure_mgmt_storage/models/storage_account_key.rb
135
- - lib/azure_mgmt_storage/models/storage_account_list_keys_result.rb
136
- - lib/azure_mgmt_storage/models/storage_account_list_result.rb
137
- - lib/azure_mgmt_storage/models/storage_account_properties.rb
138
- - lib/azure_mgmt_storage/models/storage_account_properties_create_parameters.rb
139
- - lib/azure_mgmt_storage/models/storage_account_properties_update_parameters.rb
140
- - lib/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb
141
- - lib/azure_mgmt_storage/models/storage_account_update_parameters.rb
142
- - lib/azure_mgmt_storage/models/usage.rb
143
- - lib/azure_mgmt_storage/models/usage_list_result.rb
144
- - lib/azure_mgmt_storage/models/usage_name.rb
145
- - lib/azure_mgmt_storage/models/usage_unit.rb
146
- - lib/azure_mgmt_storage/module_definition.rb
147
- - lib/azure_mgmt_storage/storage_accounts.rb
148
- - lib/azure_mgmt_storage/storage_management_client.rb
149
- - lib/azure_mgmt_storage/usage_operations.rb
150
- - lib/azure_mgmt_storage/version.rb
151
- homepage: http://github.com/azure/azure-sdk-ruby
95
+ - lib/generated/azure_mgmt_storage.rb
96
+ - lib/generated/azure_mgmt_storage/models/access_tier.rb
97
+ - lib/generated/azure_mgmt_storage/models/account_status.rb
98
+ - lib/generated/azure_mgmt_storage/models/check_name_availability_result.rb
99
+ - lib/generated/azure_mgmt_storage/models/custom_domain.rb
100
+ - lib/generated/azure_mgmt_storage/models/encryption.rb
101
+ - lib/generated/azure_mgmt_storage/models/encryption_service.rb
102
+ - lib/generated/azure_mgmt_storage/models/encryption_services.rb
103
+ - lib/generated/azure_mgmt_storage/models/endpoints.rb
104
+ - lib/generated/azure_mgmt_storage/models/key_permission.rb
105
+ - lib/generated/azure_mgmt_storage/models/kind.rb
106
+ - lib/generated/azure_mgmt_storage/models/provisioning_state.rb
107
+ - lib/generated/azure_mgmt_storage/models/reason.rb
108
+ - lib/generated/azure_mgmt_storage/models/sku.rb
109
+ - lib/generated/azure_mgmt_storage/models/sku_name.rb
110
+ - lib/generated/azure_mgmt_storage/models/sku_tier.rb
111
+ - lib/generated/azure_mgmt_storage/models/storage_account.rb
112
+ - lib/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb
113
+ - lib/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb
114
+ - lib/generated/azure_mgmt_storage/models/storage_account_key.rb
115
+ - lib/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb
116
+ - lib/generated/azure_mgmt_storage/models/storage_account_list_result.rb
117
+ - lib/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb
118
+ - lib/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb
119
+ - lib/generated/azure_mgmt_storage/models/usage.rb
120
+ - lib/generated/azure_mgmt_storage/models/usage_list_result.rb
121
+ - lib/generated/azure_mgmt_storage/models/usage_name.rb
122
+ - lib/generated/azure_mgmt_storage/models/usage_unit.rb
123
+ - lib/generated/azure_mgmt_storage/module_definition.rb
124
+ - lib/generated/azure_mgmt_storage/storage_accounts.rb
125
+ - lib/generated/azure_mgmt_storage/storage_management_client.rb
126
+ - lib/generated/azure_mgmt_storage/usage_operations.rb
127
+ - lib/generated/azure_mgmt_storage/version.rb
128
+ homepage: https://aka.ms/azure-sdk-for-ruby
152
129
  licenses:
153
130
  - MIT
154
131
  metadata: {}
@@ -158,17 +135,17 @@ require_paths:
158
135
  - lib
159
136
  required_ruby_version: !ruby/object:Gem::Requirement
160
137
  requirements:
161
- - - ! '>='
138
+ - - ">="
162
139
  - !ruby/object:Gem::Version
163
140
  version: 1.9.3
164
141
  required_rubygems_version: !ruby/object:Gem::Requirement
165
142
  requirements:
166
- - - ! '>='
143
+ - - ">="
167
144
  - !ruby/object:Gem::Version
168
145
  version: '0'
169
146
  requirements: []
170
147
  rubyforge_project:
171
- rubygems_version: 2.4.5
148
+ rubygems_version: 2.4.6
172
149
  signing_key:
173
150
  specification_version: 4
174
151
  summary: Official ruby client library to consume Microsoft Azure Storage Management
@@ -1,82 +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::Storage
7
- module Models
8
- #
9
- # The CheckNameAvailability operation response.
10
- #
11
- class CheckNameAvailabilityResult
12
-
13
- include MsRestAzure
14
-
15
- # @return [Boolean] Gets a boolean value that indicates whether the name
16
- # is available for you to use. If true, the name is available. If
17
- # false, the name has already been taken or invalid and cannot be used.
18
- attr_accessor :name_available
19
-
20
- # @return [Reason] Gets the reason that a storage account name could not
21
- # be used. The Reason element is only returned if NameAvailable is
22
- # false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'
23
- attr_accessor :reason
24
-
25
- # @return [String] Gets an error message explaining the Reason value in
26
- # more detail.
27
- attr_accessor :message
28
-
29
- #
30
- # Validate the object. Throws ValidationError if validation fails.
31
- #
32
- def validate
33
- end
34
-
35
- #
36
- # Serializes given Model object into Ruby Hash.
37
- # @param object Model object to serialize.
38
- # @return [Hash] Serialized object in form of Ruby Hash.
39
- #
40
- def self.serialize_object(object)
41
- object.validate
42
- output_object = {}
43
-
44
- serialized_property = object.name_available
45
- output_object['nameAvailable'] = serialized_property unless serialized_property.nil?
46
-
47
- serialized_property = object.reason
48
- output_object['reason'] = serialized_property unless serialized_property.nil?
49
-
50
- serialized_property = object.message
51
- output_object['message'] = serialized_property unless serialized_property.nil?
52
-
53
- output_object
54
- end
55
-
56
- #
57
- # Deserializes given Ruby Hash into Model object.
58
- # @param object [Hash] Ruby Hash object to deserialize.
59
- # @return [CheckNameAvailabilityResult] Deserialized object.
60
- #
61
- def self.deserialize_object(object)
62
- return if object.nil?
63
- output_object = CheckNameAvailabilityResult.new
64
-
65
- deserialized_property = object['nameAvailable']
66
- output_object.name_available = deserialized_property
67
-
68
- deserialized_property = object['reason']
69
- if (!deserialized_property.nil? && !deserialized_property.empty?)
70
- enum_is_valid = Reason.constants.any? { |e| Reason.const_get(e).to_s.downcase == deserialized_property.downcase }
71
- warn 'Enum Reason does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
72
- end
73
- output_object.reason = deserialized_property
74
-
75
- deserialized_property = object['message']
76
- output_object.message = deserialized_property
77
-
78
- output_object
79
- end
80
- end
81
- end
82
- end
@@ -1,68 +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::Storage
7
- module Models
8
- #
9
- # The custom domain assigned to this storage account. This can be set via
10
- # Update.
11
- #
12
- class CustomDomain
13
-
14
- include MsRestAzure
15
-
16
- # @return [String] Gets or sets the custom domain name. Name is the
17
- # CNAME source.
18
- attr_accessor :name
19
-
20
- # @return [Boolean] Indicates whether indirect CName validation is
21
- # enabled. Default value is false. This should only be set on updates
22
- attr_accessor :use_sub_domain
23
-
24
- #
25
- # Validate the object. Throws ValidationError if validation fails.
26
- #
27
- def validate
28
- fail MsRest::ValidationError, 'property name is nil' if @name.nil?
29
- end
30
-
31
- #
32
- # Serializes given Model object into Ruby Hash.
33
- # @param object Model object to serialize.
34
- # @return [Hash] Serialized object in form of Ruby Hash.
35
- #
36
- def self.serialize_object(object)
37
- object.validate
38
- output_object = {}
39
-
40
- serialized_property = object.name
41
- output_object['name'] = serialized_property unless serialized_property.nil?
42
-
43
- serialized_property = object.use_sub_domain
44
- output_object['useSubDomain'] = serialized_property unless serialized_property.nil?
45
-
46
- output_object
47
- end
48
-
49
- #
50
- # Deserializes given Ruby Hash into Model object.
51
- # @param object [Hash] Ruby Hash object to deserialize.
52
- # @return [CustomDomain] Deserialized object.
53
- #
54
- def self.deserialize_object(object)
55
- return if object.nil?
56
- output_object = CustomDomain.new
57
-
58
- deserialized_property = object['name']
59
- output_object.name = deserialized_property
60
-
61
- deserialized_property = object['useSubDomain']
62
- output_object.use_sub_domain = deserialized_property
63
-
64
- output_object
65
- end
66
- end
67
- end
68
- end
@@ -1,73 +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::Storage
7
- module Models
8
- #
9
- # The encryption settings on the account.
10
- #
11
- class Encryption
12
-
13
- include MsRestAzure
14
-
15
- # @return [EncryptionServices] Gets the services which are encrypted.
16
- attr_accessor :services
17
-
18
- # @return [String] Gets the encryption keySource(provider). Possible
19
- # values (case-insensitive): Microsoft.Storage
20
- attr_accessor :key_source
21
-
22
- #
23
- # Validate the object. Throws ValidationError if validation fails.
24
- #
25
- def validate
26
- fail MsRest::ValidationError, 'property key_source is nil' if @key_source.nil?
27
- @services.validate unless @services.nil?
28
- end
29
-
30
- #
31
- # Serializes given Model object into Ruby Hash.
32
- # @param object Model object to serialize.
33
- # @return [Hash] Serialized object in form of Ruby Hash.
34
- #
35
- def self.serialize_object(object)
36
- object.validate
37
- output_object = {}
38
-
39
- serialized_property = object.key_source
40
- output_object['keySource'] = serialized_property unless serialized_property.nil?
41
-
42
- serialized_property = object.services
43
- unless serialized_property.nil?
44
- serialized_property = EncryptionServices.serialize_object(serialized_property)
45
- end
46
- output_object['services'] = serialized_property unless serialized_property.nil?
47
-
48
- output_object
49
- end
50
-
51
- #
52
- # Deserializes given Ruby Hash into Model object.
53
- # @param object [Hash] Ruby Hash object to deserialize.
54
- # @return [Encryption] Deserialized object.
55
- #
56
- def self.deserialize_object(object)
57
- return if object.nil?
58
- output_object = Encryption.new
59
-
60
- deserialized_property = object['keySource']
61
- output_object.key_source = deserialized_property
62
-
63
- deserialized_property = object['services']
64
- unless deserialized_property.nil?
65
- deserialized_property = EncryptionServices.deserialize_object(deserialized_property)
66
- end
67
- output_object.services = deserialized_property
68
-
69
- output_object
70
- end
71
- end
72
- end
73
- end