Class: OCI::MarketplacePublisher::Models::CreateOfferDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/marketplace_publisher/models/create_offer_details.rb

Overview

The information about new Offers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateOfferDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 139

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.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.internal_notes = attributes[:'internalNotes'] if attributes[:'internalNotes']

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

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

  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_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.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.custom_fields = attributes[:'customFields'] if attributes[:'customFields']

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

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

  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

Compartment Identifier of the buyer

Returns:

  • (String)


21
22
23
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 21

def buyer_compartment_id
  @buyer_compartment_id
end

#buyer_informationOCI::MarketplacePublisher::Models::BuyerInformation



47
48
49
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 47

def buyer_information
  @buyer_information
end

#custom_fieldsArray<OCI::MarketplacePublisher::Models::CustomField>

A list of key value pairs specified by the seller



58
59
60
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 58

def custom_fields
  @custom_fields
end

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

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>>)


70
71
72
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 70

def defined_tags
  @defined_tags
end

#descriptionString

Description of the Offer

Returns:

  • (String)


25
26
27
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 25

def description
  @description
end

#display_nameString

[Required] Offers Identifier

Returns:

  • (String)


13
14
15
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 13

def display_name
  @display_name
end

#durationString

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

Returns:

  • (String)


37
38
39
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 37

def duration
  @duration
end

#freeform_tagsHash<String, String>

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>)


64
65
66
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 64

def freeform_tags
  @freeform_tags
end

#internal_notesString

Internal notes of the Offer

Returns:

  • (String)


29
30
31
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 29

def internal_notes
  @internal_notes
end

#pricingOCI::MarketplacePublisher::Models::Pricing



44
45
46
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 44

def pricing
  @pricing
end

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

A list of Resource Bundles associated with an Offer.



54
55
56
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 54

def resource_bundles
  @resource_bundles
end

#seller_compartment_idString

[Required] Compartment Identifier of the seller

Returns:

  • (String)


17
18
19
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 17

def seller_compartment_id
  @seller_compartment_id
end

#seller_informationOCI::MarketplacePublisher::Models::SellerInformation



50
51
52
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 50

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)


41
42
43
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 41

def time_accept_by
  @time_accept_by
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)


33
34
35
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 33

def time_start_date
  @time_start_date
end

Class Method Details

.attribute_mapObject

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



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 73

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'seller_compartment_id': :'sellerCompartmentId',
    'buyer_compartment_id': :'buyerCompartmentId',
    'description': :'description',
    'internal_notes': :'internalNotes',
    'time_start_date': :'timeStartDate',
    'duration': :'duration',
    'time_accept_by': :'timeAcceptBy',
    'pricing': :'pricing',
    'buyer_information': :'buyerInformation',
    'seller_information': :'sellerInformation',
    'resource_bundles': :'resourceBundles',
    'custom_fields': :'customFields',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 96

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'seller_compartment_id': :'String',
    'buyer_compartment_id': :'String',
    'description': :'String',
    'internal_notes': :'String',
    'time_start_date': :'DateTime',
    'duration': :'String',
    'time_accept_by': :'DateTime',
    'pricing': :'OCI::MarketplacePublisher::Models::Pricing',
    'buyer_information': :'OCI::MarketplacePublisher::Models::BuyerInformation',
    'seller_information': :'OCI::MarketplacePublisher::Models::SellerInformation',
    'resource_bundles': :'Array<OCI::MarketplacePublisher::Models::ResourceBundle>',
    'custom_fields': :'Array<OCI::MarketplacePublisher::Models::CustomField>',
    '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



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 231

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

  self.class == other.class &&
    display_name == other.display_name &&
    seller_compartment_id == other.seller_compartment_id &&
    buyer_compartment_id == other.buyer_compartment_id &&
    description == other.description &&
    internal_notes == other.internal_notes &&
    time_start_date == other.time_start_date &&
    duration == other.duration &&
    time_accept_by == other.time_accept_by &&
    pricing == other.pricing &&
    buyer_information == other.buyer_information &&
    seller_information == other.seller_information &&
    resource_bundles == other.resource_bundles &&
    custom_fields == other.custom_fields &&
    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



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 275

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


255
256
257
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 255

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



264
265
266
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 264

def hash
  [display_name, seller_compartment_id, buyer_compartment_id, description, internal_notes, time_start_date, duration, time_accept_by, pricing, buyer_information, seller_information, resource_bundles, custom_fields, 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



308
309
310
311
312
313
314
315
316
317
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 308

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



302
303
304
# File 'lib/oci/marketplace_publisher/models/create_offer_details.rb', line 302

def to_s
  to_hash.to_s
end