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):



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
147
# File 'lib/oci/marketplace/models/publisher.rb', line 102

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)


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

def contact_email
  @contact_email
end

#contact_phoneString

The phone number of the publisher.

Returns:

  • (String)


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

def contact_phone
  @contact_phone
end

#descriptionString

A description of the publisher.

Returns:

  • (String)


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

def description
  @description
end

#hq_addressString

The address of the publisher's headquarters.

Returns:

  • (String)


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

def hq_address
  @hq_address
end

#idString

Unique identifier for the publisher.

Returns:

  • (String)


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

def id
  @id
end

Reference links.

Returns:



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

def links
  @links
end

#logoOCI::Marketplace::Models::UploadData



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

def 
  @logo
end

#nameString

The name of the publisher.

Returns:

  • (String)


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

def name
  @name
end

#website_urlString

The publisher's website.

Returns:

  • (String)


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

def website_url
  @website_url
end

#year_foundedInteger

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

Returns:

  • (Integer)


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

def year_founded
  @year_founded
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end