Class: OCI::Marketplace::Models::ListingSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/marketplace/models/listing_summary.rb

Overview

The model for a summary of an Oracle Cloud Infrastructure Marketplace listing.

Constant Summary collapse

PACKAGE_TYPE_ENUM =
[
  PACKAGE_TYPE_ORCHESTRATION = 'ORCHESTRATION'.freeze,
  PACKAGE_TYPE_IMAGE = 'IMAGE'.freeze,
  PACKAGE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PRICING_TYPES_ENUM =
[
  PRICING_TYPES_FREE = 'FREE'.freeze,
  PRICING_TYPES_BYOL = 'BYOL'.freeze,
  PRICING_TYPES_PAYGO = 'PAYGO'.freeze,
  PRICING_TYPES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ListingSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



121
122
123
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
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/oci/marketplace/models/listing_summary.rb', line 121

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

  self.short_description = attributes[:'shortDescription'] if attributes[:'shortDescription']

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

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

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

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

  self.package_type = attributes[:'packageType'] if attributes[:'packageType']

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

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

  self.pricing_types = attributes[:'pricingTypes'] if attributes[:'pricingTypes']

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

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

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

  self.is_featured = attributes[:'isFeatured'] unless attributes[:'isFeatured'].nil?

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

  self.is_featured = attributes[:'is_featured'] unless attributes[:'is_featured'].nil?

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

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

Instance Attribute Details

#categoriesArray<String>

Product categories that the listing belongs to.

Returns:

  • (Array<String>)


61
62
63
# File 'lib/oci/marketplace/models/listing_summary.rb', line 61

def categories
  @categories
end

#iconOCI::Marketplace::Models::UploadData



41
42
43
# File 'lib/oci/marketplace/models/listing_summary.rb', line 41

def icon
  @icon
end

#idString

The unique identifier for the listing in Marketplace.

Returns:

  • (String)


26
27
28
# File 'lib/oci/marketplace/models/listing_summary.rb', line 26

def id
  @id
end

Indicates whether the listing is featured.

Returns:

  • (BOOLEAN)


57
58
59
# File 'lib/oci/marketplace/models/listing_summary.rb', line 57

def is_featured
  @is_featured
end

#nameString

The name of the listing.

Returns:

  • (String)


30
31
32
# File 'lib/oci/marketplace/models/listing_summary.rb', line 30

def name
  @name
end

#package_typeString

The listing's package type.

Returns:

  • (String)


45
46
47
# File 'lib/oci/marketplace/models/listing_summary.rb', line 45

def package_type
  @package_type
end

#pricing_typesArray<String>

Summary of the pricing types available across all packages in the listing.

Returns:

  • (Array<String>)


49
50
51
# File 'lib/oci/marketplace/models/listing_summary.rb', line 49

def pricing_types
  @pricing_types
end

#publisherOCI::Marketplace::Models::PublisherSummary



64
65
66
# File 'lib/oci/marketplace/models/listing_summary.rb', line 64

def publisher
  @publisher
end

#regionsArray<OCI::Marketplace::Models::Region>

The regions where the listing is eligible to be deployed.



53
54
55
# File 'lib/oci/marketplace/models/listing_summary.rb', line 53

def regions
  @regions
end

#short_descriptionString

A short description of the listing.

Returns:

  • (String)


34
35
36
# File 'lib/oci/marketplace/models/listing_summary.rb', line 34

def short_description
  @short_description
end

#taglineString

The tagline of the listing.

Returns:

  • (String)


38
39
40
# File 'lib/oci/marketplace/models/listing_summary.rb', line 38

def tagline
  @tagline
end

Class Method Details

.attribute_mapObject

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



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/marketplace/models/listing_summary.rb', line 67

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'short_description': :'shortDescription',
    'tagline': :'tagline',
    'icon': :'icon',
    'package_type': :'packageType',
    'pricing_types': :'pricingTypes',
    'regions': :'regions',
    'is_featured': :'isFeatured',
    'categories': :'categories',
    'publisher': :'publisher'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/marketplace/models/listing_summary.rb', line 86

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'short_description': :'String',
    'tagline': :'String',
    'icon': :'OCI::Marketplace::Models::UploadData',
    'package_type': :'String',
    'pricing_types': :'Array<String>',
    'regions': :'Array<OCI::Marketplace::Models::Region>',
    'is_featured': :'BOOLEAN',
    'categories': :'Array<String>',
    'publisher': :'OCI::Marketplace::Models::PublisherSummary'
    # 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



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/oci/marketplace/models/listing_summary.rb', line 206

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    short_description == other.short_description &&
    tagline == other.tagline &&
    icon == other.icon &&
    package_type == other.package_type &&
    pricing_types == other.pricing_types &&
    regions == other.regions &&
    is_featured == other.is_featured &&
    categories == other.categories &&
    publisher == other.publisher
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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/marketplace/models/listing_summary.rb', line 246

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


226
227
228
# File 'lib/oci/marketplace/models/listing_summary.rb', line 226

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



235
236
237
# File 'lib/oci/marketplace/models/listing_summary.rb', line 235

def hash
  [id, name, short_description, tagline, icon, package_type, pricing_types, regions, is_featured, categories, publisher].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/marketplace/models/listing_summary.rb', line 279

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



273
274
275
# File 'lib/oci/marketplace/models/listing_summary.rb', line 273

def to_s
  to_hash.to_s
end