oci 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -13
  3. data/lib/oci/core/blockstorage_client.rb +690 -61
  4. data/lib/oci/core/blockstorage_client_composite_operations.rb +238 -0
  5. data/lib/oci/core/compute_client.rb +1 -5
  6. data/lib/oci/core/core.rb +10 -0
  7. data/lib/oci/core/models/boot_volume.rb +18 -4
  8. data/lib/oci/core/models/cpe.rb +38 -1
  9. data/lib/oci/core/models/create_cpe_details.rb +38 -1
  10. data/lib/oci/core/models/create_drg_details.rb +41 -4
  11. data/lib/oci/core/models/create_internet_gateway_details.rb +38 -1
  12. data/lib/oci/core/models/create_ip_sec_connection_details.rb +38 -1
  13. data/lib/oci/core/models/create_local_peering_gateway_details.rb +38 -1
  14. data/lib/oci/core/models/create_public_ip_details.rb +38 -1
  15. data/lib/oci/core/models/create_vnic_details.rb +38 -1
  16. data/lib/oci/core/models/create_volume_group_backup_details.rb +239 -0
  17. data/lib/oci/core/models/create_volume_group_details.rb +231 -0
  18. data/lib/oci/core/models/drg.rb +38 -1
  19. data/lib/oci/core/models/internet_gateway.rb +38 -1
  20. data/lib/oci/core/models/ip_sec_connection.rb +38 -1
  21. data/lib/oci/core/models/launch_options.rb +4 -0
  22. data/lib/oci/core/models/local_peering_gateway.rb +38 -1
  23. data/lib/oci/core/models/public_ip.rb +38 -1
  24. data/lib/oci/core/models/update_cpe_details.rb +41 -4
  25. data/lib/oci/core/models/update_drg_details.rb +41 -4
  26. data/lib/oci/core/models/update_internet_gateway_details.rb +38 -1
  27. data/lib/oci/core/models/update_ip_sec_connection_details.rb +41 -4
  28. data/lib/oci/core/models/update_local_peering_gateway_details.rb +41 -4
  29. data/lib/oci/core/models/update_public_ip_details.rb +38 -1
  30. data/lib/oci/core/models/update_vnic_details.rb +38 -1
  31. data/lib/oci/core/models/update_volume_group_backup_details.rb +187 -0
  32. data/lib/oci/core/models/update_volume_group_details.rb +201 -0
  33. data/lib/oci/core/models/vnic.rb +38 -1
  34. data/lib/oci/core/models/volume.rb +18 -4
  35. data/lib/oci/core/models/volume_group.rb +322 -0
  36. data/lib/oci/core/models/volume_group_backup.rb +380 -0
  37. data/lib/oci/core/models/volume_group_source_details.rb +164 -0
  38. data/lib/oci/core/models/volume_group_source_from_volume_group_backup_details.rb +158 -0
  39. data/lib/oci/core/models/volume_group_source_from_volume_group_details.rb +158 -0
  40. data/lib/oci/core/models/volume_group_source_from_volumes_details.rb +158 -0
  41. data/lib/oci/core/virtual_network_client.rb +6 -6
  42. data/lib/oci/database/database.rb +3 -0
  43. data/lib/oci/database/database_client.rb +1 -1
  44. data/lib/oci/database/database_client_composite_operations.rb +1 -1
  45. data/lib/oci/database/models/backup.rb +31 -1
  46. data/lib/oci/database/models/backup_summary.rb +31 -1
  47. data/lib/oci/database/models/create_db_home_from_backup_details.rb +160 -0
  48. data/lib/oci/database/models/launch_db_system_base.rb +438 -0
  49. data/lib/oci/database/models/launch_db_system_details.rb +41 -227
  50. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +314 -0
  51. data/lib/oci/file_storage/file_storage_client.rb +9 -8
  52. data/lib/oci/file_storage/models/export.rb +6 -5
  53. data/lib/oci/file_storage/models/file_system_summary.rb +1 -2
  54. data/lib/oci/version.rb +1 -1
  55. metadata +15 -2
@@ -6,12 +6,29 @@ require 'date'
6
6
  module OCI
7
7
  # UpdatePublicIpDetails model.
8
8
  class Core::Models::UpdatePublicIpDetails # rubocop:disable Metrics/LineLength
9
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
10
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
9
17
  # A user-friendly name. Does not have to be unique, and it's changeable. Avoid
10
18
  # entering confidential information.
11
19
  #
12
20
  # @return [String]
13
21
  attr_accessor :display_name
14
22
 
23
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
24
+ # predefined name, type, or namespace. For more information, see
25
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
26
+ #
27
+ # Example: `{\"Department\": \"Finance\"}`
28
+ #
29
+ # @return [Hash<String, String>]
30
+ attr_accessor :freeform_tags
31
+
15
32
  # The OCID of the private IP to assign the public IP to.
16
33
  # * If the public IP is already assigned to a different private IP, it will be unassigned
17
34
  # and then reassigned to the specified private IP.
@@ -25,7 +42,9 @@ module OCI
25
42
  def self.attribute_map
26
43
  {
27
44
  # rubocop:disable Style/SymbolLiteral
45
+ 'defined_tags': :'definedTags',
28
46
  'display_name': :'displayName',
47
+ 'freeform_tags': :'freeformTags',
29
48
  'private_ip_id': :'privateIpId'
30
49
  # rubocop:enable Style/SymbolLiteral
31
50
  }
@@ -35,7 +54,9 @@ module OCI
35
54
  def self.swagger_types
36
55
  {
37
56
  # rubocop:disable Style/SymbolLiteral
57
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
38
58
  'display_name': :'String',
59
+ 'freeform_tags': :'Hash<String, String>',
39
60
  'private_ip_id': :'String'
40
61
  # rubocop:enable Style/SymbolLiteral
41
62
  }
@@ -47,7 +68,9 @@ module OCI
47
68
 
48
69
  # Initializes the object
49
70
  # @param [Hash] attributes Model attributes in the form of hash
71
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
50
72
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
73
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
51
74
  # @option attributes [String] :private_ip_id The value to assign to the {#private_ip_id} property
52
75
  def initialize(attributes = {})
53
76
  return unless attributes.is_a?(Hash)
@@ -55,12 +78,24 @@ module OCI
55
78
  # convert string to symbol for hash key
56
79
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
80
 
81
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
82
+
83
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
84
+
85
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
86
+
58
87
  self.display_name = attributes[:'displayName'] if attributes[:'displayName']
59
88
 
60
89
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
61
90
 
62
91
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
63
92
 
93
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
94
+
95
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
96
+
97
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
98
+
64
99
  self.private_ip_id = attributes[:'privateIpId'] if attributes[:'privateIpId']
65
100
 
66
101
  raise 'You cannot provide both :privateIpId and :private_ip_id' if attributes.key?(:'privateIpId') && attributes.key?(:'private_ip_id')
@@ -78,7 +113,9 @@ module OCI
78
113
  def ==(other)
79
114
  return true if equal?(other)
80
115
  self.class == other.class &&
116
+ defined_tags == other.defined_tags &&
81
117
  display_name == other.display_name &&
118
+ freeform_tags == other.freeform_tags &&
82
119
  private_ip_id == other.private_ip_id
83
120
  end
84
121
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
@@ -95,7 +132,7 @@ module OCI
95
132
  # Calculates hash code according to all attributes.
96
133
  # @return [Fixnum] Hash code
97
134
  def hash
98
- [display_name, private_ip_id].hash
135
+ [defined_tags, display_name, freeform_tags, private_ip_id].hash
99
136
  end
100
137
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
101
138
 
@@ -6,10 +6,27 @@ require 'date'
6
6
  module OCI
7
7
  # UpdateVnicDetails model.
8
8
  class Core::Models::UpdateVnicDetails # rubocop:disable Metrics/LineLength
9
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
10
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
9
17
  # A user-friendly name. Does not have to be unique, and it's changeable.
10
18
  # @return [String]
11
19
  attr_accessor :display_name
12
20
 
21
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
22
+ # predefined name, type, or namespace. For more information, see
23
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
24
+ #
25
+ # Example: `{\"Department\": \"Finance\"}`
26
+ #
27
+ # @return [Hash<String, String>]
28
+ attr_accessor :freeform_tags
29
+
13
30
  # The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname
14
31
  # portion of the primary private IP's fully qualified domain name (FQDN)
15
32
  # (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`).
@@ -41,7 +58,9 @@ module OCI
41
58
  def self.attribute_map
42
59
  {
43
60
  # rubocop:disable Style/SymbolLiteral
61
+ 'defined_tags': :'definedTags',
44
62
  'display_name': :'displayName',
63
+ 'freeform_tags': :'freeformTags',
45
64
  'hostname_label': :'hostnameLabel',
46
65
  'skip_source_dest_check': :'skipSourceDestCheck'
47
66
  # rubocop:enable Style/SymbolLiteral
@@ -52,7 +71,9 @@ module OCI
52
71
  def self.swagger_types
53
72
  {
54
73
  # rubocop:disable Style/SymbolLiteral
74
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
55
75
  'display_name': :'String',
76
+ 'freeform_tags': :'Hash<String, String>',
56
77
  'hostname_label': :'String',
57
78
  'skip_source_dest_check': :'BOOLEAN'
58
79
  # rubocop:enable Style/SymbolLiteral
@@ -65,7 +86,9 @@ module OCI
65
86
 
66
87
  # Initializes the object
67
88
  # @param [Hash] attributes Model attributes in the form of hash
89
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
68
90
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
91
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
69
92
  # @option attributes [String] :hostname_label The value to assign to the {#hostname_label} property
70
93
  # @option attributes [BOOLEAN] :skip_source_dest_check The value to assign to the {#skip_source_dest_check} property
71
94
  def initialize(attributes = {})
@@ -74,12 +97,24 @@ module OCI
74
97
  # convert string to symbol for hash key
75
98
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
99
 
100
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
101
+
102
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
103
+
104
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
105
+
77
106
  self.display_name = attributes[:'displayName'] if attributes[:'displayName']
78
107
 
79
108
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
80
109
 
81
110
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
82
111
 
112
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
113
+
114
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
115
+
116
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
117
+
83
118
  self.hostname_label = attributes[:'hostnameLabel'] if attributes[:'hostnameLabel']
84
119
 
85
120
  raise 'You cannot provide both :hostnameLabel and :hostname_label' if attributes.key?(:'hostnameLabel') && attributes.key?(:'hostname_label')
@@ -103,7 +138,9 @@ module OCI
103
138
  def ==(other)
104
139
  return true if equal?(other)
105
140
  self.class == other.class &&
141
+ defined_tags == other.defined_tags &&
106
142
  display_name == other.display_name &&
143
+ freeform_tags == other.freeform_tags &&
107
144
  hostname_label == other.hostname_label &&
108
145
  skip_source_dest_check == other.skip_source_dest_check
109
146
  end
@@ -121,7 +158,7 @@ module OCI
121
158
  # Calculates hash code according to all attributes.
122
159
  # @return [Fixnum] Hash code
123
160
  def hash
124
- [display_name, hostname_label, skip_source_dest_check].hash
161
+ [defined_tags, display_name, freeform_tags, hostname_label, skip_source_dest_check].hash
125
162
  end
126
163
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
127
164
 
@@ -0,0 +1,187 @@
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
+ # UpdateVolumeGroupBackupDetails model.
8
+ class Core::Models::UpdateVolumeGroupBackupDetails # rubocop:disable Metrics/LineLength
9
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
10
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
17
+ # A friendly user-specified name for the volume group backup.
18
+ # @return [String]
19
+ attr_accessor :display_name
20
+
21
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
22
+ # predefined name, type, or namespace. For more information, see
23
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
24
+ #
25
+ # Example: `{\"Department\": \"Finance\"}`
26
+ #
27
+ # @return [Hash<String, String>]
28
+ attr_accessor :freeform_tags
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ # rubocop:disable Style/SymbolLiteral
34
+ 'defined_tags': :'definedTags',
35
+ 'display_name': :'displayName',
36
+ 'freeform_tags': :'freeformTags'
37
+ # rubocop:enable Style/SymbolLiteral
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ # rubocop:disable Style/SymbolLiteral
45
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
46
+ 'display_name': :'String',
47
+ 'freeform_tags': :'Hash<String, String>'
48
+ # rubocop:enable Style/SymbolLiteral
49
+ }
50
+ end
51
+
52
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
53
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
54
+
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
59
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
60
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
68
+
69
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
70
+
71
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
72
+
73
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
74
+
75
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
76
+
77
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
78
+
79
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
80
+
81
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
82
+
83
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
84
+ end
85
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
86
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
87
+
88
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
89
+
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] other the other object to be compared
93
+ def ==(other)
94
+ return true if equal?(other)
95
+ self.class == other.class &&
96
+ defined_tags == other.defined_tags &&
97
+ display_name == other.display_name &&
98
+ freeform_tags == other.freeform_tags
99
+ end
100
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
101
+
102
+ # @see the `==` method
103
+ # @param [Object] other the other object to be compared
104
+ def eql?(other)
105
+ self == other
106
+ end
107
+
108
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
109
+
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [defined_tags, display_name, freeform_tags].hash
115
+ end
116
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
117
+
118
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
119
+
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /^Array<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ public_method("#{key}=").call(
132
+ attributes[self.class.attribute_map[key]]
133
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
134
+ )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ public_method("#{key}=").call(
138
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
139
+ )
140
+ end
141
+ # or else data not found in attributes(hash), not an issue as the data can be optional
142
+ end
143
+
144
+ self
145
+ end
146
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
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 = public_method(attr).call
160
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
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
+ end
186
+ end
187
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,201 @@
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
+ # UpdateVolumeGroupDetails model.
8
+ class Core::Models::UpdateVolumeGroupDetails # rubocop:disable Metrics/LineLength
9
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
10
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
17
+ # A user-friendly name for the volume group.
18
+ # @return [String]
19
+ attr_accessor :display_name
20
+
21
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
22
+ # predefined name, type, or namespace. For more information, see
23
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
24
+ #
25
+ # Example: `{\"Department\": \"Finance\"}`
26
+ #
27
+ # @return [Hash<String, String>]
28
+ attr_accessor :freeform_tags
29
+
30
+ # OCIDs for the volumes in this volume group.
31
+ # @return [Array<String>]
32
+ attr_accessor :volume_ids
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'defined_tags': :'definedTags',
39
+ 'display_name': :'displayName',
40
+ 'freeform_tags': :'freeformTags',
41
+ 'volume_ids': :'volumeIds'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ # rubocop:disable Style/SymbolLiteral
50
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
51
+ 'display_name': :'String',
52
+ 'freeform_tags': :'Hash<String, String>',
53
+ 'volume_ids': :'Array<String>'
54
+ # rubocop:enable Style/SymbolLiteral
55
+ }
56
+ end
57
+
58
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
59
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
60
+
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
65
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
66
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
67
+ # @option attributes [Array<String>] :volume_ids The value to assign to the {#volume_ids} property
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
75
+
76
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
77
+
78
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
79
+
80
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
81
+
82
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
83
+
84
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
85
+
86
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
87
+
88
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
89
+
90
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
91
+
92
+ self.volume_ids = attributes[:'volumeIds'] if attributes[:'volumeIds']
93
+
94
+ raise 'You cannot provide both :volumeIds and :volume_ids' if attributes.key?(:'volumeIds') && attributes.key?(:'volume_ids')
95
+
96
+ self.volume_ids = attributes[:'volume_ids'] if attributes[:'volume_ids']
97
+ end
98
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
99
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
100
+
101
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
102
+
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] other the other object to be compared
106
+ def ==(other)
107
+ return true if equal?(other)
108
+ self.class == other.class &&
109
+ defined_tags == other.defined_tags &&
110
+ display_name == other.display_name &&
111
+ freeform_tags == other.freeform_tags &&
112
+ volume_ids == other.volume_ids
113
+ end
114
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
115
+
116
+ # @see the `==` method
117
+ # @param [Object] other the other object to be compared
118
+ def eql?(other)
119
+ self == other
120
+ end
121
+
122
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
123
+
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Fixnum] Hash code
127
+ def hash
128
+ [defined_tags, display_name, freeform_tags, volume_ids].hash
129
+ end
130
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
131
+
132
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
133
+
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ if type =~ /^Array<(.*)>/i
142
+ # check to ensure the input is an array given that the the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ public_method("#{key}=").call(
146
+ attributes[self.class.attribute_map[key]]
147
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
148
+ )
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ public_method("#{key}=").call(
152
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
153
+ )
154
+ end
155
+ # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = public_method(attr).call
174
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ private
181
+
182
+ # Outputs non-array value in the form of hash
183
+ # For object, use to_hash. Otherwise, just return the value
184
+ # @param [Object] value Any valid value
185
+ # @return [Hash] Returns the value in the form of hash
186
+ def _to_hash(value)
187
+ if value.is_a?(Array)
188
+ value.compact.map { |v| _to_hash(v) }
189
+ elsif value.is_a?(Hash)
190
+ {}.tap do |hash|
191
+ value.each { |k, v| hash[k] = _to_hash(v) }
192
+ end
193
+ elsif value.respond_to? :to_hash
194
+ value.to_hash
195
+ else
196
+ value
197
+ end
198
+ end
199
+ end
200
+ end
201
+ # rubocop:enable Lint/UnneededCopDisableDirective