oci 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,216 @@
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::DbHome
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
12
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
13
+ LIFECYCLE_STATE_FAILED = 'FAILED',
14
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
15
+
16
+ # The OCID of the compartment.
17
+ # @return [String]
18
+ attr_accessor :compartment_id
19
+
20
+ # The OCID of the DB System.
21
+ # @return [String]
22
+ attr_accessor :db_system_id
23
+
24
+ # The Oracle database version.
25
+ # @return [String]
26
+ attr_accessor :db_version
27
+
28
+ # The user-provided name for the database home. It does not need to be unique.
29
+ # @return [String]
30
+ attr_accessor :display_name
31
+
32
+ # The OCID of the database home.
33
+ # @return [String]
34
+ attr_accessor :id
35
+
36
+ # The OCID of the last patch history. This is updated as soon as a patch operation is started.
37
+ # @return [String]
38
+ attr_accessor :last_patch_history_entry_id
39
+
40
+ # The current state of the database home.
41
+ # @return [String]
42
+ attr_accessor :lifecycle_state
43
+
44
+ # The date and time the database home was created.
45
+ # @return [DateTime]
46
+ attr_accessor :time_created
47
+
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
56
+
57
+ if attributes[:'compartmentId']
58
+ self.compartment_id = attributes[:'compartmentId']
59
+ end
60
+
61
+ if attributes[:'dbSystemId']
62
+ self.db_system_id = attributes[:'dbSystemId']
63
+ end
64
+
65
+ if attributes[:'dbVersion']
66
+ self.db_version = attributes[:'dbVersion']
67
+ end
68
+
69
+ if attributes[:'displayName']
70
+ self.display_name = attributes[:'displayName']
71
+ end
72
+
73
+ if attributes[:'id']
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes[:'lastPatchHistoryEntryId']
78
+ self.last_patch_history_entry_id = attributes[:'lastPatchHistoryEntryId']
79
+ end
80
+
81
+ if attributes[:'lifecycleState']
82
+ self.lifecycle_state = attributes[:'lifecycleState']
83
+ end
84
+
85
+ if attributes[:'timeCreated']
86
+ self.time_created = attributes[:'timeCreated']
87
+ end
88
+
89
+ end
90
+
91
+ # Custom attribute writer method checking allowed values (enum).
92
+ # @param [Object] lifecycle_state Object to be assigned
93
+ def lifecycle_state=(lifecycle_state)
94
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
95
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
96
+ else
97
+ @lifecycle_state = lifecycle_state
98
+ end
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] other_object to be compared
103
+ def ==(other_object)
104
+ return true if self.equal?(other_object)
105
+ self.class == other_object.class &&
106
+ compartment_id == other_object.compartment_id &&
107
+ db_system_id == other_object.db_system_id &&
108
+ db_version == other_object.db_version &&
109
+ display_name == other_object.display_name &&
110
+ id == other_object.id &&
111
+ last_patch_history_entry_id == other_object.last_patch_history_entry_id &&
112
+ lifecycle_state == other_object.lifecycle_state &&
113
+ time_created == other_object.time_created
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] other_object to be compared
118
+ def eql?(other_object)
119
+ self == other_object
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [compartment_id, db_system_id, db_version, display_name, id, last_patch_history_entry_id, lifecycle_state, time_created].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /^Array<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ private
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+
187
+
188
+ # Attribute mapping from ruby-style variable name to JSON key.
189
+ def self.attribute_map
190
+ {
191
+ :'compartment_id' => :'compartmentId',
192
+ :'db_system_id' => :'dbSystemId',
193
+ :'db_version' => :'dbVersion',
194
+ :'display_name' => :'displayName',
195
+ :'id' => :'id',
196
+ :'last_patch_history_entry_id' => :'lastPatchHistoryEntryId',
197
+ :'lifecycle_state' => :'lifecycleState',
198
+ :'time_created' => :'timeCreated'
199
+ }
200
+ end
201
+
202
+ # Attribute type mapping.
203
+ def self.swagger_types
204
+ {
205
+ :'compartment_id' => :'String',
206
+ :'db_system_id' => :'String',
207
+ :'db_version' => :'String',
208
+ :'display_name' => :'String',
209
+ :'id' => :'String',
210
+ :'last_patch_history_entry_id' => :'String',
211
+ :'lifecycle_state' => :'String',
212
+ :'time_created' => :'DateTime'
213
+ }
214
+ end
215
+ end
216
+ end
@@ -0,0 +1,216 @@
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::DbHomeSummary
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
12
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
13
+ LIFECYCLE_STATE_FAILED = 'FAILED',
14
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
15
+
16
+ # The OCID of the compartment.
17
+ # @return [String]
18
+ attr_accessor :compartment_id
19
+
20
+ # The OCID of the DB System.
21
+ # @return [String]
22
+ attr_accessor :db_system_id
23
+
24
+ # The Oracle database version.
25
+ # @return [String]
26
+ attr_accessor :db_version
27
+
28
+ # The user-provided name for the database home. It does not need to be unique.
29
+ # @return [String]
30
+ attr_accessor :display_name
31
+
32
+ # The OCID of the database home.
33
+ # @return [String]
34
+ attr_accessor :id
35
+
36
+ # The OCID of the last patch history. This is updated as soon as a patch operation is started.
37
+ # @return [String]
38
+ attr_accessor :last_patch_history_entry_id
39
+
40
+ # The current state of the database home.
41
+ # @return [String]
42
+ attr_accessor :lifecycle_state
43
+
44
+ # The date and time the database home was created.
45
+ # @return [DateTime]
46
+ attr_accessor :time_created
47
+
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
56
+
57
+ if attributes[:'compartmentId']
58
+ self.compartment_id = attributes[:'compartmentId']
59
+ end
60
+
61
+ if attributes[:'dbSystemId']
62
+ self.db_system_id = attributes[:'dbSystemId']
63
+ end
64
+
65
+ if attributes[:'dbVersion']
66
+ self.db_version = attributes[:'dbVersion']
67
+ end
68
+
69
+ if attributes[:'displayName']
70
+ self.display_name = attributes[:'displayName']
71
+ end
72
+
73
+ if attributes[:'id']
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes[:'lastPatchHistoryEntryId']
78
+ self.last_patch_history_entry_id = attributes[:'lastPatchHistoryEntryId']
79
+ end
80
+
81
+ if attributes[:'lifecycleState']
82
+ self.lifecycle_state = attributes[:'lifecycleState']
83
+ end
84
+
85
+ if attributes[:'timeCreated']
86
+ self.time_created = attributes[:'timeCreated']
87
+ end
88
+
89
+ end
90
+
91
+ # Custom attribute writer method checking allowed values (enum).
92
+ # @param [Object] lifecycle_state Object to be assigned
93
+ def lifecycle_state=(lifecycle_state)
94
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
95
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
96
+ else
97
+ @lifecycle_state = lifecycle_state
98
+ end
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] other_object to be compared
103
+ def ==(other_object)
104
+ return true if self.equal?(other_object)
105
+ self.class == other_object.class &&
106
+ compartment_id == other_object.compartment_id &&
107
+ db_system_id == other_object.db_system_id &&
108
+ db_version == other_object.db_version &&
109
+ display_name == other_object.display_name &&
110
+ id == other_object.id &&
111
+ last_patch_history_entry_id == other_object.last_patch_history_entry_id &&
112
+ lifecycle_state == other_object.lifecycle_state &&
113
+ time_created == other_object.time_created
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] other_object to be compared
118
+ def eql?(other_object)
119
+ self == other_object
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [compartment_id, db_system_id, db_version, display_name, id, last_patch_history_entry_id, lifecycle_state, time_created].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /^Array<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
142
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Returns the string representation of the object
149
+ # @return [String] String presentation of the object
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # Returns the object in the form of hash
155
+ # @return [Hash] Returns the object in the form of hash
156
+ def to_hash
157
+ hash = {}
158
+ self.class.attribute_map.each_pair do |attr, param|
159
+ value = self.send(attr)
160
+ next if value.nil?
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ private
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+
187
+
188
+ # Attribute mapping from ruby-style variable name to JSON key.
189
+ def self.attribute_map
190
+ {
191
+ :'compartment_id' => :'compartmentId',
192
+ :'db_system_id' => :'dbSystemId',
193
+ :'db_version' => :'dbVersion',
194
+ :'display_name' => :'displayName',
195
+ :'id' => :'id',
196
+ :'last_patch_history_entry_id' => :'lastPatchHistoryEntryId',
197
+ :'lifecycle_state' => :'lifecycleState',
198
+ :'time_created' => :'timeCreated'
199
+ }
200
+ end
201
+
202
+ # Attribute type mapping.
203
+ def self.swagger_types
204
+ {
205
+ :'compartment_id' => :'String',
206
+ :'db_system_id' => :'String',
207
+ :'db_version' => :'String',
208
+ :'display_name' => :'String',
209
+ :'id' => :'String',
210
+ :'last_patch_history_entry_id' => :'String',
211
+ :'lifecycle_state' => :'String',
212
+ :'time_created' => :'DateTime'
213
+ }
214
+ end
215
+ end
216
+ end
@@ -0,0 +1,220 @@
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::DbNode
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_UPDATING = 'UPDATING',
11
+ LIFECYCLE_STATE_STOPPING = 'STOPPING',
12
+ LIFECYCLE_STATE_STOPPED = 'STOPPED',
13
+ LIFECYCLE_STATE_STARTING = 'STARTING',
14
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
15
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
16
+ LIFECYCLE_STATE_FAILED = 'FAILED',
17
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
18
+
19
+ # The OCID of the backup VNIC.
20
+ # @return [String]
21
+ attr_accessor :backup_vnic_id
22
+
23
+ # The OCID of the DB System.
24
+ # @return [String]
25
+ attr_accessor :db_system_id
26
+
27
+ # The host name for the DB Node.
28
+ # @return [String]
29
+ attr_accessor :hostname
30
+
31
+ # The OCID of the DB Node.
32
+ # @return [String]
33
+ attr_accessor :id
34
+
35
+ # The current state of the database node.
36
+ # @return [String]
37
+ attr_accessor :lifecycle_state
38
+
39
+ # Storage size, in GBs, of the software volume that is allocated to the DB system. This is applicable only for VM-based DBs.
40
+ #
41
+ # @return [Integer]
42
+ attr_accessor :software_storage_size_in_gb
43
+
44
+ # The date and time that the DB Node was created.
45
+ # @return [DateTime]
46
+ attr_accessor :time_created
47
+
48
+ # The OCID of the VNIC.
49
+ # @return [String]
50
+ attr_accessor :vnic_id
51
+
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
60
+
61
+ if attributes[:'backupVnicId']
62
+ self.backup_vnic_id = attributes[:'backupVnicId']
63
+ end
64
+
65
+ if attributes[:'dbSystemId']
66
+ self.db_system_id = attributes[:'dbSystemId']
67
+ end
68
+
69
+ if attributes[:'hostname']
70
+ self.hostname = attributes[:'hostname']
71
+ end
72
+
73
+ if attributes[:'id']
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes[:'lifecycleState']
78
+ self.lifecycle_state = attributes[:'lifecycleState']
79
+ end
80
+
81
+ if attributes[:'softwareStorageSizeInGB']
82
+ self.software_storage_size_in_gb = attributes[:'softwareStorageSizeInGB']
83
+ end
84
+
85
+ if attributes[:'timeCreated']
86
+ self.time_created = attributes[:'timeCreated']
87
+ end
88
+
89
+ if attributes[:'vnicId']
90
+ self.vnic_id = attributes[:'vnicId']
91
+ end
92
+
93
+ end
94
+
95
+ # Custom attribute writer method checking allowed values (enum).
96
+ # @param [Object] lifecycle_state Object to be assigned
97
+ def lifecycle_state=(lifecycle_state)
98
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
99
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
100
+ else
101
+ @lifecycle_state = lifecycle_state
102
+ end
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] other_object to be compared
107
+ def ==(other_object)
108
+ return true if self.equal?(other_object)
109
+ self.class == other_object.class &&
110
+ backup_vnic_id == other_object.backup_vnic_id &&
111
+ db_system_id == other_object.db_system_id &&
112
+ hostname == other_object.hostname &&
113
+ id == other_object.id &&
114
+ lifecycle_state == other_object.lifecycle_state &&
115
+ software_storage_size_in_gb == other_object.software_storage_size_in_gb &&
116
+ time_created == other_object.time_created &&
117
+ vnic_id == other_object.vnic_id
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] other_object to be compared
122
+ def eql?(other_object)
123
+ self == other_object
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [backup_vnic_id, db_system_id, hostname, id, lifecycle_state, software_storage_size_in_gb, time_created, vnic_id].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /^Array<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ private
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map{ |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+
190
+
191
+
192
+ # Attribute mapping from ruby-style variable name to JSON key.
193
+ def self.attribute_map
194
+ {
195
+ :'backup_vnic_id' => :'backupVnicId',
196
+ :'db_system_id' => :'dbSystemId',
197
+ :'hostname' => :'hostname',
198
+ :'id' => :'id',
199
+ :'lifecycle_state' => :'lifecycleState',
200
+ :'software_storage_size_in_gb' => :'softwareStorageSizeInGB',
201
+ :'time_created' => :'timeCreated',
202
+ :'vnic_id' => :'vnicId'
203
+ }
204
+ end
205
+
206
+ # Attribute type mapping.
207
+ def self.swagger_types
208
+ {
209
+ :'backup_vnic_id' => :'String',
210
+ :'db_system_id' => :'String',
211
+ :'hostname' => :'String',
212
+ :'id' => :'String',
213
+ :'lifecycle_state' => :'String',
214
+ :'software_storage_size_in_gb' => :'Integer',
215
+ :'time_created' => :'DateTime',
216
+ :'vnic_id' => :'String'
217
+ }
218
+ end
219
+ end
220
+ end