Class: OCI::MarketplacePublisher::Models::ServiceListingRevision

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

Overview

Listing revision details for service listings

Constant Summary

Constants inherited from ListingRevision

ListingRevision::LIFECYCLE_STATE_ENUM, ListingRevision::LISTING_TYPE_ENUM, ListingRevision::PACKAGE_TYPE_ENUM, ListingRevision::STATUS_ENUM

Instance Attribute Summary collapse

Attributes inherited from ListingRevision

#compartment_id, #content_language, #defined_tags, #display_name, #extended_metadata, #freeform_tags, #headline, #icon, #id, #keywords, #lifecycle_state, #listing_id, #listing_type, #long_description, #package_type, #revision_number, #short_description, #status, #status_notes, #support_contacts, #support_links, #supportedlanguages, #system_tags, #tagline, #time_created, #time_updated, #usage_information

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ListingRevision

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ServiceListingRevision

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 156

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['listingType'] = 'SERVICE'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.contact_us = attributes[:'contactUs'] if attributes[:'contactUs']

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

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

  self.product_codes = attributes[:'productCodes'] if attributes[:'productCodes']

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

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

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

  self.trained_professionals = attributes[:'trainedProfessionals'] if attributes[:'trainedProfessionals']

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

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

  self.vanity_url = attributes[:'vanityUrl'] if attributes[:'vanityUrl']

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

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

  self.geo_locations = attributes[:'geoLocations'] if attributes[:'geoLocations']

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

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

Instance Attribute Details

#contact_usString

Custom text by partner regarding contact information

Returns:

  • (String)


14
15
16
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 14

def contact_us
  @contact_us
end

#geo_locationsArray<OCI::MarketplacePublisher::Models::GeoLocation>

Support details based on geographic location



34
35
36
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 34

def geo_locations
  @geo_locations
end

#industriesArray<String>

[Required] List of industries subscribed by listing.

Returns:

  • (Array<String>)


22
23
24
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 22

def industries
  @industries
end

#product_codesArray<String>

[Required] List of product codes subscribed by listing.

Returns:

  • (Array<String>)


18
19
20
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 18

def product_codes
  @product_codes
end

#trained_professionalsArray<OCI::MarketplacePublisher::Models::TrainedProfessionals>

Number of trained professional per product



26
27
28
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 26

def trained_professionals
  @trained_professionals
end

#vanity_urlString

Custom link to the listing

Returns:

  • (String)


30
31
32
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 30

def vanity_url
  @vanity_url
end

Class Method Details

.attribute_mapObject

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



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 37

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'listing_id': :'listingId',
    'compartment_id': :'compartmentId',
    'display_name': :'displayName',
    'revision_number': :'revisionNumber',
    'headline': :'headline',
    'tagline': :'tagline',
    'keywords': :'keywords',
    'short_description': :'shortDescription',
    'usage_information': :'usageInformation',
    'long_description': :'longDescription',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'content_language': :'contentLanguage',
    'supportedlanguages': :'supportedlanguages',
    'support_contacts': :'supportContacts',
    'support_links': :'supportLinks',
    'icon': :'icon',
    'status': :'status',
    'status_notes': :'statusNotes',
    'lifecycle_state': :'lifecycleState',
    'package_type': :'packageType',
    'listing_type': :'listingType',
    'extended_metadata': :'extendedMetadata',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags',
    'contact_us': :'contactUs',
    'product_codes': :'productCodes',
    'industries': :'industries',
    'trained_professionals': :'trainedProfessionals',
    'vanity_url': :'vanityUrl',
    'geo_locations': :'geoLocations'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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/service_listing_revision.rb', line 78

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'listing_id': :'String',
    'compartment_id': :'String',
    'display_name': :'String',
    'revision_number': :'String',
    'headline': :'String',
    'tagline': :'String',
    'keywords': :'String',
    'short_description': :'String',
    'usage_information': :'String',
    'long_description': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'content_language': :'OCI::MarketplacePublisher::Models::LanguageItem',
    'supportedlanguages': :'Array<OCI::MarketplacePublisher::Models::LanguageItem>',
    'support_contacts': :'Array<OCI::MarketplacePublisher::Models::SupportContact>',
    'support_links': :'Array<OCI::MarketplacePublisher::Models::NamedLink>',
    'icon': :'OCI::MarketplacePublisher::Models::ListingRevisionIconAttachment',
    'status': :'String',
    'status_notes': :'String',
    'lifecycle_state': :'String',
    'package_type': :'String',
    'listing_type': :'String',
    'extended_metadata': :'Hash<String, String>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>',
    'contact_us': :'String',
    'product_codes': :'Array<String>',
    'industries': :'Array<String>',
    'trained_professionals': :'Array<OCI::MarketplacePublisher::Models::TrainedProfessionals>',
    'vanity_url': :'String',
    'geo_locations': :'Array<OCI::MarketplacePublisher::Models::GeoLocation>'
    # 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 206

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

  self.class == other.class &&
    id == other.id &&
    listing_id == other.listing_id &&
    compartment_id == other.compartment_id &&
    display_name == other.display_name &&
    revision_number == other.revision_number &&
    headline == other.headline &&
    tagline == other.tagline &&
    keywords == other.keywords &&
    short_description == other.short_description &&
    usage_information == other.usage_information &&
    long_description == other.long_description &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    content_language == other.content_language &&
    supportedlanguages == other.supportedlanguages &&
    support_contacts == other.support_contacts &&
    support_links == other.support_links &&
    icon == other.icon &&
    status == other.status &&
    status_notes == other.status_notes &&
    lifecycle_state == other.lifecycle_state &&
    package_type == other.package_type &&
    listing_type == other.listing_type &&
     == other. &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags &&
    contact_us == other.contact_us &&
    product_codes == other.product_codes &&
    industries == other.industries &&
    trained_professionals == other.trained_professionals &&
    vanity_url == other.vanity_url &&
    geo_locations == other.geo_locations
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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 268

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


248
249
250
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 248

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



257
258
259
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 257

def hash
  [id, listing_id, compartment_id, display_name, revision_number, headline, tagline, keywords, short_description, usage_information, long_description, time_created, time_updated, content_language, supportedlanguages, support_contacts, support_links, icon, status, status_notes, lifecycle_state, package_type, listing_type, , freeform_tags, defined_tags, system_tags, contact_us, product_codes, industries, trained_professionals, vanity_url, geo_locations].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



301
302
303
304
305
306
307
308
309
310
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 301

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



295
296
297
# File 'lib/oci/marketplace_publisher/models/service_listing_revision.rb', line 295

def to_s
  to_hash.to_s
end