oci 2.0.0 → 2.0.1

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 +4 -4
  2. data/README.md +2 -1
  3. data/lib/oci.rb +8 -0
  4. data/lib/oci/api_client.rb +11 -5
  5. data/lib/oci/config.rb +3 -2
  6. data/lib/oci/config_file_loader.rb +5 -5
  7. data/lib/oci/core/blockstorage_client.rb +1 -1
  8. data/lib/oci/core/compute_client.rb +58 -4
  9. data/lib/oci/core/core.rb +1 -0
  10. data/lib/oci/core/models/capture_console_history_details.rb +13 -1
  11. data/lib/oci/core/models/create_instance_console_connection_details.rb +2 -2
  12. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  13. data/lib/oci/core/models/create_volume_details.rb +14 -1
  14. data/lib/oci/core/models/instance_console_connection.rb +6 -6
  15. data/lib/oci/core/models/route_rule.rb +4 -1
  16. data/lib/oci/core/models/update_console_history_details.rb +121 -0
  17. data/lib/oci/core/models/update_vnic_details.rb +21 -4
  18. data/lib/oci/core/models/vnic.rb +18 -1
  19. data/lib/oci/core/models/volume.rb +13 -2
  20. data/lib/oci/core/models/volume_backup.rb +29 -2
  21. data/lib/oci/core/virtual_network_client.rb +7 -1
  22. data/lib/oci/database/database.rb +43 -0
  23. data/lib/oci/database/database_client.rb +1246 -0
  24. data/lib/oci/database/models/create_data_guard_association_details.rb +225 -0
  25. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +138 -0
  26. data/lib/oci/database/models/create_database_details.rb +194 -0
  27. data/lib/oci/database/models/create_db_home_details.rb +141 -0
  28. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +152 -0
  29. data/lib/oci/database/models/data_guard_association.rb +374 -0
  30. data/lib/oci/database/models/database.rb +261 -0
  31. data/lib/oci/database/models/database_summary.rb +261 -0
  32. data/lib/oci/database/models/db_home.rb +216 -0
  33. data/lib/oci/database/models/db_home_summary.rb +216 -0
  34. data/lib/oci/database/models/db_node.rb +220 -0
  35. data/lib/oci/database/models/db_node_summary.rb +220 -0
  36. data/lib/oci/database/models/db_system.rb +518 -0
  37. data/lib/oci/database/models/db_system_shape_summary.rb +142 -0
  38. data/lib/oci/database/models/db_system_summary.rb +518 -0
  39. data/lib/oci/database/models/db_version_summary.rb +131 -0
  40. data/lib/oci/database/models/failover_data_guard_association_details.rb +120 -0
  41. data/lib/oci/database/models/launch_db_system_details.rb +394 -0
  42. data/lib/oci/database/models/patch.rb +247 -0
  43. data/lib/oci/database/models/patch_details.rb +144 -0
  44. data/lib/oci/database/models/patch_history_entry.rb +218 -0
  45. data/lib/oci/database/models/patch_history_entry_summary.rb +218 -0
  46. data/lib/oci/database/models/patch_summary.rb +247 -0
  47. data/lib/oci/database/models/reinstate_data_guard_association_details.rb +120 -0
  48. data/lib/oci/database/models/switchover_data_guard_association_details.rb +120 -0
  49. data/lib/oci/database/models/update_db_home_details.rb +119 -0
  50. data/lib/oci/database/models/update_db_system_details.rb +153 -0
  51. data/lib/oci/database/util.rb +1 -0
  52. data/lib/oci/errors.rb +3 -4
  53. data/lib/oci/regions.rb +4 -2
  54. data/lib/oci/response_headers.rb +0 -1
  55. data/lib/oci/signer.rb +8 -7
  56. data/lib/oci/version.rb +1 -1
  57. data/lib/oraclebmc.rb +3 -1
  58. metadata +33 -2
@@ -0,0 +1,225 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Database::Models::CreateDataGuardAssociationDetails
7
+
8
+ PROTECTION_MODE_ENUM = [PROTECTION_MODE_MAXIMUM_AVAILABILITY = 'MAXIMUM_AVAILABILITY',
9
+ PROTECTION_MODE_MAXIMUM_PERFORMANCE = 'MAXIMUM_PERFORMANCE',
10
+ PROTECTION_MODE_MAXIMUM_PROTECTION = 'MAXIMUM_PROTECTION']
11
+
12
+
13
+ TRANSPORT_TYPE_ENUM = [TRANSPORT_TYPE_SYNC = 'SYNC',
14
+ TRANSPORT_TYPE_ASYNC = 'ASYNC',
15
+ TRANSPORT_TYPE_FASTSYNC = 'FASTSYNC']
16
+
17
+ # Specifies where to create the associated database.
18
+ # \"ExistingDbSystem\" is the only supported `creationType` value.
19
+ #
20
+ # @return [String]
21
+ attr_accessor :creation_type
22
+
23
+ # A strong password for the `SYS`, `SYSTEM`, and `PDB Admin` users to apply during standby creation.
24
+ #
25
+ # The password must contain no fewer than nine characters and include:
26
+ #
27
+ # * At least two uppercase characters.
28
+ #
29
+ # * At least two lowercase characters.
30
+ #
31
+ # * At least two numeric characters.
32
+ #
33
+ # * At least two special characters. Valid special characters include \"_\", \"#\", and \"-\" only.
34
+ #
35
+ # **The password MUST be the same as the primary admin password.**
36
+ #
37
+ # @return [String]
38
+ attr_accessor :database_admin_password
39
+
40
+ # The protection mode to set up between the primary and standby databases. For more information, see
41
+ # [Oracle Data Guard Protection Modes](http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000)
42
+ # in the Oracle Data Guard documentation.
43
+ #
44
+ # **IMPORTANT** - The only protection mode currently supported by the Database Service is MAXIMUM_PERFORMANCE.
45
+ #
46
+ # @return [String]
47
+ attr_accessor :protection_mode
48
+
49
+ # The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`:
50
+ #
51
+ # * MAXIMUM_AVAILABILITY - SYNC or FASTSYNC
52
+ # * MAXIMUM_PERFORMANCE - ASYNC
53
+ # * MAXIMUM_PROTECTION - SYNC
54
+ #
55
+ # For more information, see
56
+ # [Redo Transport Services](http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400)
57
+ # in the Oracle Data Guard documentation.
58
+ #
59
+ # **IMPORTANT** - The only transport type currently supported by the Database Service is ASYNC.
60
+ #
61
+ # @return [String]
62
+ attr_accessor :transport_type
63
+
64
+
65
+ # Given the hash representation of a subtype of this class,
66
+ # use the info in the hash to return the class of the subtype.
67
+ def self.get_subtype(object_hash)
68
+ type = object_hash[:'creationType']
69
+
70
+ return 'OCI::Database::Models::CreateDataGuardAssociationToExistingDbSystemDetails' if type == 'ExistingDbSystem'
71
+
72
+ # TODO: Log a warning when the subtype is not found.
73
+ return 'OCI::Database::Models::CreateDataGuardAssociationDetails'
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
83
+
84
+ if attributes[:'creationType']
85
+ self.creation_type = attributes[:'creationType']
86
+ end
87
+
88
+ if attributes[:'databaseAdminPassword']
89
+ self.database_admin_password = attributes[:'databaseAdminPassword']
90
+ end
91
+
92
+ if attributes[:'protectionMode']
93
+ self.protection_mode = attributes[:'protectionMode']
94
+ end
95
+
96
+ if attributes[:'transportType']
97
+ self.transport_type = attributes[:'transportType']
98
+ end
99
+
100
+ end
101
+
102
+ # Custom attribute writer method checking allowed values (enum).
103
+ # @param [Object] protection_mode Object to be assigned
104
+ def protection_mode=(protection_mode)
105
+ if protection_mode && !PROTECTION_MODE_ENUM.include?(protection_mode)
106
+ fail "Invalid value for 'protection_mode': this must be one of the values in PROTECTION_MODE_ENUM."
107
+ else
108
+ @protection_mode = protection_mode
109
+ end
110
+ end
111
+
112
+ # Custom attribute writer method checking allowed values (enum).
113
+ # @param [Object] transport_type Object to be assigned
114
+ def transport_type=(transport_type)
115
+ if transport_type && !TRANSPORT_TYPE_ENUM.include?(transport_type)
116
+ fail "Invalid value for 'transport_type': this must be one of the values in TRANSPORT_TYPE_ENUM."
117
+ else
118
+ @transport_type = transport_type
119
+ end
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] other_object to be compared
124
+ def ==(other_object)
125
+ return true if self.equal?(other_object)
126
+ self.class == other_object.class &&
127
+ creation_type == other_object.creation_type &&
128
+ database_admin_password == other_object.database_admin_password &&
129
+ protection_mode == other_object.protection_mode &&
130
+ transport_type == other_object.transport_type
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] other_object to be compared
135
+ def eql?(other_object)
136
+ self == other_object
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Fixnum] Hash code
141
+ def hash
142
+ [creation_type, database_admin_password, protection_mode, transport_type].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.swagger_types.each_pair do |key, type|
151
+ if type =~ /^Array<(.*)>/i
152
+ # check to ensure the input is an array given that the the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
159
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ private
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map{ |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+
204
+
205
+ # Attribute mapping from ruby-style variable name to JSON key.
206
+ def self.attribute_map
207
+ {
208
+ :'creation_type' => :'creationType',
209
+ :'database_admin_password' => :'databaseAdminPassword',
210
+ :'protection_mode' => :'protectionMode',
211
+ :'transport_type' => :'transportType'
212
+ }
213
+ end
214
+
215
+ # Attribute type mapping.
216
+ def self.swagger_types
217
+ {
218
+ :'creation_type' => :'String',
219
+ :'database_admin_password' => :'String',
220
+ :'protection_mode' => :'String',
221
+ :'transport_type' => :'String'
222
+ }
223
+ end
224
+ end
225
+ end
@@ -0,0 +1,138 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'create_data_guard_association_details'
5
+
6
+ module OCI
7
+ class Database::Models::CreateDataGuardAssociationToExistingDbSystemDetails < Database::Models::CreateDataGuardAssociationDetails
8
+ # The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System to create the standby database on.
9
+ #
10
+ # @return [String]
11
+ attr_accessor :peer_db_system_id
12
+
13
+
14
+ # Initializes the object
15
+ # @param [Hash] attributes Model attributes in the form of hash
16
+ def initialize(attributes = {})
17
+ return unless attributes.is_a?(Hash)
18
+
19
+ attributes['creationType'] = 'ExistingDbSystem'
20
+
21
+ super(attributes)
22
+
23
+ # convert string to symbol for hash key
24
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
25
+
26
+ if attributes[:'peerDbSystemId']
27
+ self.peer_db_system_id = attributes[:'peerDbSystemId']
28
+ end
29
+
30
+ end
31
+
32
+ # Checks equality by comparing each attribute.
33
+ # @param [Object] other_object to be compared
34
+ def ==(other_object)
35
+ return true if self.equal?(other_object)
36
+ self.class == other_object.class &&
37
+ creation_type == other_object.creation_type &&
38
+ database_admin_password == other_object.database_admin_password &&
39
+ protection_mode == other_object.protection_mode &&
40
+ transport_type == other_object.transport_type &&
41
+ peer_db_system_id == other_object.peer_db_system_id
42
+ end
43
+
44
+ # @see the `==` method
45
+ # @param [Object] other_object to be compared
46
+ def eql?(other_object)
47
+ self == other_object
48
+ end
49
+
50
+ # Calculates hash code according to all attributes.
51
+ # @return [Fixnum] Hash code
52
+ def hash
53
+ [creation_type, database_admin_password, protection_mode, transport_type, peer_db_system_id].hash
54
+ end
55
+
56
+ # Builds the object from hash
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ # @return [Object] Returns the model itself
59
+ def build_from_hash(attributes)
60
+ return nil unless attributes.is_a?(Hash)
61
+ self.class.swagger_types.each_pair do |key, type|
62
+ if type =~ /^Array<(.*)>/i
63
+ # check to ensure the input is an array given that the the attribute
64
+ # is documented as an array but the input is not
65
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
66
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
67
+ end
68
+ elsif !attributes[self.class.attribute_map[key]].nil?
69
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
70
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
71
+ end
72
+
73
+ self
74
+ end
75
+
76
+ # Returns the string representation of the object
77
+ # @return [String] String presentation of the object
78
+ def to_s
79
+ to_hash.to_s
80
+ end
81
+
82
+ # Returns the object in the form of hash
83
+ # @return [Hash] Returns the object in the form of hash
84
+ def to_hash
85
+ hash = {}
86
+ self.class.attribute_map.each_pair do |attr, param|
87
+ value = self.send(attr)
88
+ next if value.nil?
89
+ hash[param] = _to_hash(value)
90
+ end
91
+ hash
92
+ end
93
+
94
+ private
95
+
96
+ # Outputs non-array value in the form of hash
97
+ # For object, use to_hash. Otherwise, just return the value
98
+ # @param [Object] value Any valid value
99
+ # @return [Hash] Returns the value in the form of hash
100
+ def _to_hash(value)
101
+ if value.is_a?(Array)
102
+ value.compact.map{ |v| _to_hash(v) }
103
+ elsif value.is_a?(Hash)
104
+ {}.tap do |hash|
105
+ value.each { |k, v| hash[k] = _to_hash(v) }
106
+ end
107
+ elsif value.respond_to? :to_hash
108
+ value.to_hash
109
+ else
110
+ value
111
+ end
112
+ end
113
+
114
+
115
+
116
+ # Attribute mapping from ruby-style variable name to JSON key.
117
+ def self.attribute_map
118
+ {
119
+ :'creation_type' => :'creationType',
120
+ :'database_admin_password' => :'databaseAdminPassword',
121
+ :'protection_mode' => :'protectionMode',
122
+ :'transport_type' => :'transportType',
123
+ :'peer_db_system_id' => :'peerDbSystemId'
124
+ }
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.swagger_types
129
+ {
130
+ :'creation_type' => :'String',
131
+ :'database_admin_password' => :'String',
132
+ :'protection_mode' => :'String',
133
+ :'transport_type' => :'String',
134
+ :'peer_db_system_id' => :'String'
135
+ }
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,194 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Database::Models::CreateDatabaseDetails
7
+
8
+ DB_WORKLOAD_ENUM = [DB_WORKLOAD_OLTP = 'OLTP',
9
+ DB_WORKLOAD_DSS = 'DSS']
10
+
11
+ # A strong password for SYS, SYSTEM, and PDB Admin. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numbers, and two special characters. The special characters must be _, \\#, or -.
12
+ # @return [String]
13
+ attr_accessor :admin_password
14
+
15
+ # The character set for the database. The default is AL32UTF8. Allowed values are:
16
+ #
17
+ # AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS
18
+ #
19
+ # @return [String]
20
+ attr_accessor :character_set
21
+
22
+ # The database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted.
23
+ # @return [String]
24
+ attr_accessor :db_name
25
+
26
+ # Database workload type.
27
+ # @return [String]
28
+ attr_accessor :db_workload
29
+
30
+ # National character set for the database. The default is AL16UTF16. Allowed values are:
31
+ # AL16UTF16 or UTF8.
32
+ #
33
+ # @return [String]
34
+ attr_accessor :ncharacter_set
35
+
36
+ # Pluggable database name. It must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name.
37
+ # @return [String]
38
+ attr_accessor :pdb_name
39
+
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+ if attributes[:'adminPassword']
50
+ self.admin_password = attributes[:'adminPassword']
51
+ end
52
+
53
+ if attributes[:'characterSet']
54
+ self.character_set = attributes[:'characterSet']
55
+ end
56
+
57
+ if attributes[:'dbName']
58
+ self.db_name = attributes[:'dbName']
59
+ end
60
+
61
+ if attributes[:'dbWorkload']
62
+ self.db_workload = attributes[:'dbWorkload']
63
+ end
64
+
65
+ if attributes[:'ncharacterSet']
66
+ self.ncharacter_set = attributes[:'ncharacterSet']
67
+ end
68
+
69
+ if attributes[:'pdbName']
70
+ self.pdb_name = attributes[:'pdbName']
71
+ end
72
+
73
+ end
74
+
75
+ # Custom attribute writer method checking allowed values (enum).
76
+ # @param [Object] db_workload Object to be assigned
77
+ def db_workload=(db_workload)
78
+ if db_workload && !DB_WORKLOAD_ENUM.include?(db_workload)
79
+ fail "Invalid value for 'db_workload': this must be one of the values in DB_WORKLOAD_ENUM."
80
+ else
81
+ @db_workload = db_workload
82
+ end
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] other_object to be compared
87
+ def ==(other_object)
88
+ return true if self.equal?(other_object)
89
+ self.class == other_object.class &&
90
+ admin_password == other_object.admin_password &&
91
+ character_set == other_object.character_set &&
92
+ db_name == other_object.db_name &&
93
+ db_workload == other_object.db_workload &&
94
+ ncharacter_set == other_object.ncharacter_set &&
95
+ pdb_name == other_object.pdb_name
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] other_object to be compared
100
+ def eql?(other_object)
101
+ self == other_object
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [admin_password, character_set, db_name, db_workload, ncharacter_set, pdb_name].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /^Array<(.*)>/i
117
+ # check to ensure the input is an array given that the the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Returns the string representation of the object
131
+ # @return [String] String presentation of the object
132
+ def to_s
133
+ to_hash.to_s
134
+ end
135
+
136
+ # Returns the object in the form of hash
137
+ # @return [Hash] Returns the object in the form of hash
138
+ def to_hash
139
+ hash = {}
140
+ self.class.attribute_map.each_pair do |attr, param|
141
+ value = self.send(attr)
142
+ next if value.nil?
143
+ hash[param] = _to_hash(value)
144
+ end
145
+ hash
146
+ end
147
+
148
+ private
149
+
150
+ # Outputs non-array value in the form of hash
151
+ # For object, use to_hash. Otherwise, just return the value
152
+ # @param [Object] value Any valid value
153
+ # @return [Hash] Returns the value in the form of hash
154
+ def _to_hash(value)
155
+ if value.is_a?(Array)
156
+ value.compact.map{ |v| _to_hash(v) }
157
+ elsif value.is_a?(Hash)
158
+ {}.tap do |hash|
159
+ value.each { |k, v| hash[k] = _to_hash(v) }
160
+ end
161
+ elsif value.respond_to? :to_hash
162
+ value.to_hash
163
+ else
164
+ value
165
+ end
166
+ end
167
+
168
+
169
+
170
+ # Attribute mapping from ruby-style variable name to JSON key.
171
+ def self.attribute_map
172
+ {
173
+ :'admin_password' => :'adminPassword',
174
+ :'character_set' => :'characterSet',
175
+ :'db_name' => :'dbName',
176
+ :'db_workload' => :'dbWorkload',
177
+ :'ncharacter_set' => :'ncharacterSet',
178
+ :'pdb_name' => :'pdbName'
179
+ }
180
+ end
181
+
182
+ # Attribute type mapping.
183
+ def self.swagger_types
184
+ {
185
+ :'admin_password' => :'String',
186
+ :'character_set' => :'String',
187
+ :'db_name' => :'String',
188
+ :'db_workload' => :'String',
189
+ :'ncharacter_set' => :'String',
190
+ :'pdb_name' => :'String'
191
+ }
192
+ end
193
+ end
194
+ end