oci 2.3.4 → 2.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb +1 -1
  4. data/lib/oci/core/models/update_boot_volume_details.rb +18 -4
  5. data/lib/oci/core/models/update_volume_details.rb +18 -4
  6. data/lib/oci/core/models/virtual_circuit.rb +1 -1
  7. data/lib/oci/core/models/vnic.rb +1 -1
  8. data/lib/oci/core/models/volume_group.rb +18 -4
  9. data/lib/oci/database/database.rb +18 -0
  10. data/lib/oci/database/database_client.rb +1779 -427
  11. data/lib/oci/database/database_client_composite_operations.rb +316 -0
  12. data/lib/oci/database/models/autonomous_data_warehouse.rb +391 -0
  13. data/lib/oci/database/models/autonomous_data_warehouse_backup.rb +316 -0
  14. data/lib/oci/database/models/autonomous_data_warehouse_backup_summary.rb +316 -0
  15. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +167 -0
  16. data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +391 -0
  17. data/lib/oci/database/models/autonomous_database.rb +391 -0
  18. data/lib/oci/database/models/autonomous_database_backup.rb +316 -0
  19. data/lib/oci/database/models/autonomous_database_backup_summary.rb +316 -0
  20. data/lib/oci/database/models/autonomous_database_connection_strings.rb +167 -0
  21. data/lib/oci/database/models/autonomous_database_summary.rb +391 -0
  22. data/lib/oci/database/models/create_autonomous_data_warehouse_backup_details.rb +165 -0
  23. data/lib/oci/database/models/create_autonomous_data_warehouse_details.rb +287 -0
  24. data/lib/oci/database/models/create_autonomous_database_backup_details.rb +165 -0
  25. data/lib/oci/database/models/create_autonomous_database_details.rb +287 -0
  26. data/lib/oci/database/models/db_system.rb +1 -1
  27. data/lib/oci/database/models/db_system_summary.rb +1 -1
  28. data/lib/oci/database/models/launch_db_system_details.rb +1 -1
  29. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +1 -1
  30. data/lib/oci/database/models/restore_autonomous_data_warehouse_details.rb +147 -0
  31. data/lib/oci/database/models/restore_autonomous_database_details.rb +147 -0
  32. data/lib/oci/database/models/update_autonomous_data_warehouse_details.rb +230 -0
  33. data/lib/oci/database/models/update_autonomous_database_details.rb +230 -0
  34. data/lib/oci/identity/identity.rb +1 -0
  35. data/lib/oci/identity/identity_client.rb +64 -1
  36. data/lib/oci/identity/models/availability_domain.rb +11 -1
  37. data/lib/oci/identity/models/fault_domain.rb +187 -0
  38. data/lib/oci/version.rb +1 -1
  39. metadata +21 -2
@@ -0,0 +1,147 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # Details to restore an Oracle Autonomous Database.
8
+ #
9
+ class Database::Models::RestoreAutonomousDatabaseDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The time to restore the database to.
11
+ # @return [DateTime]
12
+ attr_accessor :timestamp
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'timestamp': :'timestamp'
19
+ # rubocop:enable Style/SymbolLiteral
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'timestamp': :'DateTime'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
33
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
34
+
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ # @option attributes [DateTime] :timestamp The value to assign to the {#timestamp} property
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ self.timestamp = attributes[:'timestamp'] if attributes[:'timestamp']
46
+ end
47
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
48
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
49
+
50
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
51
+
52
+
53
+ # Checks equality by comparing each attribute.
54
+ # @param [Object] other the other object to be compared
55
+ def ==(other)
56
+ return true if equal?(other)
57
+ self.class == other.class &&
58
+ timestamp == other.timestamp
59
+ end
60
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
61
+
62
+ # @see the `==` method
63
+ # @param [Object] other the other object to be compared
64
+ def eql?(other)
65
+ self == other
66
+ end
67
+
68
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
69
+
70
+
71
+ # Calculates hash code according to all attributes.
72
+ # @return [Fixnum] Hash code
73
+ def hash
74
+ [timestamp].hash
75
+ end
76
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
77
+
78
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
79
+
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /^Array<(.*)>/i
88
+ # check to ensure the input is an array given that the the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ public_method("#{key}=").call(
92
+ attributes[self.class.attribute_map[key]]
93
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
94
+ )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ public_method("#{key}=").call(
98
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
99
+ )
100
+ end
101
+ # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
107
+
108
+ # Returns the string representation of the object
109
+ # @return [String] String presentation of the object
110
+ def to_s
111
+ to_hash.to_s
112
+ end
113
+
114
+ # Returns the object in the form of hash
115
+ # @return [Hash] Returns the object in the form of hash
116
+ def to_hash
117
+ hash = {}
118
+ self.class.attribute_map.each_pair do |attr, param|
119
+ value = public_method(attr).call
120
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
121
+ hash[param] = _to_hash(value)
122
+ end
123
+ hash
124
+ end
125
+
126
+ private
127
+
128
+ # Outputs non-array value in the form of hash
129
+ # For object, use to_hash. Otherwise, just return the value
130
+ # @param [Object] value Any valid value
131
+ # @return [Hash] Returns the value in the form of hash
132
+ def _to_hash(value)
133
+ if value.is_a?(Array)
134
+ value.compact.map { |v| _to_hash(v) }
135
+ elsif value.is_a?(Hash)
136
+ {}.tap do |hash|
137
+ value.each { |k, v| hash[k] = _to_hash(v) }
138
+ end
139
+ elsif value.respond_to? :to_hash
140
+ value.to_hash
141
+ else
142
+ value
143
+ end
144
+ end
145
+ end
146
+ end
147
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,230 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # Details to update an Oracle Autonomous Data Warehouse.
8
+ #
9
+ class Database::Models::UpdateAutonomousDataWarehouseDetails # rubocop:disable Metrics/LineLength
10
+ # A strong password for Admin. The password must be between 12 and 60 characters long, and must contain at least 1 uppercase, 1 lowercase and 2 numeric characters. It cannot contain the double quote symbol (\"). It must be different than the last 4 passwords.
11
+ # @return [String]
12
+ attr_accessor :admin_password
13
+
14
+ # The number of CPU Cores to be made available to the database.
15
+ # @return [Integer]
16
+ attr_accessor :cpu_core_count
17
+
18
+ # Size, in TBs, of the data volume that will be attached to the database.
19
+ #
20
+ # @return [Integer]
21
+ attr_accessor :data_storage_size_in_tbs
22
+
23
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
24
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
25
+ #
26
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
27
+ #
28
+ # @return [Hash<String, Hash<String, Object>>]
29
+ attr_accessor :defined_tags
30
+
31
+ # The user-friendly name for the Autonomous Data Warehouse. The name does not have to be unique.
32
+ # @return [String]
33
+ attr_accessor :display_name
34
+
35
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
36
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
37
+ #
38
+ # Example: `{\"Department\": \"Finance\"}`
39
+ #
40
+ # @return [Hash<String, String>]
41
+ attr_accessor :freeform_tags
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ # rubocop:disable Style/SymbolLiteral
47
+ 'admin_password': :'adminPassword',
48
+ 'cpu_core_count': :'cpuCoreCount',
49
+ 'data_storage_size_in_tbs': :'dataStorageSizeInTBs',
50
+ 'defined_tags': :'definedTags',
51
+ 'display_name': :'displayName',
52
+ 'freeform_tags': :'freeformTags'
53
+ # rubocop:enable Style/SymbolLiteral
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ # rubocop:disable Style/SymbolLiteral
61
+ 'admin_password': :'String',
62
+ 'cpu_core_count': :'Integer',
63
+ 'data_storage_size_in_tbs': :'Integer',
64
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
65
+ 'display_name': :'String',
66
+ 'freeform_tags': :'Hash<String, String>'
67
+ # rubocop:enable Style/SymbolLiteral
68
+ }
69
+ end
70
+
71
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
72
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
73
+
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ # @option attributes [String] :admin_password The value to assign to the {#admin_password} property
78
+ # @option attributes [Integer] :cpu_core_count The value to assign to the {#cpu_core_count} property
79
+ # @option attributes [Integer] :data_storage_size_in_tbs The value to assign to the {#data_storage_size_in_tbs} property
80
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
81
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
82
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
83
+ def initialize(attributes = {})
84
+ return unless attributes.is_a?(Hash)
85
+
86
+ # convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
88
+
89
+ self.admin_password = attributes[:'adminPassword'] if attributes[:'adminPassword']
90
+
91
+ raise 'You cannot provide both :adminPassword and :admin_password' if attributes.key?(:'adminPassword') && attributes.key?(:'admin_password')
92
+
93
+ self.admin_password = attributes[:'admin_password'] if attributes[:'admin_password']
94
+
95
+ self.cpu_core_count = attributes[:'cpuCoreCount'] if attributes[:'cpuCoreCount']
96
+
97
+ raise 'You cannot provide both :cpuCoreCount and :cpu_core_count' if attributes.key?(:'cpuCoreCount') && attributes.key?(:'cpu_core_count')
98
+
99
+ self.cpu_core_count = attributes[:'cpu_core_count'] if attributes[:'cpu_core_count']
100
+
101
+ self.data_storage_size_in_tbs = attributes[:'dataStorageSizeInTBs'] if attributes[:'dataStorageSizeInTBs']
102
+
103
+ raise 'You cannot provide both :dataStorageSizeInTBs and :data_storage_size_in_tbs' if attributes.key?(:'dataStorageSizeInTBs') && attributes.key?(:'data_storage_size_in_tbs')
104
+
105
+ self.data_storage_size_in_tbs = attributes[:'data_storage_size_in_tbs'] if attributes[:'data_storage_size_in_tbs']
106
+
107
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
108
+
109
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
110
+
111
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
112
+
113
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
114
+
115
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
116
+
117
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
118
+
119
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
120
+
121
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
122
+
123
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
124
+ end
125
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
126
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
127
+
128
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
129
+
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] other the other object to be compared
133
+ def ==(other)
134
+ return true if equal?(other)
135
+ self.class == other.class &&
136
+ admin_password == other.admin_password &&
137
+ cpu_core_count == other.cpu_core_count &&
138
+ data_storage_size_in_tbs == other.data_storage_size_in_tbs &&
139
+ defined_tags == other.defined_tags &&
140
+ display_name == other.display_name &&
141
+ freeform_tags == other.freeform_tags
142
+ end
143
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
144
+
145
+ # @see the `==` method
146
+ # @param [Object] other the other object to be compared
147
+ def eql?(other)
148
+ self == other
149
+ end
150
+
151
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
152
+
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Fixnum] Hash code
156
+ def hash
157
+ [admin_password, cpu_core_count, data_storage_size_in_tbs, defined_tags, display_name, freeform_tags].hash
158
+ end
159
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
160
+
161
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
162
+
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.swagger_types.each_pair do |key, type|
170
+ if type =~ /^Array<(.*)>/i
171
+ # check to ensure the input is an array given that the the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ public_method("#{key}=").call(
175
+ attributes[self.class.attribute_map[key]]
176
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
177
+ )
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ public_method("#{key}=").call(
181
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
182
+ )
183
+ end
184
+ # or else data not found in attributes(hash), not an issue as the data can be optional
185
+ end
186
+
187
+ self
188
+ end
189
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = public_method(attr).call
203
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ private
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
230
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,230 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # Details to update an Oracle Autonomous Database.
8
+ #
9
+ class Database::Models::UpdateAutonomousDatabaseDetails # rubocop:disable Metrics/LineLength
10
+ # A strong password for Admin. The password must be between 12 and 60 characters long, and must contain at least 1 uppercase, 1 lowercase and 2 numeric characters. It cannot contain the double quote symbol (\"). It must be different than the last 4 passwords.
11
+ # @return [String]
12
+ attr_accessor :admin_password
13
+
14
+ # The number of CPU Cores to be made available to the database.
15
+ # @return [Integer]
16
+ attr_accessor :cpu_core_count
17
+
18
+ # Size, in TBs, of the data volume that will be attached to the database.
19
+ #
20
+ # @return [Integer]
21
+ attr_accessor :data_storage_size_in_tbs
22
+
23
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
24
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
25
+ #
26
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
27
+ #
28
+ # @return [Hash<String, Hash<String, Object>>]
29
+ attr_accessor :defined_tags
30
+
31
+ # The user-friendly name for the Autonomous Database. The name does not have to be unique.
32
+ # @return [String]
33
+ attr_accessor :display_name
34
+
35
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
36
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
37
+ #
38
+ # Example: `{\"Department\": \"Finance\"}`
39
+ #
40
+ # @return [Hash<String, String>]
41
+ attr_accessor :freeform_tags
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ # rubocop:disable Style/SymbolLiteral
47
+ 'admin_password': :'adminPassword',
48
+ 'cpu_core_count': :'cpuCoreCount',
49
+ 'data_storage_size_in_tbs': :'dataStorageSizeInTBs',
50
+ 'defined_tags': :'definedTags',
51
+ 'display_name': :'displayName',
52
+ 'freeform_tags': :'freeformTags'
53
+ # rubocop:enable Style/SymbolLiteral
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ # rubocop:disable Style/SymbolLiteral
61
+ 'admin_password': :'String',
62
+ 'cpu_core_count': :'Integer',
63
+ 'data_storage_size_in_tbs': :'Integer',
64
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
65
+ 'display_name': :'String',
66
+ 'freeform_tags': :'Hash<String, String>'
67
+ # rubocop:enable Style/SymbolLiteral
68
+ }
69
+ end
70
+
71
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
72
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
73
+
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ # @option attributes [String] :admin_password The value to assign to the {#admin_password} property
78
+ # @option attributes [Integer] :cpu_core_count The value to assign to the {#cpu_core_count} property
79
+ # @option attributes [Integer] :data_storage_size_in_tbs The value to assign to the {#data_storage_size_in_tbs} property
80
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
81
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
82
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
83
+ def initialize(attributes = {})
84
+ return unless attributes.is_a?(Hash)
85
+
86
+ # convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
88
+
89
+ self.admin_password = attributes[:'adminPassword'] if attributes[:'adminPassword']
90
+
91
+ raise 'You cannot provide both :adminPassword and :admin_password' if attributes.key?(:'adminPassword') && attributes.key?(:'admin_password')
92
+
93
+ self.admin_password = attributes[:'admin_password'] if attributes[:'admin_password']
94
+
95
+ self.cpu_core_count = attributes[:'cpuCoreCount'] if attributes[:'cpuCoreCount']
96
+
97
+ raise 'You cannot provide both :cpuCoreCount and :cpu_core_count' if attributes.key?(:'cpuCoreCount') && attributes.key?(:'cpu_core_count')
98
+
99
+ self.cpu_core_count = attributes[:'cpu_core_count'] if attributes[:'cpu_core_count']
100
+
101
+ self.data_storage_size_in_tbs = attributes[:'dataStorageSizeInTBs'] if attributes[:'dataStorageSizeInTBs']
102
+
103
+ raise 'You cannot provide both :dataStorageSizeInTBs and :data_storage_size_in_tbs' if attributes.key?(:'dataStorageSizeInTBs') && attributes.key?(:'data_storage_size_in_tbs')
104
+
105
+ self.data_storage_size_in_tbs = attributes[:'data_storage_size_in_tbs'] if attributes[:'data_storage_size_in_tbs']
106
+
107
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
108
+
109
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
110
+
111
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
112
+
113
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
114
+
115
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
116
+
117
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
118
+
119
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
120
+
121
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
122
+
123
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
124
+ end
125
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
126
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
127
+
128
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
129
+
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] other the other object to be compared
133
+ def ==(other)
134
+ return true if equal?(other)
135
+ self.class == other.class &&
136
+ admin_password == other.admin_password &&
137
+ cpu_core_count == other.cpu_core_count &&
138
+ data_storage_size_in_tbs == other.data_storage_size_in_tbs &&
139
+ defined_tags == other.defined_tags &&
140
+ display_name == other.display_name &&
141
+ freeform_tags == other.freeform_tags
142
+ end
143
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
144
+
145
+ # @see the `==` method
146
+ # @param [Object] other the other object to be compared
147
+ def eql?(other)
148
+ self == other
149
+ end
150
+
151
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
152
+
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Fixnum] Hash code
156
+ def hash
157
+ [admin_password, cpu_core_count, data_storage_size_in_tbs, defined_tags, display_name, freeform_tags].hash
158
+ end
159
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
160
+
161
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
162
+
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def build_from_hash(attributes)
168
+ return nil unless attributes.is_a?(Hash)
169
+ self.class.swagger_types.each_pair do |key, type|
170
+ if type =~ /^Array<(.*)>/i
171
+ # check to ensure the input is an array given that the the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
174
+ public_method("#{key}=").call(
175
+ attributes[self.class.attribute_map[key]]
176
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
177
+ )
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ public_method("#{key}=").call(
181
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
182
+ )
183
+ end
184
+ # or else data not found in attributes(hash), not an issue as the data can be optional
185
+ end
186
+
187
+ self
188
+ end
189
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = public_method(attr).call
203
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ private
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+ end
229
+ end
230
+ # rubocop:enable Lint/UnneededCopDisableDirective