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
@@ -17,12 +17,29 @@ module OCI
17
17
  # @return [String]
18
18
  attr_accessor :compartment_id
19
19
 
20
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
21
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
22
+ #
23
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
24
+ #
25
+ # @return [Hash<String, Hash<String, Object>>]
26
+ attr_accessor :defined_tags
27
+
20
28
  # A user-friendly name. Does not have to be unique, and it's changeable. Avoid
21
29
  # entering confidential information.
22
30
  #
23
31
  # @return [String]
24
32
  attr_accessor :display_name
25
33
 
34
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
35
+ # predefined name, type, or namespace. For more information, see
36
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
37
+ #
38
+ # Example: `{\"Department\": \"Finance\"}`
39
+ #
40
+ # @return [Hash<String, String>]
41
+ attr_accessor :freeform_tags
42
+
26
43
  # **[Required]** Defines when the public IP is deleted and released back to the Oracle Cloud
27
44
  # Infrastructure public IP pool. For more information, see
28
45
  # [Public IP Addresses](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm).
@@ -47,7 +64,9 @@ module OCI
47
64
  {
48
65
  # rubocop:disable Style/SymbolLiteral
49
66
  'compartment_id': :'compartmentId',
67
+ 'defined_tags': :'definedTags',
50
68
  'display_name': :'displayName',
69
+ 'freeform_tags': :'freeformTags',
51
70
  'lifetime': :'lifetime',
52
71
  'private_ip_id': :'privateIpId'
53
72
  # rubocop:enable Style/SymbolLiteral
@@ -59,7 +78,9 @@ module OCI
59
78
  {
60
79
  # rubocop:disable Style/SymbolLiteral
61
80
  'compartment_id': :'String',
81
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
62
82
  'display_name': :'String',
83
+ 'freeform_tags': :'Hash<String, String>',
63
84
  'lifetime': :'String',
64
85
  'private_ip_id': :'String'
65
86
  # rubocop:enable Style/SymbolLiteral
@@ -73,7 +94,9 @@ module OCI
73
94
  # Initializes the object
74
95
  # @param [Hash] attributes Model attributes in the form of hash
75
96
  # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
97
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
76
98
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
99
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
77
100
  # @option attributes [String] :lifetime The value to assign to the {#lifetime} property
78
101
  # @option attributes [String] :private_ip_id The value to assign to the {#private_ip_id} property
79
102
  def initialize(attributes = {})
@@ -88,12 +111,24 @@ module OCI
88
111
 
89
112
  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
90
113
 
114
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
115
+
116
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
117
+
118
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
119
+
91
120
  self.display_name = attributes[:'displayName'] if attributes[:'displayName']
92
121
 
93
122
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
94
123
 
95
124
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
96
125
 
126
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
127
+
128
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
129
+
130
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
131
+
97
132
  self.lifetime = attributes[:'lifetime'] if attributes[:'lifetime']
98
133
 
99
134
  self.private_ip_id = attributes[:'privateIpId'] if attributes[:'privateIpId']
@@ -123,7 +158,9 @@ module OCI
123
158
  return true if equal?(other)
124
159
  self.class == other.class &&
125
160
  compartment_id == other.compartment_id &&
161
+ defined_tags == other.defined_tags &&
126
162
  display_name == other.display_name &&
163
+ freeform_tags == other.freeform_tags &&
127
164
  lifetime == other.lifetime &&
128
165
  private_ip_id == other.private_ip_id
129
166
  end
@@ -141,7 +178,7 @@ module OCI
141
178
  # Calculates hash code according to all attributes.
142
179
  # @return [Fixnum] Hash code
143
180
  def hash
144
- [compartment_id, display_name, lifetime, private_ip_id].hash
181
+ [compartment_id, defined_tags, display_name, freeform_tags, lifetime, private_ip_id].hash
145
182
  end
146
183
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
147
184
 
@@ -34,12 +34,29 @@ module OCI
34
34
  # @return [BOOLEAN]
35
35
  attr_accessor :assign_public_ip
36
36
 
37
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
38
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
39
+ #
40
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
41
+ #
42
+ # @return [Hash<String, Hash<String, Object>>]
43
+ attr_accessor :defined_tags
44
+
37
45
  # A user-friendly name for the VNIC. Does not have to be unique.
38
46
  # Avoid entering confidential information.
39
47
  #
40
48
  # @return [String]
41
49
  attr_accessor :display_name
42
50
 
51
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
52
+ # predefined name, type, or namespace. For more information, see
53
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
54
+ #
55
+ # Example: `{\"Department\": \"Finance\"}`
56
+ #
57
+ # @return [Hash<String, String>]
58
+ attr_accessor :freeform_tags
59
+
43
60
  # The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname
44
61
  # portion of the primary private IP's fully qualified domain name (FQDN)
45
62
  # (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`).
@@ -101,7 +118,9 @@ module OCI
101
118
  {
102
119
  # rubocop:disable Style/SymbolLiteral
103
120
  'assign_public_ip': :'assignPublicIp',
121
+ 'defined_tags': :'definedTags',
104
122
  'display_name': :'displayName',
123
+ 'freeform_tags': :'freeformTags',
105
124
  'hostname_label': :'hostnameLabel',
106
125
  'private_ip': :'privateIp',
107
126
  'skip_source_dest_check': :'skipSourceDestCheck',
@@ -115,7 +134,9 @@ module OCI
115
134
  {
116
135
  # rubocop:disable Style/SymbolLiteral
117
136
  'assign_public_ip': :'BOOLEAN',
137
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
118
138
  'display_name': :'String',
139
+ 'freeform_tags': :'Hash<String, String>',
119
140
  'hostname_label': :'String',
120
141
  'private_ip': :'String',
121
142
  'skip_source_dest_check': :'BOOLEAN',
@@ -131,7 +152,9 @@ module OCI
131
152
  # Initializes the object
132
153
  # @param [Hash] attributes Model attributes in the form of hash
133
154
  # @option attributes [BOOLEAN] :assign_public_ip The value to assign to the {#assign_public_ip} property
155
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
134
156
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
157
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
135
158
  # @option attributes [String] :hostname_label The value to assign to the {#hostname_label} property
136
159
  # @option attributes [String] :private_ip The value to assign to the {#private_ip} property
137
160
  # @option attributes [BOOLEAN] :skip_source_dest_check The value to assign to the {#skip_source_dest_check} property
@@ -148,12 +171,24 @@ module OCI
148
171
 
149
172
  self.assign_public_ip = attributes[:'assign_public_ip'] unless attributes[:'assign_public_ip'].nil?
150
173
 
174
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
175
+
176
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
177
+
178
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
179
+
151
180
  self.display_name = attributes[:'displayName'] if attributes[:'displayName']
152
181
 
153
182
  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
154
183
 
155
184
  self.display_name = attributes[:'display_name'] if attributes[:'display_name']
156
185
 
186
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
187
+
188
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
189
+
190
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
191
+
157
192
  self.hostname_label = attributes[:'hostnameLabel'] if attributes[:'hostnameLabel']
158
193
 
159
194
  raise 'You cannot provide both :hostnameLabel and :hostname_label' if attributes.key?(:'hostnameLabel') && attributes.key?(:'hostname_label')
@@ -190,7 +225,9 @@ module OCI
190
225
  return true if equal?(other)
191
226
  self.class == other.class &&
192
227
  assign_public_ip == other.assign_public_ip &&
228
+ defined_tags == other.defined_tags &&
193
229
  display_name == other.display_name &&
230
+ freeform_tags == other.freeform_tags &&
194
231
  hostname_label == other.hostname_label &&
195
232
  private_ip == other.private_ip &&
196
233
  skip_source_dest_check == other.skip_source_dest_check &&
@@ -210,7 +247,7 @@ module OCI
210
247
  # Calculates hash code according to all attributes.
211
248
  # @return [Fixnum] Hash code
212
249
  def hash
213
- [assign_public_ip, display_name, hostname_label, private_ip, skip_source_dest_check, subnet_id].hash
250
+ [assign_public_ip, defined_tags, display_name, freeform_tags, hostname_label, private_ip, skip_source_dest_check, subnet_id].hash
214
251
  end
215
252
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
216
253
 
@@ -0,0 +1,239 @@
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
+ # CreateVolumeGroupBackupDetails model.
8
+ class Core::Models::CreateVolumeGroupBackupDetails # rubocop:disable Metrics/LineLength
9
+ TYPE_ENUM = [
10
+ TYPE_FULL = 'FULL'.freeze,
11
+ TYPE_INCREMENTAL = 'INCREMENTAL'.freeze
12
+ ].freeze
13
+
14
+ # The OCID of the compartment that will contain the volume group backup. This parameter is optional, by default backup will be created in the same compartment and source volume group.
15
+ # @return [String]
16
+ attr_accessor :compartment_id
17
+
18
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
19
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
20
+ #
21
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
22
+ #
23
+ # @return [Hash<String, Hash<String, Object>>]
24
+ attr_accessor :defined_tags
25
+
26
+ # A user-friendly name for the volume group backup. Does not have to be unique and it's changeable.
27
+ # @return [String]
28
+ attr_accessor :display_name
29
+
30
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
31
+ # predefined name, type, or namespace. For more information, see
32
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
33
+ #
34
+ # Example: `{\"Department\": \"Finance\"}`
35
+ #
36
+ # @return [Hash<String, String>]
37
+ attr_accessor :freeform_tags
38
+
39
+ # The type of backup to create. If omitted, defaults to incremental.
40
+ # @return [String]
41
+ attr_reader :type
42
+
43
+ # **[Required]** The OCID of the volume group that needs to be backed up.
44
+ # @return [String]
45
+ attr_accessor :volume_group_id
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ # rubocop:disable Style/SymbolLiteral
51
+ 'compartment_id': :'compartmentId',
52
+ 'defined_tags': :'definedTags',
53
+ 'display_name': :'displayName',
54
+ 'freeform_tags': :'freeformTags',
55
+ 'type': :'type',
56
+ 'volume_group_id': :'volumeGroupId'
57
+ # rubocop:enable Style/SymbolLiteral
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ # rubocop:disable Style/SymbolLiteral
65
+ 'compartment_id': :'String',
66
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
67
+ 'display_name': :'String',
68
+ 'freeform_tags': :'Hash<String, String>',
69
+ 'type': :'String',
70
+ 'volume_group_id': :'String'
71
+ # rubocop:enable Style/SymbolLiteral
72
+ }
73
+ end
74
+
75
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
76
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
77
+
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
82
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
83
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
84
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
85
+ # @option attributes [String] :type The value to assign to the {#type} property
86
+ # @option attributes [String] :volume_group_id The value to assign to the {#volume_group_id} property
87
+ def initialize(attributes = {})
88
+ return unless attributes.is_a?(Hash)
89
+
90
+ # convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
92
+
93
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
94
+
95
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
96
+
97
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
98
+
99
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
100
+
101
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
102
+
103
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
104
+
105
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
106
+
107
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
108
+
109
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
110
+
111
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
112
+
113
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
114
+
115
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
116
+
117
+ self.type = attributes[:'type'] if attributes[:'type']
118
+
119
+ self.volume_group_id = attributes[:'volumeGroupId'] if attributes[:'volumeGroupId']
120
+
121
+ raise 'You cannot provide both :volumeGroupId and :volume_group_id' if attributes.key?(:'volumeGroupId') && attributes.key?(:'volume_group_id')
122
+
123
+ self.volume_group_id = attributes[:'volume_group_id'] if attributes[:'volume_group_id']
124
+ end
125
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
126
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] type Object to be assigned
130
+ def type=(type)
131
+ # rubocop: disable Metrics/LineLength
132
+ raise "Invalid value for 'type': this must be one of the values in TYPE_ENUM." if type && !TYPE_ENUM.include?(type)
133
+ # rubocop: enable Metrics/LineLength
134
+ @type = type
135
+ end
136
+
137
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
138
+
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] other the other object to be compared
142
+ def ==(other)
143
+ return true if equal?(other)
144
+ self.class == other.class &&
145
+ compartment_id == other.compartment_id &&
146
+ defined_tags == other.defined_tags &&
147
+ display_name == other.display_name &&
148
+ freeform_tags == other.freeform_tags &&
149
+ type == other.type &&
150
+ volume_group_id == other.volume_group_id
151
+ end
152
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
153
+
154
+ # @see the `==` method
155
+ # @param [Object] other the other object to be compared
156
+ def eql?(other)
157
+ self == other
158
+ end
159
+
160
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
161
+
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Fixnum] Hash code
165
+ def hash
166
+ [compartment_id, defined_tags, display_name, freeform_tags, type, volume_group_id].hash
167
+ end
168
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
169
+
170
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
171
+
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ self.class.swagger_types.each_pair do |key, type|
179
+ if type =~ /^Array<(.*)>/i
180
+ # check to ensure the input is an array given that the the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
183
+ public_method("#{key}=").call(
184
+ attributes[self.class.attribute_map[key]]
185
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
186
+ )
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ public_method("#{key}=").call(
190
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
191
+ )
192
+ end
193
+ # or else data not found in attributes(hash), not an issue as the data can be optional
194
+ end
195
+
196
+ self
197
+ end
198
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = public_method(attr).call
212
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ private
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end
239
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,231 @@
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
+ # CreateVolumeGroupDetails model.
8
+ class Core::Models::CreateVolumeGroupDetails # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The Availability Domain of the volume group.
10
+ # @return [String]
11
+ attr_accessor :availability_domain
12
+
13
+ # **[Required]** The OCID of the compartment that contains the volume group.
14
+ # @return [String]
15
+ attr_accessor :compartment_id
16
+
17
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
18
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
19
+ #
20
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
21
+ #
22
+ # @return [Hash<String, Hash<String, Object>>]
23
+ attr_accessor :defined_tags
24
+
25
+ # A user-friendly name for the volume group. Does not have to be unique, and it's changeable.
26
+ # @return [String]
27
+ attr_accessor :display_name
28
+
29
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
30
+ # predefined name, type, or namespace. For more information, see
31
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
32
+ #
33
+ # Example: `{\"Department\": \"Finance\"}`
34
+ #
35
+ # @return [Hash<String, String>]
36
+ attr_accessor :freeform_tags
37
+
38
+ # **[Required]** Specifies the volume group source details for a new volume group. The volume source is either another a list of
39
+ # volume ids in the same Availability Domain, another volume group or a volume group backup.
40
+ #
41
+ # @return [OCI::Core::Models::VolumeGroupSourceDetails]
42
+ attr_accessor :source_details
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ # rubocop:disable Style/SymbolLiteral
48
+ 'availability_domain': :'availabilityDomain',
49
+ 'compartment_id': :'compartmentId',
50
+ 'defined_tags': :'definedTags',
51
+ 'display_name': :'displayName',
52
+ 'freeform_tags': :'freeformTags',
53
+ 'source_details': :'sourceDetails'
54
+ # rubocop:enable Style/SymbolLiteral
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.swagger_types
60
+ {
61
+ # rubocop:disable Style/SymbolLiteral
62
+ 'availability_domain': :'String',
63
+ 'compartment_id': :'String',
64
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
65
+ 'display_name': :'String',
66
+ 'freeform_tags': :'Hash<String, String>',
67
+ 'source_details': :'OCI::Core::Models::VolumeGroupSourceDetails'
68
+ # rubocop:enable Style/SymbolLiteral
69
+ }
70
+ end
71
+
72
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
73
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
74
+
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ # @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property
79
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
80
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
81
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
82
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
83
+ # @option attributes [OCI::Core::Models::VolumeGroupSourceDetails] :source_details The value to assign to the {#source_details} property
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
89
+
90
+ self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']
91
+
92
+ raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain')
93
+
94
+ self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain']
95
+
96
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
97
+
98
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
99
+
100
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
101
+
102
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
103
+
104
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
105
+
106
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
107
+
108
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
109
+
110
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
111
+
112
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
113
+
114
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
115
+
116
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
117
+
118
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
119
+
120
+ self.source_details = attributes[:'sourceDetails'] if attributes[:'sourceDetails']
121
+
122
+ raise 'You cannot provide both :sourceDetails and :source_details' if attributes.key?(:'sourceDetails') && attributes.key?(:'source_details')
123
+
124
+ self.source_details = attributes[:'source_details'] if attributes[:'source_details']
125
+ end
126
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
127
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
128
+
129
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
130
+
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] other the other object to be compared
134
+ def ==(other)
135
+ return true if equal?(other)
136
+ self.class == other.class &&
137
+ availability_domain == other.availability_domain &&
138
+ compartment_id == other.compartment_id &&
139
+ defined_tags == other.defined_tags &&
140
+ display_name == other.display_name &&
141
+ freeform_tags == other.freeform_tags &&
142
+ source_details == other.source_details
143
+ end
144
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
145
+
146
+ # @see the `==` method
147
+ # @param [Object] other the other object to be compared
148
+ def eql?(other)
149
+ self == other
150
+ end
151
+
152
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
153
+
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Fixnum] Hash code
157
+ def hash
158
+ [availability_domain, compartment_id, defined_tags, display_name, freeform_tags, source_details].hash
159
+ end
160
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
161
+
162
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
163
+
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /^Array<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ public_method("#{key}=").call(
176
+ attributes[self.class.attribute_map[key]]
177
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
178
+ )
179
+ end
180
+ elsif !attributes[self.class.attribute_map[key]].nil?
181
+ public_method("#{key}=").call(
182
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
183
+ )
184
+ end
185
+ # or else data not found in attributes(hash), not an issue as the data can be optional
186
+ end
187
+
188
+ self
189
+ end
190
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = public_method(attr).call
204
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ private
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+ end
230
+ end
231
+ # rubocop:enable Lint/UnneededCopDisableDirective