Class: OCI::Marketplace::Models::Publisher

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/marketplace/models/publisher.rb

Overview

The model for a publisher.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Publisher

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



101
102
103
104
105
106
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
# File 'lib/oci/marketplace/models/publisher.rb', line 101

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

  self.year_founded = attributes[:'yearFounded'] if attributes[:'yearFounded']

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

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

  self.website_url = attributes[:'websiteUrl'] if attributes[:'websiteUrl']

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

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

  self.contact_email = attributes[:'contactEmail'] if attributes[:'contactEmail']

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

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

  self.contact_phone = attributes[:'contactPhone'] if attributes[:'contactPhone']

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

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

  self.hq_address = attributes[:'hqAddress'] if attributes[:'hqAddress']

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

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

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

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

Instance Attribute Details

#contact_emailString

The email address of the publisher.

Returns:

  • (String)


32
33
34
# File 'lib/oci/marketplace/models/publisher.rb', line 32

def contact_email
  @contact_email
end

#contact_phoneString

The phone number of the publisher.

Returns:

  • (String)


36
37
38
# File 'lib/oci/marketplace/models/publisher.rb', line 36

def contact_phone
  @contact_phone
end

#descriptionString

A description of the publisher.

Returns:

  • (String)


20
21
22
# File 'lib/oci/marketplace/models/publisher.rb', line 20

def description
  @description
end

#hq_addressString

The address of the publisher's headquarters.

Returns:

  • (String)


40
41
42
# File 'lib/oci/marketplace/models/publisher.rb', line 40

def hq_address
  @hq_address
end

#idString

Unique identifier for the publisher.

Returns:

  • (String)


12
13
14
# File 'lib/oci/marketplace/models/publisher.rb', line 12

def id
  @id
end

Reference links.

Returns:



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

def links
  @links
end

#logoOCI::Marketplace::Models::UploadData



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

def 
  @logo
end

#nameString

The name of the publisher.

Returns:

  • (String)


16
17
18
# File 'lib/oci/marketplace/models/publisher.rb', line 16

def name
  @name
end

#website_urlString

The publisher's website.

Returns:

  • (String)


28
29
30
# File 'lib/oci/marketplace/models/publisher.rb', line 28

def website_url
  @website_url
end

#year_foundedInteger

The year the publisher's company or organization was founded.

Returns:

  • (Integer)


24
25
26
# File 'lib/oci/marketplace/models/publisher.rb', line 24

def year_founded
  @year_founded
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/marketplace/models/publisher.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'name': :'name',
    'description': :'description',
    'year_founded': :'yearFounded',
    'website_url': :'websiteUrl',
    'contact_email': :'contactEmail',
    'contact_phone': :'contactPhone',
    'hq_address': :'hqAddress',
    'logo': :'logo',
    'links': :'links'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/marketplace/models/publisher.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'name': :'String',
    'description': :'String',
    'year_founded': :'Integer',
    'website_url': :'String',
    'contact_email': :'String',
    'contact_phone': :'String',
    'hq_address': :'String',
    'logo': :'OCI::Marketplace::Models::UploadData',
    'links': :'Array<OCI::Marketplace::Models::Link>'
    # 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



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/oci/marketplace/models/publisher.rb', line 155

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

  self.class == other.class &&
    id == other.id &&
    name == other.name &&
    description == other.description &&
    year_founded == other.year_founded &&
    website_url == other.website_url &&
    contact_email == other.contact_email &&
    contact_phone == other.contact_phone &&
    hq_address == other.hq_address &&
     == other. &&
    links == other.links
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



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/marketplace/models/publisher.rb', line 194

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


174
175
176
# File 'lib/oci/marketplace/models/publisher.rb', line 174

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



183
184
185
# File 'lib/oci/marketplace/models/publisher.rb', line 183

def hash
  [id, name, description, year_founded, website_url, contact_email, contact_phone, hq_address, , links].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/marketplace/models/publisher.rb', line 227

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



221
222
223
# File 'lib/oci/marketplace/models/publisher.rb', line 221

def to_s
  to_hash.to_s
end