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
@@ -0,0 +1,219 @@
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
+ # Agreements for a listing resource version.
8
+ class Core::Models::AppCatalogListingResourceVersionAgreements # rubocop:disable Metrics/LineLength
9
+ # The OCID of the listing associated with these agreements.
10
+ # @return [String]
11
+ attr_accessor :listing_id
12
+
13
+ # Listing resource version associated with these agreements.
14
+ # @return [String]
15
+ attr_accessor :listing_resource_version
16
+
17
+ # Oracle TOU link
18
+ # @return [String]
19
+ attr_accessor :oracle_terms_of_use_link
20
+
21
+ # EULA link
22
+ # @return [String]
23
+ attr_accessor :eula_link
24
+
25
+ # Date and time the agreements were retrieved, in RFC3339 format.
26
+ # Example: `2018-03-20T12:32:53.532Z`
27
+ #
28
+ # @return [DateTime]
29
+ attr_accessor :time_retrieved
30
+
31
+ # A generated signature for this agreement retrieval operation which should be used in the create subscription call.
32
+ #
33
+ # @return [String]
34
+ attr_accessor :signature
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ # rubocop:disable Style/SymbolLiteral
40
+ 'listing_id': :'listingId',
41
+ 'listing_resource_version': :'listingResourceVersion',
42
+ 'oracle_terms_of_use_link': :'oracleTermsOfUseLink',
43
+ 'eula_link': :'eulaLink',
44
+ 'time_retrieved': :'timeRetrieved',
45
+ 'signature': :'signature'
46
+ # rubocop:enable Style/SymbolLiteral
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ # rubocop:disable Style/SymbolLiteral
54
+ 'listing_id': :'String',
55
+ 'listing_resource_version': :'String',
56
+ 'oracle_terms_of_use_link': :'String',
57
+ 'eula_link': :'String',
58
+ 'time_retrieved': :'DateTime',
59
+ 'signature': :'String'
60
+ # rubocop:enable Style/SymbolLiteral
61
+ }
62
+ end
63
+
64
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
65
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
66
+
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ # @option attributes [String] :listing_id The value to assign to the {#listing_id} property
71
+ # @option attributes [String] :listing_resource_version The value to assign to the {#listing_resource_version} property
72
+ # @option attributes [String] :oracle_terms_of_use_link The value to assign to the {#oracle_terms_of_use_link} property
73
+ # @option attributes [String] :eula_link The value to assign to the {#eula_link} property
74
+ # @option attributes [DateTime] :time_retrieved The value to assign to the {#time_retrieved} property
75
+ # @option attributes [String] :signature The value to assign to the {#signature} property
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ self.listing_id = attributes[:'listingId'] if attributes[:'listingId']
83
+
84
+ raise 'You cannot provide both :listingId and :listing_id' if attributes.key?(:'listingId') && attributes.key?(:'listing_id')
85
+
86
+ self.listing_id = attributes[:'listing_id'] if attributes[:'listing_id']
87
+
88
+ self.listing_resource_version = attributes[:'listingResourceVersion'] if attributes[:'listingResourceVersion']
89
+
90
+ raise 'You cannot provide both :listingResourceVersion and :listing_resource_version' if attributes.key?(:'listingResourceVersion') && attributes.key?(:'listing_resource_version')
91
+
92
+ self.listing_resource_version = attributes[:'listing_resource_version'] if attributes[:'listing_resource_version']
93
+
94
+ self.oracle_terms_of_use_link = attributes[:'oracleTermsOfUseLink'] if attributes[:'oracleTermsOfUseLink']
95
+
96
+ raise 'You cannot provide both :oracleTermsOfUseLink and :oracle_terms_of_use_link' if attributes.key?(:'oracleTermsOfUseLink') && attributes.key?(:'oracle_terms_of_use_link')
97
+
98
+ self.oracle_terms_of_use_link = attributes[:'oracle_terms_of_use_link'] if attributes[:'oracle_terms_of_use_link']
99
+
100
+ self.eula_link = attributes[:'eulaLink'] if attributes[:'eulaLink']
101
+
102
+ raise 'You cannot provide both :eulaLink and :eula_link' if attributes.key?(:'eulaLink') && attributes.key?(:'eula_link')
103
+
104
+ self.eula_link = attributes[:'eula_link'] if attributes[:'eula_link']
105
+
106
+ self.time_retrieved = attributes[:'timeRetrieved'] if attributes[:'timeRetrieved']
107
+
108
+ raise 'You cannot provide both :timeRetrieved and :time_retrieved' if attributes.key?(:'timeRetrieved') && attributes.key?(:'time_retrieved')
109
+
110
+ self.time_retrieved = attributes[:'time_retrieved'] if attributes[:'time_retrieved']
111
+
112
+ self.signature = attributes[:'signature'] if attributes[:'signature']
113
+ end
114
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
115
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
116
+
117
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
118
+
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] other the other object to be compared
122
+ def ==(other)
123
+ return true if equal?(other)
124
+ self.class == other.class &&
125
+ listing_id == other.listing_id &&
126
+ listing_resource_version == other.listing_resource_version &&
127
+ oracle_terms_of_use_link == other.oracle_terms_of_use_link &&
128
+ eula_link == other.eula_link &&
129
+ time_retrieved == other.time_retrieved &&
130
+ signature == other.signature
131
+ end
132
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
133
+
134
+ # @see the `==` method
135
+ # @param [Object] other the other object to be compared
136
+ def eql?(other)
137
+ self == other
138
+ end
139
+
140
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
141
+
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [listing_id, listing_resource_version, oracle_terms_of_use_link, eula_link, time_retrieved, signature].hash
147
+ end
148
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
149
+
150
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
151
+
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.swagger_types.each_pair do |key, type|
159
+ if type =~ /^Array<(.*)>/i
160
+ # check to ensure the input is an array given that the the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ public_method("#{key}=").call(
164
+ attributes[self.class.attribute_map[key]]
165
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
166
+ )
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ public_method("#{key}=").call(
170
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
171
+ )
172
+ end
173
+ # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # Returns the object in the form of hash
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_hash
189
+ hash = {}
190
+ self.class.attribute_map.each_pair do |attr, param|
191
+ value = public_method(attr).call
192
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ private
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end
219
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,194 @@
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 Resource Version summary
8
+ class Core::Models::AppCatalogListingResourceVersionSummary # rubocop:disable Metrics/LineLength
9
+ # The OCID of the listing this resource version belongs to.
10
+ # @return [String]
11
+ attr_accessor :listing_id
12
+
13
+ # Date and time the listing resource version was published, in RFC3339 format.
14
+ # Example: `2018-03-20T12:32:53.532Z`
15
+ #
16
+ # @return [DateTime]
17
+ attr_accessor :time_published
18
+
19
+ # OCID of the listing resource.
20
+ # @return [String]
21
+ attr_accessor :listing_resource_id
22
+
23
+ # Resource Version.
24
+ # @return [String]
25
+ attr_accessor :listing_resource_version
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ # rubocop:disable Style/SymbolLiteral
31
+ 'listing_id': :'listingId',
32
+ 'time_published': :'timePublished',
33
+ 'listing_resource_id': :'listingResourceId',
34
+ 'listing_resource_version': :'listingResourceVersion'
35
+ # rubocop:enable Style/SymbolLiteral
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'listing_id': :'String',
44
+ 'time_published': :'DateTime',
45
+ 'listing_resource_id': :'String',
46
+ 'listing_resource_version': :'String'
47
+ # rubocop:enable Style/SymbolLiteral
48
+ }
49
+ end
50
+
51
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
52
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
53
+
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ # @option attributes [String] :listing_id The value to assign to the {#listing_id} property
58
+ # @option attributes [DateTime] :time_published The value to assign to the {#time_published} property
59
+ # @option attributes [String] :listing_resource_id The value to assign to the {#listing_resource_id} property
60
+ # @option attributes [String] :listing_resource_version The value to assign to the {#listing_resource_version} 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.listing_id = attributes[:'listingId'] if attributes[:'listingId']
68
+
69
+ raise 'You cannot provide both :listingId and :listing_id' if attributes.key?(:'listingId') && attributes.key?(:'listing_id')
70
+
71
+ self.listing_id = attributes[:'listing_id'] if attributes[:'listing_id']
72
+
73
+ self.time_published = attributes[:'timePublished'] if attributes[:'timePublished']
74
+
75
+ raise 'You cannot provide both :timePublished and :time_published' if attributes.key?(:'timePublished') && attributes.key?(:'time_published')
76
+
77
+ self.time_published = attributes[:'time_published'] if attributes[:'time_published']
78
+
79
+ self.listing_resource_id = attributes[:'listingResourceId'] if attributes[:'listingResourceId']
80
+
81
+ raise 'You cannot provide both :listingResourceId and :listing_resource_id' if attributes.key?(:'listingResourceId') && attributes.key?(:'listing_resource_id')
82
+
83
+ self.listing_resource_id = attributes[:'listing_resource_id'] if attributes[:'listing_resource_id']
84
+
85
+ self.listing_resource_version = attributes[:'listingResourceVersion'] if attributes[:'listingResourceVersion']
86
+
87
+ raise 'You cannot provide both :listingResourceVersion and :listing_resource_version' if attributes.key?(:'listingResourceVersion') && attributes.key?(:'listing_resource_version')
88
+
89
+ self.listing_resource_version = attributes[:'listing_resource_version'] if attributes[:'listing_resource_version']
90
+ end
91
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
92
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
93
+
94
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
95
+
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] other the other object to be compared
99
+ def ==(other)
100
+ return true if equal?(other)
101
+ self.class == other.class &&
102
+ listing_id == other.listing_id &&
103
+ time_published == other.time_published &&
104
+ listing_resource_id == other.listing_resource_id &&
105
+ listing_resource_version == other.listing_resource_version
106
+ end
107
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
108
+
109
+ # @see the `==` method
110
+ # @param [Object] other the other object to be compared
111
+ def eql?(other)
112
+ self == other
113
+ end
114
+
115
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
116
+
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [listing_id, time_published, listing_resource_id, listing_resource_version].hash
122
+ end
123
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
124
+
125
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
126
+
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ self.class.swagger_types.each_pair do |key, type|
134
+ if type =~ /^Array<(.*)>/i
135
+ # check to ensure the input is an array given that the the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ public_method("#{key}=").call(
139
+ attributes[self.class.attribute_map[key]]
140
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
141
+ )
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ public_method("#{key}=").call(
145
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
146
+ )
147
+ end
148
+ # or else data not found in attributes(hash), not an issue as the data can be optional
149
+ end
150
+
151
+ self
152
+ end
153
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = public_method(attr).call
167
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ private
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+ end
193
+ end
194
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,188 @@
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
+ # A summary of a listing.
8
+ class Core::Models::AppCatalogListingSummary # rubocop:disable Metrics/LineLength
9
+ # the region free ocid of the listing resource.
10
+ # @return [String]
11
+ attr_accessor :listing_id
12
+
13
+ # The display name of the listing.
14
+ # @return [String]
15
+ attr_accessor :display_name
16
+
17
+ # The short summary for the listing.
18
+ # @return [String]
19
+ attr_accessor :summary
20
+
21
+ # The name of the publisher who published this listing.
22
+ # @return [String]
23
+ attr_accessor :publisher_name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'listing_id': :'listingId',
30
+ 'display_name': :'displayName',
31
+ 'summary': :'summary',
32
+ 'publisher_name': :'publisherName'
33
+ # rubocop:enable Style/SymbolLiteral
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ # rubocop:disable Style/SymbolLiteral
41
+ 'listing_id': :'String',
42
+ 'display_name': :'String',
43
+ 'summary': :'String',
44
+ 'publisher_name': :'String'
45
+ # rubocop:enable Style/SymbolLiteral
46
+ }
47
+ end
48
+
49
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
50
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
51
+
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ # @option attributes [String] :listing_id The value to assign to the {#listing_id} property
56
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
57
+ # @option attributes [String] :summary The value to assign to the {#summary} property
58
+ # @option attributes [String] :publisher_name The value to assign to the {#publisher_name} property
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ self.listing_id = attributes[:'listingId'] if attributes[:'listingId']
66
+
67
+ raise 'You cannot provide both :listingId and :listing_id' if attributes.key?(:'listingId') && attributes.key?(:'listing_id')
68
+
69
+ self.listing_id = attributes[:'listing_id'] if attributes[:'listing_id']
70
+
71
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
72
+
73
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
74
+
75
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
76
+
77
+ self.summary = attributes[:'summary'] if attributes[:'summary']
78
+
79
+ self.publisher_name = attributes[:'publisherName'] if attributes[:'publisherName']
80
+
81
+ raise 'You cannot provide both :publisherName and :publisher_name' if attributes.key?(:'publisherName') && attributes.key?(:'publisher_name')
82
+
83
+ self.publisher_name = attributes[:'publisher_name'] if attributes[:'publisher_name']
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
+ listing_id == other.listing_id &&
97
+ display_name == other.display_name &&
98
+ summary == other.summary &&
99
+ publisher_name == other.publisher_name
100
+ end
101
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
102
+
103
+ # @see the `==` method
104
+ # @param [Object] other the other object to be compared
105
+ def eql?(other)
106
+ self == other
107
+ end
108
+
109
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
110
+
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [listing_id, display_name, summary, publisher_name].hash
116
+ end
117
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
118
+
119
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
120
+
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.swagger_types.each_pair do |key, type|
128
+ if type =~ /^Array<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ public_method("#{key}=").call(
133
+ attributes[self.class.attribute_map[key]]
134
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
135
+ )
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ public_method("#{key}=").call(
139
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
140
+ )
141
+ end
142
+ # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = public_method(attr).call
161
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ private
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map { |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+ end
187
+ end
188
+ # rubocop:enable Lint/UnneededCopDisableDirective