Class: OCI::MarketplacePublisher::Models::CreateServiceListingRevisionDetails

Inherits:
CreateListingRevisionDetails show all
Defined in:
lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb

Overview

Listing revision update details for listings

Constant Summary

Constants inherited from CreateListingRevisionDetails

OCI::MarketplacePublisher::Models::CreateListingRevisionDetails::LISTING_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CreateListingRevisionDetails

#content_language, #defined_tags, #display_name, #freeform_tags, #headline, #keywords, #listing_id, #listing_type, #long_description, #short_description, #status, #support_contacts, #support_links, #supportedlanguages, #tagline, #usage_information

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateListingRevisionDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateServiceListingRevisionDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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_publisher/models/create_service_listing_revision_details.rb', line 123

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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'listing_id': :'listingId',
    'listing_type': :'listingType',
    'headline': :'headline',
    'tagline': :'tagline',
    'keywords': :'keywords',
    'short_description': :'shortDescription',
    'usage_information': :'usageInformation',
    'long_description': :'longDescription',
    'content_language': :'contentLanguage',
    'supportedlanguages': :'supportedlanguages',
    'support_contacts': :'supportContacts',
    'support_links': :'supportLinks',
    'status': :'status',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    '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.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 67

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'listing_id': :'String',
    'listing_type': :'String',
    'headline': :'String',
    'tagline': :'String',
    'keywords': :'String',
    'short_description': :'String',
    'usage_information': :'String',
    'long_description': :'String',
    '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>',
    'status': :'String',
    'freeform_tags': :'Hash<String, String>',
    'defined_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



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

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

  self.class == other.class &&
    display_name == other.display_name &&
    listing_id == other.listing_id &&
    listing_type == other.listing_type &&
    headline == other.headline &&
    tagline == other.tagline &&
    keywords == other.keywords &&
    short_description == other.short_description &&
    usage_information == other.usage_information &&
    long_description == other.long_description &&
    content_language == other.content_language &&
    supportedlanguages == other.supportedlanguages &&
    support_contacts == other.support_contacts &&
    support_links == other.support_links &&
    status == other.status &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 224

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


204
205
206
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 213

def hash
  [display_name, listing_id, listing_type, headline, tagline, keywords, short_description, usage_information, long_description, content_language, supportedlanguages, support_contacts, support_links, status, freeform_tags, defined_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



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 257

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



251
252
253
# File 'lib/oci/marketplace_publisher/models/create_service_listing_revision_details.rb', line 251

def to_s
  to_hash.to_s
end