oci 2.3.7 → 2.3.8

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/blockstorage_client.rb +56 -24
  4. data/lib/oci/core/compute_client.rb +578 -24
  5. data/lib/oci/core/core.rb +11 -0
  6. data/lib/oci/core/models/app_catalog_listing.rb +242 -0
  7. data/lib/oci/core/models/app_catalog_listing_resource_version.rb +295 -0
  8. data/lib/oci/core/models/app_catalog_listing_resource_version_agreements.rb +219 -0
  9. data/lib/oci/core/models/app_catalog_listing_resource_version_summary.rb +194 -0
  10. data/lib/oci/core/models/app_catalog_listing_summary.rb +188 -0
  11. data/lib/oci/core/models/app_catalog_subscription.rb +246 -0
  12. data/lib/oci/core/models/app_catalog_subscription_summary.rb +246 -0
  13. data/lib/oci/core/models/create_app_catalog_subscription_details.rb +232 -0
  14. data/lib/oci/core/models/create_nat_gateway_details.rb +239 -0
  15. data/lib/oci/core/models/launch_instance_details.rb +4 -0
  16. data/lib/oci/core/models/nat_gateway.rb +333 -0
  17. data/lib/oci/core/models/public_ip.rb +76 -13
  18. data/lib/oci/core/models/service_gateway.rb +9 -4
  19. data/lib/oci/core/models/update_nat_gateway_details.rb +208 -0
  20. data/lib/oci/core/models/update_service_gateway_details.rb +9 -4
  21. data/lib/oci/core/virtual_network_client.rb +546 -91
  22. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  23. data/lib/oci/object_storage/models/bucket.rb +18 -4
  24. data/lib/oci/object_storage/models/copy_object_details.rb +269 -0
  25. data/lib/oci/object_storage/models/multipart_upload.rb +1 -1
  26. data/lib/oci/object_storage/models/namespace_metadata.rb +1 -1
  27. data/lib/oci/object_storage/models/object_lifecycle_policy.rb +167 -0
  28. data/lib/oci/object_storage/models/object_lifecycle_rule.rb +245 -0
  29. data/lib/oci/object_storage/models/object_name_filter.rb +153 -0
  30. data/lib/oci/object_storage/models/preauthenticated_request.rb +1 -1
  31. data/lib/oci/object_storage/models/put_object_lifecycle_policy_details.rb +147 -0
  32. data/lib/oci/object_storage/models/restore_objects_details.rb +2 -2
  33. data/lib/oci/object_storage/models/work_request.rb +304 -0
  34. data/lib/oci/object_storage/models/work_request_error.rb +168 -0
  35. data/lib/oci/object_storage/models/work_request_log_entry.rb +156 -0
  36. data/lib/oci/object_storage/models/work_request_resource.rb +225 -0
  37. data/lib/oci/object_storage/models/work_request_resource_metadata_key.rb +12 -0
  38. data/lib/oci/object_storage/models/work_request_summary.rb +304 -0
  39. data/lib/oci/object_storage/object_storage.rb +12 -0
  40. data/lib/oci/object_storage/object_storage_client.rb +542 -17
  41. data/lib/oci/object_storage/object_storage_client_composite_operations.rb +53 -0
  42. data/lib/oci/version.rb +1 -1
  43. metadata +24 -2
@@ -10,6 +10,13 @@ module OCI
10
10
  end
11
11
 
12
12
  # Require models
13
+ require 'oci/core/models/app_catalog_listing'
14
+ require 'oci/core/models/app_catalog_listing_resource_version'
15
+ require 'oci/core/models/app_catalog_listing_resource_version_agreements'
16
+ require 'oci/core/models/app_catalog_listing_resource_version_summary'
17
+ require 'oci/core/models/app_catalog_listing_summary'
18
+ require 'oci/core/models/app_catalog_subscription'
19
+ require 'oci/core/models/app_catalog_subscription_summary'
13
20
  require 'oci/core/models/attach_boot_volume_details'
14
21
  require 'oci/core/models/attach_i_scsi_volume_details'
15
22
  require 'oci/core/models/attach_paravirtualized_volume_details'
@@ -29,6 +36,7 @@ require 'oci/core/models/connect_local_peering_gateways_details'
29
36
  require 'oci/core/models/connect_remote_peering_connections_details'
30
37
  require 'oci/core/models/console_history'
31
38
  require 'oci/core/models/cpe'
39
+ require 'oci/core/models/create_app_catalog_subscription_details'
32
40
  require 'oci/core/models/create_boot_volume_backup_details'
33
41
  require 'oci/core/models/create_boot_volume_details'
34
42
  require 'oci/core/models/create_cpe_details'
@@ -42,6 +50,7 @@ require 'oci/core/models/create_image_details'
42
50
  require 'oci/core/models/create_instance_console_connection_details'
43
51
  require 'oci/core/models/create_internet_gateway_details'
44
52
  require 'oci/core/models/create_local_peering_gateway_details'
53
+ require 'oci/core/models/create_nat_gateway_details'
45
54
  require 'oci/core/models/create_private_ip_details'
46
55
  require 'oci/core/models/create_public_ip_details'
47
56
  require 'oci/core/models/create_remote_peering_connection_details'
@@ -99,6 +108,7 @@ require 'oci/core/models/launch_instance_details'
99
108
  require 'oci/core/models/launch_options'
100
109
  require 'oci/core/models/letter_of_authority'
101
110
  require 'oci/core/models/local_peering_gateway'
111
+ require 'oci/core/models/nat_gateway'
102
112
  require 'oci/core/models/paravirtualized_volume_attachment'
103
113
  require 'oci/core/models/peer_region_for_remote_peering'
104
114
  require 'oci/core/models/port_range'
@@ -133,6 +143,7 @@ require 'oci/core/models/update_image_details'
133
143
  require 'oci/core/models/update_instance_details'
134
144
  require 'oci/core/models/update_internet_gateway_details'
135
145
  require 'oci/core/models/update_local_peering_gateway_details'
146
+ require 'oci/core/models/update_nat_gateway_details'
136
147
  require 'oci/core/models/update_private_ip_details'
137
148
  require 'oci/core/models/update_public_ip_details'
138
149
  require 'oci/core/models/update_remote_peering_connection_details'
@@ -0,0 +1,242 @@
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
+ # Listing details.
8
+ class Core::Models::AppCatalogListing # rubocop:disable Metrics/LineLength
9
+ # Listing's contact URL.
10
+ # @return [String]
11
+ attr_accessor :contact_url
12
+
13
+ # Description of the listing.
14
+ # @return [String]
15
+ attr_accessor :description
16
+
17
+ # The OCID of the listing.
18
+ # @return [String]
19
+ attr_accessor :listing_id
20
+
21
+ # Name of the listing.
22
+ # @return [String]
23
+ attr_accessor :display_name
24
+
25
+ # Date and time the listing was published, in RFC3339 format.
26
+ # Example: `2018-03-20T12:32:53.532Z`
27
+ #
28
+ # @return [DateTime]
29
+ attr_accessor :time_published
30
+
31
+ # Publisher's logo URL.
32
+ # @return [String]
33
+ attr_accessor :publisher_logo_url
34
+
35
+ # Name of the publisher who published this listing.
36
+ # @return [String]
37
+ attr_accessor :publisher_name
38
+
39
+ # Summary of the listing.
40
+ # @return [String]
41
+ attr_accessor :summary
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ # rubocop:disable Style/SymbolLiteral
47
+ 'contact_url': :'contactUrl',
48
+ 'description': :'description',
49
+ 'listing_id': :'listingId',
50
+ 'display_name': :'displayName',
51
+ 'time_published': :'timePublished',
52
+ 'publisher_logo_url': :'publisherLogoUrl',
53
+ 'publisher_name': :'publisherName',
54
+ 'summary': :'summary'
55
+ # rubocop:enable Style/SymbolLiteral
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ # rubocop:disable Style/SymbolLiteral
63
+ 'contact_url': :'String',
64
+ 'description': :'String',
65
+ 'listing_id': :'String',
66
+ 'display_name': :'String',
67
+ 'time_published': :'DateTime',
68
+ 'publisher_logo_url': :'String',
69
+ 'publisher_name': :'String',
70
+ 'summary': :'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] :contact_url The value to assign to the {#contact_url} property
82
+ # @option attributes [String] :description The value to assign to the {#description} property
83
+ # @option attributes [String] :listing_id The value to assign to the {#listing_id} property
84
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
85
+ # @option attributes [DateTime] :time_published The value to assign to the {#time_published} property
86
+ # @option attributes [String] :publisher_logo_url The value to assign to the {#publisher_logo_url} property
87
+ # @option attributes [String] :publisher_name The value to assign to the {#publisher_name} property
88
+ # @option attributes [String] :summary The value to assign to the {#summary} property
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
+
95
+ self.contact_url = attributes[:'contactUrl'] if attributes[:'contactUrl']
96
+
97
+ raise 'You cannot provide both :contactUrl and :contact_url' if attributes.key?(:'contactUrl') && attributes.key?(:'contact_url')
98
+
99
+ self.contact_url = attributes[:'contact_url'] if attributes[:'contact_url']
100
+
101
+ self.description = attributes[:'description'] if attributes[:'description']
102
+
103
+ self.listing_id = attributes[:'listingId'] if attributes[:'listingId']
104
+
105
+ raise 'You cannot provide both :listingId and :listing_id' if attributes.key?(:'listingId') && attributes.key?(:'listing_id')
106
+
107
+ self.listing_id = attributes[:'listing_id'] if attributes[:'listing_id']
108
+
109
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
110
+
111
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
112
+
113
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
114
+
115
+ self.time_published = attributes[:'timePublished'] if attributes[:'timePublished']
116
+
117
+ raise 'You cannot provide both :timePublished and :time_published' if attributes.key?(:'timePublished') && attributes.key?(:'time_published')
118
+
119
+ self.time_published = attributes[:'time_published'] if attributes[:'time_published']
120
+
121
+ self.publisher_logo_url = attributes[:'publisherLogoUrl'] if attributes[:'publisherLogoUrl']
122
+
123
+ raise 'You cannot provide both :publisherLogoUrl and :publisher_logo_url' if attributes.key?(:'publisherLogoUrl') && attributes.key?(:'publisher_logo_url')
124
+
125
+ self.publisher_logo_url = attributes[:'publisher_logo_url'] if attributes[:'publisher_logo_url']
126
+
127
+ self.publisher_name = attributes[:'publisherName'] if attributes[:'publisherName']
128
+
129
+ raise 'You cannot provide both :publisherName and :publisher_name' if attributes.key?(:'publisherName') && attributes.key?(:'publisher_name')
130
+
131
+ self.publisher_name = attributes[:'publisher_name'] if attributes[:'publisher_name']
132
+
133
+ self.summary = attributes[:'summary'] if attributes[:'summary']
134
+ end
135
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
136
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
137
+
138
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
139
+
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] other the other object to be compared
143
+ def ==(other)
144
+ return true if equal?(other)
145
+ self.class == other.class &&
146
+ contact_url == other.contact_url &&
147
+ description == other.description &&
148
+ listing_id == other.listing_id &&
149
+ display_name == other.display_name &&
150
+ time_published == other.time_published &&
151
+ publisher_logo_url == other.publisher_logo_url &&
152
+ publisher_name == other.publisher_name &&
153
+ summary == other.summary
154
+ end
155
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
156
+
157
+ # @see the `==` method
158
+ # @param [Object] other the other object to be compared
159
+ def eql?(other)
160
+ self == other
161
+ end
162
+
163
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
164
+
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [contact_url, description, listing_id, display_name, time_published, publisher_logo_url, publisher_name, summary].hash
170
+ end
171
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
172
+
173
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
174
+
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.swagger_types.each_pair do |key, type|
182
+ if type =~ /^Array<(.*)>/i
183
+ # check to ensure the input is an array given that the the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ public_method("#{key}=").call(
187
+ attributes[self.class.attribute_map[key]]
188
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
189
+ )
190
+ end
191
+ elsif !attributes[self.class.attribute_map[key]].nil?
192
+ public_method("#{key}=").call(
193
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
194
+ )
195
+ end
196
+ # or else data not found in attributes(hash), not an issue as the data can be optional
197
+ end
198
+
199
+ self
200
+ end
201
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = public_method(attr).call
215
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ private
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+ end
241
+ end
242
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,295 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # Listing Resource Version
9
+ class Core::Models::AppCatalogListingResourceVersion # rubocop:disable Metrics/LineLength
10
+ ALLOWED_ACTIONS_ENUM = [
11
+ ALLOWED_ACTIONS_SNAPSHOT = 'SNAPSHOT'.freeze,
12
+ ALLOWED_ACTIONS_BOOT_VOLUME_DETACH = 'BOOT_VOLUME_DETACH'.freeze,
13
+ ALLOWED_ACTIONS_PRESERVE_BOOT_VOLUME = 'PRESERVE_BOOT_VOLUME'.freeze,
14
+ ALLOWED_ACTIONS_SERIAL_CONSOLE_ACCESS = 'SERIAL_CONSOLE_ACCESS'.freeze,
15
+ ALLOWED_ACTIONS_BOOT_RECOVERY = 'BOOT_RECOVERY'.freeze,
16
+ ALLOWED_ACTIONS_BACKUP_BOOT_VOLUME = 'BACKUP_BOOT_VOLUME'.freeze,
17
+ ALLOWED_ACTIONS_CAPTURE_CONSOLE_HISTORY = 'CAPTURE_CONSOLE_HISTORY'.freeze,
18
+ ALLOWED_ACTIONS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
19
+ ].freeze
20
+
21
+ # The OCID of the listing this resource version belongs to.
22
+ # @return [String]
23
+ attr_accessor :listing_id
24
+
25
+ # Date and time the listing resource version was published, in RFC3339 format.
26
+ # Example: `2018-03-20T12:32:53.532Z`
27
+ #
28
+ # @return [DateTime]
29
+ attr_accessor :time_published
30
+
31
+ # OCID of the listing resource.
32
+ # @return [String]
33
+ attr_accessor :listing_resource_id
34
+
35
+ # Resource Version.
36
+ # @return [String]
37
+ attr_accessor :listing_resource_version
38
+
39
+ # List of regions that this listing resource version is available.
40
+ #
41
+ # For information about Regions, see
42
+ # [Regions](https://docs.us-phoenix-1.oraclecloud.com/#General/Concepts/regions.htm).
43
+ #
44
+ # Example: `[\"us-ashburn-1\", \"us-phoenix-1\"]`
45
+ #
46
+ # @return [Array<String>]
47
+ attr_accessor :available_regions
48
+
49
+ # Array of shapes compatible with this resource.
50
+ #
51
+ # You may enumerate all available shapes by calling {#list_shapes list_shapes}.
52
+ #
53
+ # Example: `[\"VM.Standard1.1\", \"VM.Standard1.2\"]`
54
+ #
55
+ # @return [Array<String>]
56
+ attr_accessor :compatible_shapes
57
+
58
+ # List of accessible ports for instances launched with this listing resource version.
59
+ # @return [Array<Integer>]
60
+ attr_accessor :accessible_ports
61
+
62
+ # Allowed actions for the listing resource.
63
+ # @return [Array<String>]
64
+ attr_reader :allowed_actions
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ # rubocop:disable Style/SymbolLiteral
70
+ 'listing_id': :'listingId',
71
+ 'time_published': :'timePublished',
72
+ 'listing_resource_id': :'listingResourceId',
73
+ 'listing_resource_version': :'listingResourceVersion',
74
+ 'available_regions': :'availableRegions',
75
+ 'compatible_shapes': :'compatibleShapes',
76
+ 'accessible_ports': :'accessiblePorts',
77
+ 'allowed_actions': :'allowedActions'
78
+ # rubocop:enable Style/SymbolLiteral
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.swagger_types
84
+ {
85
+ # rubocop:disable Style/SymbolLiteral
86
+ 'listing_id': :'String',
87
+ 'time_published': :'DateTime',
88
+ 'listing_resource_id': :'String',
89
+ 'listing_resource_version': :'String',
90
+ 'available_regions': :'Array<String>',
91
+ 'compatible_shapes': :'Array<String>',
92
+ 'accessible_ports': :'Array<Integer>',
93
+ 'allowed_actions': :'Array<String>'
94
+ # rubocop:enable Style/SymbolLiteral
95
+ }
96
+ end
97
+
98
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
99
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
100
+
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @option attributes [String] :listing_id The value to assign to the {#listing_id} property
105
+ # @option attributes [DateTime] :time_published The value to assign to the {#time_published} property
106
+ # @option attributes [String] :listing_resource_id The value to assign to the {#listing_resource_id} property
107
+ # @option attributes [String] :listing_resource_version The value to assign to the {#listing_resource_version} property
108
+ # @option attributes [Array<String>] :available_regions The value to assign to the {#available_regions} property
109
+ # @option attributes [Array<String>] :compatible_shapes The value to assign to the {#compatible_shapes} property
110
+ # @option attributes [Array<Integer>] :accessible_ports The value to assign to the {#accessible_ports} property
111
+ # @option attributes [Array<String>] :allowed_actions The value to assign to the {#allowed_actions} property
112
+ def initialize(attributes = {})
113
+ return unless attributes.is_a?(Hash)
114
+
115
+ # convert string to symbol for hash key
116
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
117
+
118
+ self.listing_id = attributes[:'listingId'] if attributes[:'listingId']
119
+
120
+ raise 'You cannot provide both :listingId and :listing_id' if attributes.key?(:'listingId') && attributes.key?(:'listing_id')
121
+
122
+ self.listing_id = attributes[:'listing_id'] if attributes[:'listing_id']
123
+
124
+ self.time_published = attributes[:'timePublished'] if attributes[:'timePublished']
125
+
126
+ raise 'You cannot provide both :timePublished and :time_published' if attributes.key?(:'timePublished') && attributes.key?(:'time_published')
127
+
128
+ self.time_published = attributes[:'time_published'] if attributes[:'time_published']
129
+
130
+ self.listing_resource_id = attributes[:'listingResourceId'] if attributes[:'listingResourceId']
131
+
132
+ raise 'You cannot provide both :listingResourceId and :listing_resource_id' if attributes.key?(:'listingResourceId') && attributes.key?(:'listing_resource_id')
133
+
134
+ self.listing_resource_id = attributes[:'listing_resource_id'] if attributes[:'listing_resource_id']
135
+
136
+ self.listing_resource_version = attributes[:'listingResourceVersion'] if attributes[:'listingResourceVersion']
137
+
138
+ raise 'You cannot provide both :listingResourceVersion and :listing_resource_version' if attributes.key?(:'listingResourceVersion') && attributes.key?(:'listing_resource_version')
139
+
140
+ self.listing_resource_version = attributes[:'listing_resource_version'] if attributes[:'listing_resource_version']
141
+
142
+ self.available_regions = attributes[:'availableRegions'] if attributes[:'availableRegions']
143
+
144
+ raise 'You cannot provide both :availableRegions and :available_regions' if attributes.key?(:'availableRegions') && attributes.key?(:'available_regions')
145
+
146
+ self.available_regions = attributes[:'available_regions'] if attributes[:'available_regions']
147
+
148
+ self.compatible_shapes = attributes[:'compatibleShapes'] if attributes[:'compatibleShapes']
149
+
150
+ raise 'You cannot provide both :compatibleShapes and :compatible_shapes' if attributes.key?(:'compatibleShapes') && attributes.key?(:'compatible_shapes')
151
+
152
+ self.compatible_shapes = attributes[:'compatible_shapes'] if attributes[:'compatible_shapes']
153
+
154
+ self.accessible_ports = attributes[:'accessiblePorts'] if attributes[:'accessiblePorts']
155
+
156
+ raise 'You cannot provide both :accessiblePorts and :accessible_ports' if attributes.key?(:'accessiblePorts') && attributes.key?(:'accessible_ports')
157
+
158
+ self.accessible_ports = attributes[:'accessible_ports'] if attributes[:'accessible_ports']
159
+
160
+ self.allowed_actions = attributes[:'allowedActions'] if attributes[:'allowedActions']
161
+
162
+ raise 'You cannot provide both :allowedActions and :allowed_actions' if attributes.key?(:'allowedActions') && attributes.key?(:'allowed_actions')
163
+
164
+ self.allowed_actions = attributes[:'allowed_actions'] if attributes[:'allowed_actions']
165
+ end
166
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
167
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
168
+
169
+ # Custom attribute writer method checking allowed values (enum).
170
+ # @param [Object] allowed_actions Object to be assigned
171
+ def allowed_actions=(allowed_actions)
172
+ # rubocop:disable Style/ConditionalAssignment
173
+ if allowed_actions.nil?
174
+ @allowed_actions = nil
175
+ else
176
+ @allowed_actions =
177
+ allowed_actions.collect do |item|
178
+ if ALLOWED_ACTIONS_ENUM.include?(item)
179
+ item
180
+ else
181
+ # rubocop: disable Metrics/LineLength
182
+ OCI.logger.debug("Unknown value for 'allowed_actions' [#{item}]. Mapping to 'ALLOWED_ACTIONS_UNKNOWN_ENUM_VALUE'") if OCI.logger
183
+ # rubocop: enable Metrics/LineLength
184
+ ALLOWED_ACTIONS_UNKNOWN_ENUM_VALUE
185
+ end
186
+ end
187
+ end
188
+ # rubocop:enable Style/ConditionalAssignment
189
+ end
190
+
191
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
192
+
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] other the other object to be compared
196
+ def ==(other)
197
+ return true if equal?(other)
198
+ self.class == other.class &&
199
+ listing_id == other.listing_id &&
200
+ time_published == other.time_published &&
201
+ listing_resource_id == other.listing_resource_id &&
202
+ listing_resource_version == other.listing_resource_version &&
203
+ available_regions == other.available_regions &&
204
+ compatible_shapes == other.compatible_shapes &&
205
+ accessible_ports == other.accessible_ports &&
206
+ allowed_actions == other.allowed_actions
207
+ end
208
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
209
+
210
+ # @see the `==` method
211
+ # @param [Object] other the other object to be compared
212
+ def eql?(other)
213
+ self == other
214
+ end
215
+
216
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
217
+
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Fixnum] Hash code
221
+ def hash
222
+ [listing_id, time_published, listing_resource_id, listing_resource_version, available_regions, compatible_shapes, accessible_ports, allowed_actions].hash
223
+ end
224
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
225
+
226
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
227
+
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def build_from_hash(attributes)
233
+ return nil unless attributes.is_a?(Hash)
234
+ self.class.swagger_types.each_pair do |key, type|
235
+ if type =~ /^Array<(.*)>/i
236
+ # check to ensure the input is an array given that the the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
239
+ public_method("#{key}=").call(
240
+ attributes[self.class.attribute_map[key]]
241
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
242
+ )
243
+ end
244
+ elsif !attributes[self.class.attribute_map[key]].nil?
245
+ public_method("#{key}=").call(
246
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
247
+ )
248
+ end
249
+ # or else data not found in attributes(hash), not an issue as the data can be optional
250
+ end
251
+
252
+ self
253
+ end
254
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
255
+
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
258
+ def to_s
259
+ to_hash.to_s
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = public_method(attr).call
268
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ private
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+ end
294
+ end
295
+ # rubocop:enable Lint/UnneededCopDisableDirective