class OCI::ServiceCatalog::Models::ApplicationSummary

The model for summary of an application in service catalog.

Constants

PACKAGE_TYPE_ENUM
PRICING_TYPE_ENUM

Attributes

display_name[RW]

[Required] The name that service catalog should use to display this application. @return [String]

entity_id[RW]

[Required] Identifier of the application from a service catalog. @return [String]

entity_type[RW]

[Required] The type of an application in the service catalog. @return [String]

package_type[R]

The type of the packages withing the application. @return [String]

pricing_type[R]

Summary of the pricing types available across all packages in the application. @return [String]

publisher[RW]

@return [OCI::ServiceCatalog::Models::PublisherSummary]

short_description[RW]

A short description of the application. @return [String]

Public Class Methods

attribute_map() click to toggle source

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

# File lib/oci/service_catalog/models/application_summary.rb, line 58
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_id': :'entityId',
    'entity_type': :'entityType',
    'display_name': :'displayName',
    'is_featured': :'isFeatured',
    'publisher': :'publisher',
    'short_description': :'shortDescription',
    'logo': :'logo',
    'pricing_type': :'pricingType',
    'package_type': :'packageType'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :entity_id The value to assign to the {#entity_id} property @option attributes [String] :entity_type The value to assign to the {#entity_type} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [BOOLEAN] :is_featured The value to assign to the {#is_featured} property @option attributes [OCI::ServiceCatalog::Models::PublisherSummary] :publisher The value to assign to the {#publisher} property @option attributes [String] :short_description The value to assign to the {#short_description} property @option attributes [OCI::ServiceCatalog::Models::UploadData] :logo The value to assign to the {#logo} property @option attributes [String] :pricing_type The value to assign to the {#pricing_type} property @option attributes [String] :package_type The value to assign to the {#package_type} property

# File lib/oci/service_catalog/models/application_summary.rb, line 106
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.entity_id = attributes[:'entityId'] if attributes[:'entityId']

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

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

  self.entity_type = attributes[:'entityType'] if attributes[:'entityType']

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

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

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

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

  self.pricing_type = attributes[:'pricingType'] if attributes[:'pricingType']

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

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

  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']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/service_catalog/models/application_summary.rb, line 75
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_id': :'String',
    'entity_type': :'String',
    'display_name': :'String',
    'is_featured': :'BOOLEAN',
    'publisher': :'OCI::ServiceCatalog::Models::PublisherSummary',
    'short_description': :'String',
    'logo': :'OCI::ServiceCatalog::Models::UploadData',
    'pricing_type': :'String',
    'package_type': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/service_catalog/models/application_summary.rb, line 192
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    entity_id == other.entity_id &&
    entity_type == other.entity_type &&
    display_name == other.display_name &&
    is_featured == other.is_featured &&
    publisher == other.publisher &&
    short_description == other.short_description &&
    logo == other.logo &&
    pricing_type == other.pricing_type &&
    package_type == other.package_type
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/service_catalog/models/application_summary.rb, line 230
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/service_catalog/models/application_summary.rb, line 210
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/service_catalog/models/application_summary.rb, line 219
def hash
  [entity_id, entity_type, display_name, is_featured, publisher, short_description, logo, pricing_type, package_type].hash
end
package_type=(package_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] package_type Object to be assigned

# File lib/oci/service_catalog/models/application_summary.rb, line 176
def package_type=(package_type)
  # rubocop:disable Style/ConditionalAssignment
  if package_type && !PACKAGE_TYPE_ENUM.include?(package_type)
    OCI.logger.debug("Unknown value for 'package_type' [" + package_type + "]. Mapping to 'PACKAGE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @package_type = PACKAGE_TYPE_UNKNOWN_ENUM_VALUE
  else
    @package_type = package_type
  end
  # rubocop:enable Style/ConditionalAssignment
end
pricing_type=(pricing_type) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] pricing_type Object to be assigned

# File lib/oci/service_catalog/models/application_summary.rb, line 163
def pricing_type=(pricing_type)
  # rubocop:disable Style/ConditionalAssignment
  if pricing_type && !PRICING_TYPE_ENUM.include?(pricing_type)
    OCI.logger.debug("Unknown value for 'pricing_type' [" + pricing_type + "]. Mapping to 'PRICING_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
    @pricing_type = PRICING_TYPE_UNKNOWN_ENUM_VALUE
  else
    @pricing_type = pricing_type
  end
  # rubocop:enable Style/ConditionalAssignment
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/service_catalog/models/application_summary.rb, line 263
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_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/service_catalog/models/application_summary.rb, line 257
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/service_catalog/models/application_summary.rb, line 280
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end