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_CONTAINER = 'CONTAINER'.freeze,
  PACKAGE_TYPE_KUBERNETES = 'KUBERNETES'.freeze,
  PACKAGE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
COMPATIBLE_ARCHITECTURES_ENUM =
[
  COMPATIBLE_ARCHITECTURES_X86 = 'X86'.freeze,
  COMPATIBLE_ARCHITECTURES_ARM = 'ARM'.freeze,
  COMPATIBLE_ARCHITECTURES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LISTING_TYPE_ENUM =
[
  LISTING_TYPE_COMMUNITY = 'COMMUNITY'.freeze,
  LISTING_TYPE_PARTNER = 'PARTNER'.freeze,
  LISTING_TYPE_PRIVATE = 'PRIVATE'.freeze,
  LISTING_TYPE_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):



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
223
224
225
226
227
228
# File 'lib/oci/marketplace/models/listing_summary.rb', line 159

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.is_rover_exportable = attributes[:'isRoverExportable'] unless attributes[:'isRoverExportable'].nil?
  self.is_rover_exportable = false if is_rover_exportable.nil? && !attributes.key?(:'isRoverExportable') # rubocop:disable Style/StringLiterals

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

  self.is_rover_exportable = attributes[:'is_rover_exportable'] unless attributes[:'is_rover_exportable'].nil?
  self.is_rover_exportable = false if is_rover_exportable.nil? && !attributes.key?(:'isRoverExportable') && !attributes.key?(:'is_rover_exportable') # rubocop:disable Style/StringLiterals

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

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

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

  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']

  self.supported_operating_systems = attributes[:'supportedOperatingSystems'] if attributes[:'supportedOperatingSystems']

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

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

  self.listing_type = attributes[:'listingType'] if attributes[:'listingType']

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

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

Instance Attribute Details

#categoriesArray<String>

Product categories that the listing belongs to.

Returns:

  • (Array<String>)


79
80
81
# File 'lib/oci/marketplace/models/listing_summary.rb', line 79

def categories
  @categories
end

#compatible_architecturesArray<String>

The list of compatible architectures supported by the listing

Returns:

  • (Array<String>)


66
67
68
# File 'lib/oci/marketplace/models/listing_summary.rb', line 66

def compatible_architectures
  @compatible_architectures
end

#iconOCI::Marketplace::Models::UploadData



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

def icon
  @icon
end

#idString

The unique identifier for the listing in Marketplace.

Returns:

  • (String)


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

def id
  @id
end

Indicates whether the listing is featured.

Returns:

  • (BOOLEAN)


75
76
77
# File 'lib/oci/marketplace/models/listing_summary.rb', line 75

def is_featured
  @is_featured
end

#is_rover_exportableBOOLEAN

True if this application is Rover exportable

Returns:

  • (BOOLEAN)


47
48
49
# File 'lib/oci/marketplace/models/listing_summary.rb', line 47

def is_rover_exportable
  @is_rover_exportable
end

#listing_typeString

The publisher category to which the listing belongs. The publisher category informs where the listing appears for use.

Returns:

  • (String)


90
91
92
# File 'lib/oci/marketplace/models/listing_summary.rb', line 90

def listing_type
  @listing_type
end

#nameString

The name of the listing.

Returns:

  • (String)


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

def name
  @name
end

#package_typeString

The listing's package type.

Returns:

  • (String)


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

def package_type
  @package_type
end

#pricing_typesArray<OCI::Marketplace::Models::PricingTypeEnum>

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

Returns:

  • (Array<OCI::Marketplace::Models::PricingTypeEnum>)


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

def pricing_types
  @pricing_types
end

#publisherOCI::Marketplace::Models::PublisherSummary



82
83
84
# File 'lib/oci/marketplace/models/listing_summary.rb', line 82

def publisher
  @publisher
end

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

The regions where you can deploy the listing. (Some listings have restrictions that limit their deployment to United States regions only.)



71
72
73
# File 'lib/oci/marketplace/models/listing_summary.rb', line 71

def regions
  @regions
end

#short_descriptionString

A short description of the listing.

Returns:

  • (String)


43
44
45
# File 'lib/oci/marketplace/models/listing_summary.rb', line 43

def short_description
  @short_description
end

#supported_operating_systemsArray<OCI::Marketplace::Models::OperatingSystem>

The list of operating systems supported by the listing.



86
87
88
# File 'lib/oci/marketplace/models/listing_summary.rb', line 86

def supported_operating_systems
  @supported_operating_systems
end

#taglineString

The tagline of the listing.

Returns:

  • (String)


51
52
53
# File 'lib/oci/marketplace/models/listing_summary.rb', line 51

def tagline
  @tagline
end

Class Method Details

.attribute_mapObject

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/oci/marketplace/models/listing_summary.rb', line 93

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

.swagger_typesObject

Attribute type mapping.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/oci/marketplace/models/listing_summary.rb', line 116

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



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/oci/marketplace/models/listing_summary.rb', line 283

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

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



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/oci/marketplace/models/listing_summary.rb', line 327

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


307
308
309
# File 'lib/oci/marketplace/models/listing_summary.rb', line 307

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



316
317
318
# File 'lib/oci/marketplace/models/listing_summary.rb', line 316

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



360
361
362
363
364
365
366
367
368
369
# File 'lib/oci/marketplace/models/listing_summary.rb', line 360

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



354
355
356
# File 'lib/oci/marketplace/models/listing_summary.rb', line 354

def to_s
  to_hash.to_s
end