Class: OCI::ServiceCatalog::Models::ApplicationSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/service_catalog/models/application_summary.rb

Overview

The model for summary of an application in service catalog.

Constant Summary collapse

PRICING_TYPE_ENUM =
[
  PRICING_TYPE_FREE = 'FREE'.freeze,
  PRICING_TYPE_BYOL = 'BYOL'.freeze,
  PRICING_TYPE_PAYGO = 'PAYGO'.freeze,
  PRICING_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PACKAGE_TYPE_ENUM =
[
  PACKAGE_TYPE_STACK = 'STACK'.freeze,
  PACKAGE_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 = {}) ⇒ ApplicationSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
# File 'lib/oci/service_catalog/models/application_summary.rb', line 107

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. = 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

Instance Attribute Details

#display_nameString

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

Returns:

  • (String)


34
35
36
# File 'lib/oci/service_catalog/models/application_summary.rb', line 34

def display_name
  @display_name
end

#entity_idString

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

Returns:

  • (String)


26
27
28
# File 'lib/oci/service_catalog/models/application_summary.rb', line 26

def entity_id
  @entity_id
end

#entity_typeString

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

Returns:

  • (String)


30
31
32
# File 'lib/oci/service_catalog/models/application_summary.rb', line 30

def entity_type
  @entity_type
end

Indicates whether the application is featured.

Returns:

  • (BOOLEAN)


38
39
40
# File 'lib/oci/service_catalog/models/application_summary.rb', line 38

def is_featured
  @is_featured
end

#logoOCI::ServiceCatalog::Models::UploadData



48
49
50
# File 'lib/oci/service_catalog/models/application_summary.rb', line 48

def 
  @logo
end

#package_typeString

The type of the packages withing the application.

Returns:

  • (String)


56
57
58
# File 'lib/oci/service_catalog/models/application_summary.rb', line 56

def package_type
  @package_type
end

#pricing_typeString

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

Returns:

  • (String)


52
53
54
# File 'lib/oci/service_catalog/models/application_summary.rb', line 52

def pricing_type
  @pricing_type
end

#publisherOCI::ServiceCatalog::Models::PublisherSummary



41
42
43
# File 'lib/oci/service_catalog/models/application_summary.rb', line 41

def publisher
  @publisher
end

#short_descriptionString

A short description of the application.

Returns:

  • (String)


45
46
47
# File 'lib/oci/service_catalog/models/application_summary.rb', line 45

def short_description
  @short_description
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/service_catalog/models/application_summary.rb', line 59

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

.swagger_typesObject

Attribute type mapping.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/oci/service_catalog/models/application_summary.rb', line 76

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

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/oci/service_catalog/models/application_summary.rb', line 193

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 &&
     == other. &&
    pricing_type == other.pricing_type &&
    package_type == other.package_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



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

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


211
212
213
# File 'lib/oci/service_catalog/models/application_summary.rb', line 211

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



220
221
222
# File 'lib/oci/service_catalog/models/application_summary.rb', line 220

def hash
  [entity_id, entity_type, display_name, is_featured, publisher, short_description, , pricing_type, package_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



264
265
266
267
268
269
270
271
272
273
# File 'lib/oci/service_catalog/models/application_summary.rb', line 264

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



258
259
260
# File 'lib/oci/service_catalog/models/application_summary.rb', line 258

def to_s
  to_hash.to_s
end