oci 2.1.2 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -13
- data/lib/oci/core/blockstorage_client.rb +690 -61
- data/lib/oci/core/blockstorage_client_composite_operations.rb +238 -0
- data/lib/oci/core/compute_client.rb +1 -5
- data/lib/oci/core/core.rb +10 -0
- data/lib/oci/core/models/boot_volume.rb +18 -4
- data/lib/oci/core/models/cpe.rb +38 -1
- data/lib/oci/core/models/create_cpe_details.rb +38 -1
- data/lib/oci/core/models/create_drg_details.rb +41 -4
- data/lib/oci/core/models/create_internet_gateway_details.rb +38 -1
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +38 -1
- data/lib/oci/core/models/create_local_peering_gateway_details.rb +38 -1
- data/lib/oci/core/models/create_public_ip_details.rb +38 -1
- data/lib/oci/core/models/create_vnic_details.rb +38 -1
- data/lib/oci/core/models/create_volume_group_backup_details.rb +239 -0
- data/lib/oci/core/models/create_volume_group_details.rb +231 -0
- data/lib/oci/core/models/drg.rb +38 -1
- data/lib/oci/core/models/internet_gateway.rb +38 -1
- data/lib/oci/core/models/ip_sec_connection.rb +38 -1
- data/lib/oci/core/models/launch_options.rb +4 -0
- data/lib/oci/core/models/local_peering_gateway.rb +38 -1
- data/lib/oci/core/models/public_ip.rb +38 -1
- data/lib/oci/core/models/update_cpe_details.rb +41 -4
- data/lib/oci/core/models/update_drg_details.rb +41 -4
- data/lib/oci/core/models/update_internet_gateway_details.rb +38 -1
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +41 -4
- data/lib/oci/core/models/update_local_peering_gateway_details.rb +41 -4
- data/lib/oci/core/models/update_public_ip_details.rb +38 -1
- data/lib/oci/core/models/update_vnic_details.rb +38 -1
- data/lib/oci/core/models/update_volume_group_backup_details.rb +187 -0
- data/lib/oci/core/models/update_volume_group_details.rb +201 -0
- data/lib/oci/core/models/vnic.rb +38 -1
- data/lib/oci/core/models/volume.rb +18 -4
- data/lib/oci/core/models/volume_group.rb +322 -0
- data/lib/oci/core/models/volume_group_backup.rb +380 -0
- data/lib/oci/core/models/volume_group_source_details.rb +164 -0
- data/lib/oci/core/models/volume_group_source_from_volume_group_backup_details.rb +158 -0
- data/lib/oci/core/models/volume_group_source_from_volume_group_details.rb +158 -0
- data/lib/oci/core/models/volume_group_source_from_volumes_details.rb +158 -0
- data/lib/oci/core/virtual_network_client.rb +6 -6
- data/lib/oci/database/database.rb +3 -0
- data/lib/oci/database/database_client.rb +1 -1
- data/lib/oci/database/database_client_composite_operations.rb +1 -1
- data/lib/oci/database/models/backup.rb +31 -1
- data/lib/oci/database/models/backup_summary.rb +31 -1
- data/lib/oci/database/models/create_db_home_from_backup_details.rb +160 -0
- data/lib/oci/database/models/launch_db_system_base.rb +438 -0
- data/lib/oci/database/models/launch_db_system_details.rb +41 -227
- data/lib/oci/database/models/launch_db_system_from_backup_details.rb +314 -0
- data/lib/oci/file_storage/file_storage_client.rb +9 -8
- data/lib/oci/file_storage/models/export.rb +6 -5
- data/lib/oci/file_storage/models/file_system_summary.rb +1 -2
- data/lib/oci/version.rb +1 -1
- metadata +15 -2
@@ -0,0 +1,158 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require_relative 'volume_group_source_details'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# Specifies the volume group backup to restore from.
|
9
|
+
class Core::Models::VolumeGroupSourceFromVolumeGroupBackupDetails < Core::Models::VolumeGroupSourceDetails # rubocop:disable Metrics/LineLength
|
10
|
+
# **[Required]** The OCID of the volume group backup to restore from.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :volume_group_backup_id
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
# rubocop:disable Style/SymbolLiteral
|
18
|
+
'type': :'type',
|
19
|
+
'volume_group_backup_id': :'volumeGroupBackupId'
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Attribute type mapping.
|
25
|
+
def self.swagger_types
|
26
|
+
{
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
28
|
+
'type': :'String',
|
29
|
+
'volume_group_backup_id': :'String'
|
30
|
+
# rubocop:enable Style/SymbolLiteral
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
35
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
36
|
+
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
# @option attributes [String] :volume_group_backup_id The value to assign to the {#volume_group_backup_id} property
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
attributes['type'] = 'volumeGroupBackupId'
|
45
|
+
|
46
|
+
super(attributes)
|
47
|
+
|
48
|
+
# convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
50
|
+
|
51
|
+
self.volume_group_backup_id = attributes[:'volumeGroupBackupId'] if attributes[:'volumeGroupBackupId']
|
52
|
+
|
53
|
+
raise 'You cannot provide both :volumeGroupBackupId and :volume_group_backup_id' if attributes.key?(:'volumeGroupBackupId') && attributes.key?(:'volume_group_backup_id')
|
54
|
+
|
55
|
+
self.volume_group_backup_id = attributes[:'volume_group_backup_id'] if attributes[:'volume_group_backup_id']
|
56
|
+
end
|
57
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
58
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
59
|
+
|
60
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
61
|
+
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] other the other object to be compared
|
65
|
+
def ==(other)
|
66
|
+
return true if equal?(other)
|
67
|
+
self.class == other.class &&
|
68
|
+
type == other.type &&
|
69
|
+
volume_group_backup_id == other.volume_group_backup_id
|
70
|
+
end
|
71
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
72
|
+
|
73
|
+
# @see the `==` method
|
74
|
+
# @param [Object] other the other object to be compared
|
75
|
+
def eql?(other)
|
76
|
+
self == other
|
77
|
+
end
|
78
|
+
|
79
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
80
|
+
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[type, volume_group_backup_id].hash
|
86
|
+
end
|
87
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
88
|
+
|
89
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
90
|
+
|
91
|
+
|
92
|
+
# Builds the object from hash
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
94
|
+
# @return [Object] Returns the model itself
|
95
|
+
def build_from_hash(attributes)
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
98
|
+
if type =~ /^Array<(.*)>/i
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
100
|
+
# is documented as an array but the input is not
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
102
|
+
public_method("#{key}=").call(
|
103
|
+
attributes[self.class.attribute_map[key]]
|
104
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
105
|
+
)
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
public_method("#{key}=").call(
|
109
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
110
|
+
)
|
111
|
+
end
|
112
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
118
|
+
|
119
|
+
# Returns the string representation of the object
|
120
|
+
# @return [String] String presentation of the object
|
121
|
+
def to_s
|
122
|
+
to_hash.to_s
|
123
|
+
end
|
124
|
+
|
125
|
+
# Returns the object in the form of hash
|
126
|
+
# @return [Hash] Returns the object in the form of hash
|
127
|
+
def to_hash
|
128
|
+
hash = {}
|
129
|
+
self.class.attribute_map.each_pair do |attr, param|
|
130
|
+
value = public_method(attr).call
|
131
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
132
|
+
hash[param] = _to_hash(value)
|
133
|
+
end
|
134
|
+
hash
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
# Outputs non-array value in the form of hash
|
140
|
+
# For object, use to_hash. Otherwise, just return the value
|
141
|
+
# @param [Object] value Any valid value
|
142
|
+
# @return [Hash] Returns the value in the form of hash
|
143
|
+
def _to_hash(value)
|
144
|
+
if value.is_a?(Array)
|
145
|
+
value.compact.map { |v| _to_hash(v) }
|
146
|
+
elsif value.is_a?(Hash)
|
147
|
+
{}.tap do |hash|
|
148
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
149
|
+
end
|
150
|
+
elsif value.respond_to? :to_hash
|
151
|
+
value.to_hash
|
152
|
+
else
|
153
|
+
value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require_relative 'volume_group_source_details'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# Specifies the volume group to clone from.
|
9
|
+
class Core::Models::VolumeGroupSourceFromVolumeGroupDetails < Core::Models::VolumeGroupSourceDetails # rubocop:disable Metrics/LineLength
|
10
|
+
# **[Required]** The OCID of the volume group to clone from.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :volume_group_id
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
# rubocop:disable Style/SymbolLiteral
|
18
|
+
'type': :'type',
|
19
|
+
'volume_group_id': :'volumeGroupId'
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Attribute type mapping.
|
25
|
+
def self.swagger_types
|
26
|
+
{
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
28
|
+
'type': :'String',
|
29
|
+
'volume_group_id': :'String'
|
30
|
+
# rubocop:enable Style/SymbolLiteral
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
35
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
36
|
+
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
# @option attributes [String] :volume_group_id The value to assign to the {#volume_group_id} property
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
attributes['type'] = 'volumeGroupId'
|
45
|
+
|
46
|
+
super(attributes)
|
47
|
+
|
48
|
+
# convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
50
|
+
|
51
|
+
self.volume_group_id = attributes[:'volumeGroupId'] if attributes[:'volumeGroupId']
|
52
|
+
|
53
|
+
raise 'You cannot provide both :volumeGroupId and :volume_group_id' if attributes.key?(:'volumeGroupId') && attributes.key?(:'volume_group_id')
|
54
|
+
|
55
|
+
self.volume_group_id = attributes[:'volume_group_id'] if attributes[:'volume_group_id']
|
56
|
+
end
|
57
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
58
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
59
|
+
|
60
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
61
|
+
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] other the other object to be compared
|
65
|
+
def ==(other)
|
66
|
+
return true if equal?(other)
|
67
|
+
self.class == other.class &&
|
68
|
+
type == other.type &&
|
69
|
+
volume_group_id == other.volume_group_id
|
70
|
+
end
|
71
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
72
|
+
|
73
|
+
# @see the `==` method
|
74
|
+
# @param [Object] other the other object to be compared
|
75
|
+
def eql?(other)
|
76
|
+
self == other
|
77
|
+
end
|
78
|
+
|
79
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
80
|
+
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[type, volume_group_id].hash
|
86
|
+
end
|
87
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
88
|
+
|
89
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
90
|
+
|
91
|
+
|
92
|
+
# Builds the object from hash
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
94
|
+
# @return [Object] Returns the model itself
|
95
|
+
def build_from_hash(attributes)
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
98
|
+
if type =~ /^Array<(.*)>/i
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
100
|
+
# is documented as an array but the input is not
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
102
|
+
public_method("#{key}=").call(
|
103
|
+
attributes[self.class.attribute_map[key]]
|
104
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
105
|
+
)
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
public_method("#{key}=").call(
|
109
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
110
|
+
)
|
111
|
+
end
|
112
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
118
|
+
|
119
|
+
# Returns the string representation of the object
|
120
|
+
# @return [String] String presentation of the object
|
121
|
+
def to_s
|
122
|
+
to_hash.to_s
|
123
|
+
end
|
124
|
+
|
125
|
+
# Returns the object in the form of hash
|
126
|
+
# @return [Hash] Returns the object in the form of hash
|
127
|
+
def to_hash
|
128
|
+
hash = {}
|
129
|
+
self.class.attribute_map.each_pair do |attr, param|
|
130
|
+
value = public_method(attr).call
|
131
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
132
|
+
hash[param] = _to_hash(value)
|
133
|
+
end
|
134
|
+
hash
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
# Outputs non-array value in the form of hash
|
140
|
+
# For object, use to_hash. Otherwise, just return the value
|
141
|
+
# @param [Object] value Any valid value
|
142
|
+
# @return [Hash] Returns the value in the form of hash
|
143
|
+
def _to_hash(value)
|
144
|
+
if value.is_a?(Array)
|
145
|
+
value.compact.map { |v| _to_hash(v) }
|
146
|
+
elsif value.is_a?(Hash)
|
147
|
+
{}.tap do |hash|
|
148
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
149
|
+
end
|
150
|
+
elsif value.respond_to? :to_hash
|
151
|
+
value.to_hash
|
152
|
+
else
|
153
|
+
value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require_relative 'volume_group_source_details'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# Specifies volumes in a volume group.
|
9
|
+
class Core::Models::VolumeGroupSourceFromVolumesDetails < Core::Models::VolumeGroupSourceDetails # rubocop:disable Metrics/LineLength
|
10
|
+
# **[Required]** OCIDs for the volumes in this volume group.
|
11
|
+
# @return [Array<String>]
|
12
|
+
attr_accessor :volume_ids
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
# rubocop:disable Style/SymbolLiteral
|
18
|
+
'type': :'type',
|
19
|
+
'volume_ids': :'volumeIds'
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# Attribute type mapping.
|
25
|
+
def self.swagger_types
|
26
|
+
{
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
28
|
+
'type': :'String',
|
29
|
+
'volume_ids': :'Array<String>'
|
30
|
+
# rubocop:enable Style/SymbolLiteral
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
35
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
36
|
+
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
# @option attributes [Array<String>] :volume_ids The value to assign to the {#volume_ids} property
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
attributes['type'] = 'volumeIds'
|
45
|
+
|
46
|
+
super(attributes)
|
47
|
+
|
48
|
+
# convert string to symbol for hash key
|
49
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
50
|
+
|
51
|
+
self.volume_ids = attributes[:'volumeIds'] if attributes[:'volumeIds']
|
52
|
+
|
53
|
+
raise 'You cannot provide both :volumeIds and :volume_ids' if attributes.key?(:'volumeIds') && attributes.key?(:'volume_ids')
|
54
|
+
|
55
|
+
self.volume_ids = attributes[:'volume_ids'] if attributes[:'volume_ids']
|
56
|
+
end
|
57
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
58
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
59
|
+
|
60
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
61
|
+
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] other the other object to be compared
|
65
|
+
def ==(other)
|
66
|
+
return true if equal?(other)
|
67
|
+
self.class == other.class &&
|
68
|
+
type == other.type &&
|
69
|
+
volume_ids == other.volume_ids
|
70
|
+
end
|
71
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
72
|
+
|
73
|
+
# @see the `==` method
|
74
|
+
# @param [Object] other the other object to be compared
|
75
|
+
def eql?(other)
|
76
|
+
self == other
|
77
|
+
end
|
78
|
+
|
79
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
80
|
+
|
81
|
+
|
82
|
+
# Calculates hash code according to all attributes.
|
83
|
+
# @return [Fixnum] Hash code
|
84
|
+
def hash
|
85
|
+
[type, volume_ids].hash
|
86
|
+
end
|
87
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
88
|
+
|
89
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
90
|
+
|
91
|
+
|
92
|
+
# Builds the object from hash
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
94
|
+
# @return [Object] Returns the model itself
|
95
|
+
def build_from_hash(attributes)
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
98
|
+
if type =~ /^Array<(.*)>/i
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
100
|
+
# is documented as an array but the input is not
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
102
|
+
public_method("#{key}=").call(
|
103
|
+
attributes[self.class.attribute_map[key]]
|
104
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
105
|
+
)
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
public_method("#{key}=").call(
|
109
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
110
|
+
)
|
111
|
+
end
|
112
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
118
|
+
|
119
|
+
# Returns the string representation of the object
|
120
|
+
# @return [String] String presentation of the object
|
121
|
+
def to_s
|
122
|
+
to_hash.to_s
|
123
|
+
end
|
124
|
+
|
125
|
+
# Returns the object in the form of hash
|
126
|
+
# @return [Hash] Returns the object in the form of hash
|
127
|
+
def to_hash
|
128
|
+
hash = {}
|
129
|
+
self.class.attribute_map.each_pair do |attr, param|
|
130
|
+
value = public_method(attr).call
|
131
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
132
|
+
hash[param] = _to_hash(value)
|
133
|
+
end
|
134
|
+
hash
|
135
|
+
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
# Outputs non-array value in the form of hash
|
140
|
+
# For object, use to_hash. Otherwise, just return the value
|
141
|
+
# @param [Object] value Any valid value
|
142
|
+
# @return [Hash] Returns the value in the form of hash
|
143
|
+
def _to_hash(value)
|
144
|
+
if value.is_a?(Array)
|
145
|
+
value.compact.map { |v| _to_hash(v) }
|
146
|
+
elsif value.is_a?(Hash)
|
147
|
+
{}.tap do |hash|
|
148
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
149
|
+
end
|
150
|
+
elsif value.respond_to? :to_hash
|
151
|
+
value.to_hash
|
152
|
+
else
|
153
|
+
value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|