Class: OCI::MarketplacePrivateOffer::Models::Offer

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/marketplace_private_offer/models/offer.rb

Overview

Description of Offer.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OFFER_STATUS_ENUM =
[
  OFFER_STATUS_DRAFT = 'DRAFT'.freeze,
  OFFER_STATUS_PENDING_MARKETPLACE = 'PENDING_MARKETPLACE'.freeze,
  OFFER_STATUS_PENDING_BUYER = 'PENDING_BUYER'.freeze,
  OFFER_STATUS_EXPIRED = 'EXPIRED'.freeze,
  OFFER_STATUS_ACCEPTED = 'ACCEPTED'.freeze,
  OFFER_STATUS_ACTIVE = 'ACTIVE'.freeze,
  OFFER_STATUS_ENDED = 'ENDED'.freeze,
  OFFER_STATUS_FAILED_SEND = 'FAILED_SEND'.freeze,
  OFFER_STATUS_FAILED_ACCEPT = 'FAILED_ACCEPT'.freeze,
  OFFER_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Offer

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 211

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.id = attributes[:'id'] if attributes[:'id']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.seller_compartment_id = attributes[:'sellerCompartmentId'] if attributes[:'sellerCompartmentId']

  raise 'You cannot provide both :sellerCompartmentId and :seller_compartment_id' if attributes.key?(:'sellerCompartmentId') && attributes.key?(:'seller_compartment_id')

  self.seller_compartment_id = attributes[:'seller_compartment_id'] if attributes[:'seller_compartment_id']

  self.buyer_compartment_id = attributes[:'buyerCompartmentId'] if attributes[:'buyerCompartmentId']

  raise 'You cannot provide both :buyerCompartmentId and :buyer_compartment_id' if attributes.key?(:'buyerCompartmentId') && attributes.key?(:'buyer_compartment_id')

  self.buyer_compartment_id = attributes[:'buyer_compartment_id'] if attributes[:'buyer_compartment_id']

  self.description = attributes[:'description'] if attributes[:'description']

  self.time_start_date = attributes[:'timeStartDate'] if attributes[:'timeStartDate']

  raise 'You cannot provide both :timeStartDate and :time_start_date' if attributes.key?(:'timeStartDate') && attributes.key?(:'time_start_date')

  self.time_start_date = attributes[:'time_start_date'] if attributes[:'time_start_date']

  self.duration = attributes[:'duration'] if attributes[:'duration']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.time_accept_by = attributes[:'timeAcceptBy'] if attributes[:'timeAcceptBy']

  raise 'You cannot provide both :timeAcceptBy and :time_accept_by' if attributes.key?(:'timeAcceptBy') && attributes.key?(:'time_accept_by')

  self.time_accept_by = attributes[:'time_accept_by'] if attributes[:'time_accept_by']

  self.time_accepted = attributes[:'timeAccepted'] if attributes[:'timeAccepted']

  raise 'You cannot provide both :timeAccepted and :time_accepted' if attributes.key?(:'timeAccepted') && attributes.key?(:'time_accepted')

  self.time_accepted = attributes[:'time_accepted'] if attributes[:'time_accepted']

  self.time_offer_end = attributes[:'timeOfferEnd'] if attributes[:'timeOfferEnd']

  raise 'You cannot provide both :timeOfferEnd and :time_offer_end' if attributes.key?(:'timeOfferEnd') && attributes.key?(:'time_offer_end')

  self.time_offer_end = attributes[:'time_offer_end'] if attributes[:'time_offer_end']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']

  raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')

  self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']

  self.offer_status = attributes[:'offerStatus'] if attributes[:'offerStatus']

  raise 'You cannot provide both :offerStatus and :offer_status' if attributes.key?(:'offerStatus') && attributes.key?(:'offer_status')

  self.offer_status = attributes[:'offer_status'] if attributes[:'offer_status']

  self.publisher_summary = attributes[:'publisherSummary'] if attributes[:'publisherSummary']

  raise 'You cannot provide both :publisherSummary and :publisher_summary' if attributes.key?(:'publisherSummary') && attributes.key?(:'publisher_summary')

  self.publisher_summary = attributes[:'publisher_summary'] if attributes[:'publisher_summary']

  self.pricing = attributes[:'pricing'] if attributes[:'pricing']

  self.buyer_information = attributes[:'buyerInformation'] if attributes[:'buyerInformation']

  raise 'You cannot provide both :buyerInformation and :buyer_information' if attributes.key?(:'buyerInformation') && attributes.key?(:'buyer_information')

  self.buyer_information = attributes[:'buyer_information'] if attributes[:'buyer_information']

  self.seller_information = attributes[:'sellerInformation'] if attributes[:'sellerInformation']

  raise 'You cannot provide both :sellerInformation and :seller_information' if attributes.key?(:'sellerInformation') && attributes.key?(:'seller_information')

  self.seller_information = attributes[:'seller_information'] if attributes[:'seller_information']

  self.resource_bundles = attributes[:'resourceBundles'] if attributes[:'resourceBundles']

  raise 'You cannot provide both :resourceBundles and :resource_bundles' if attributes.key?(:'resourceBundles') && attributes.key?(:'resource_bundles')

  self.resource_bundles = attributes[:'resource_bundles'] if attributes[:'resource_bundles']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
end

Instance Attribute Details

#buyer_compartment_idString

OCID of the buyer's tenancy (root compartment).

Returns:

  • (String)


49
50
51
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 49

def buyer_compartment_id
  @buyer_compartment_id
end

#buyer_informationOCI::MarketplacePrivateOffer::Models::BuyerInformation



102
103
104
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 102

def buyer_information
  @buyer_information
end

#defined_tagsHash<String, Hash<String, Object>>

[Required] Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


121
122
123
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 121

def defined_tags
  @defined_tags
end

#descriptionString

The description of the offer

Returns:

  • (String)


53
54
55
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 53

def description
  @description
end

#display_nameString

[Required] Offer Identifier, can be renamed

Returns:

  • (String)


41
42
43
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 41

def display_name
  @display_name
end

#durationString

Duration the Offer will be active after its start date. An ISO8601 extended formatted string.

Returns:

  • (String)


61
62
63
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 61

def duration
  @duration
end

#freeform_tagsHash<String, String>

[Required] Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


115
116
117
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 115

def freeform_tags
  @freeform_tags
end

#idString

[Required] Unique identifier that is immutable on creation

Returns:

  • (String)


37
38
39
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 37

def id
  @id
end

#lifecycle_detailsString

A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

Returns:

  • (String)


89
90
91
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 89

def lifecycle_details
  @lifecycle_details
end

#lifecycle_stateString

[Required] The current state of the Offer.

Returns:

  • (String)


85
86
87
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 85

def lifecycle_state
  @lifecycle_state
end

#offer_statusString

A substate for lifeCycleStatus to give a more human readable version of the offer

Returns:

  • (String)


93
94
95
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 93

def offer_status
  @offer_status
end

#pricingOCI::MarketplacePrivateOffer::Models::Pricing



99
100
101
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 99

def pricing
  @pricing
end

#publisher_summaryOCI::MarketplacePrivateOffer::Models::PublisherSummary



96
97
98
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 96

def publisher_summary
  @publisher_summary
end

#resource_bundlesArray<OCI::MarketplacePrivateOffer::Models::ResourceBundle>

A list of Resource Bundles associated with an Offer.



109
110
111
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 109

def resource_bundles
  @resource_bundles
end

#seller_compartment_idString

[Required] OCID of the seller's tenancy (root compartment).

Returns:

  • (String)


45
46
47
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 45

def seller_compartment_id
  @seller_compartment_id
end

#seller_informationOCI::MarketplacePrivateOffer::Models::SellerInformation



105
106
107
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 105

def seller_information
  @seller_information
end

#time_accept_byDateTime

The time the Offer must be accepted by the Buyer before the Offer becomes invalid. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


73
74
75
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 73

def time_accept_by
  @time_accept_by
end

#time_acceptedDateTime

The time the Offer was accepted by the Buyer of the Offer. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


77
78
79
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 77

def time_accepted
  @time_accepted
end

#time_createdDateTime

[Required] The time the the Offer was created. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


65
66
67
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 65

def time_created
  @time_created
end

#time_offer_endDateTime

The time the accepted Offer will end. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 81

def time_offer_end
  @time_offer_end
end

#time_start_dateDateTime

The time the Offer will become active after it has been accepted by the Buyer. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


57
58
59
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 57

def time_start_date
  @time_start_date
end

#time_updatedDateTime

The time the Offer was updated. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


69
70
71
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 69

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 124

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'seller_compartment_id': :'sellerCompartmentId',
    'buyer_compartment_id': :'buyerCompartmentId',
    'description': :'description',
    'time_start_date': :'timeStartDate',
    'duration': :'duration',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'time_accept_by': :'timeAcceptBy',
    'time_accepted': :'timeAccepted',
    'time_offer_end': :'timeOfferEnd',
    'lifecycle_state': :'lifecycleState',
    'lifecycle_details': :'lifecycleDetails',
    'offer_status': :'offerStatus',
    'publisher_summary': :'publisherSummary',
    'pricing': :'pricing',
    'buyer_information': :'buyerInformation',
    'seller_information': :'sellerInformation',
    'resource_bundles': :'resourceBundles',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 154

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'seller_compartment_id': :'String',
    'buyer_compartment_id': :'String',
    'description': :'String',
    'time_start_date': :'DateTime',
    'duration': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'time_accept_by': :'DateTime',
    'time_accepted': :'DateTime',
    'time_offer_end': :'DateTime',
    'lifecycle_state': :'String',
    'lifecycle_details': :'String',
    'offer_status': :'String',
    'publisher_summary': :'OCI::MarketplacePrivateOffer::Models::PublisherSummary',
    'pricing': :'OCI::MarketplacePrivateOffer::Models::Pricing',
    'buyer_information': :'OCI::MarketplacePrivateOffer::Models::BuyerInformation',
    'seller_information': :'OCI::MarketplacePrivateOffer::Models::SellerInformation',
    'resource_bundles': :'Array<OCI::MarketplacePrivateOffer::Models::ResourceBundle>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 367

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    seller_compartment_id == other.seller_compartment_id &&
    buyer_compartment_id == other.buyer_compartment_id &&
    description == other.description &&
    time_start_date == other.time_start_date &&
    duration == other.duration &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    time_accept_by == other.time_accept_by &&
    time_accepted == other.time_accepted &&
    time_offer_end == other.time_offer_end &&
    lifecycle_state == other.lifecycle_state &&
    lifecycle_details == other.lifecycle_details &&
    offer_status == other.offer_status &&
    publisher_summary == other.publisher_summary &&
    pricing == other.pricing &&
    buyer_information == other.buyer_information &&
    seller_information == other.seller_information &&
    resource_bundles == other.resource_bundles &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 418

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


398
399
400
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 398

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



407
408
409
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 407

def hash
  [id, display_name, seller_compartment_id, buyer_compartment_id, description, time_start_date, duration, time_created, time_updated, time_accept_by, time_accepted, time_offer_end, lifecycle_state, lifecycle_details, offer_status, publisher_summary, pricing, buyer_information, seller_information, resource_bundles, freeform_tags, defined_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



451
452
453
454
455
456
457
458
459
460
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 451

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



445
446
447
# File 'lib/oci/marketplace_private_offer/models/offer.rb', line 445

def to_s
  to_hash.to_s
end