Class: OCI::Marketplace::Models::Publisher
- Inherits:
-
Object
- Object
- OCI::Marketplace::Models::Publisher
- Defined in:
- lib/oci/marketplace/models/publisher.rb
Overview
The model for a publisher.
Instance Attribute Summary collapse
-
#contact_email ⇒ String
The email address of the publisher.
-
#contact_phone ⇒ String
The phone number of the publisher.
-
#description ⇒ String
A description of the publisher.
-
#hq_address ⇒ String
The address of the publisher's headquarters.
-
#id ⇒ String
Unique identifier for the publisher.
-
#links ⇒ Array<OCI::Marketplace::Models::Link>
Reference links.
- #logo ⇒ OCI::Marketplace::Models::UploadData
-
#name ⇒ String
The name of the publisher.
-
#website_url ⇒ String
The publisher's website.
-
#year_founded ⇒ Integer
The year the publisher's company or organization was founded.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Publisher
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ Publisher
Initializes the object
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.logo = attributes[:'logo'] if attributes[:'logo'] self.links = attributes[:'links'] if attributes[:'links'] end |
Instance Attribute Details
#contact_email ⇒ String
The email address of the publisher.
32 33 34 |
# File 'lib/oci/marketplace/models/publisher.rb', line 32 def contact_email @contact_email end |
#contact_phone ⇒ String
The phone number of the publisher.
36 37 38 |
# File 'lib/oci/marketplace/models/publisher.rb', line 36 def contact_phone @contact_phone end |
#description ⇒ String
A description of the publisher.
20 21 22 |
# File 'lib/oci/marketplace/models/publisher.rb', line 20 def description @description end |
#hq_address ⇒ String
The address of the publisher's headquarters.
40 41 42 |
# File 'lib/oci/marketplace/models/publisher.rb', line 40 def hq_address @hq_address end |
#id ⇒ String
Unique identifier for the publisher.
12 13 14 |
# File 'lib/oci/marketplace/models/publisher.rb', line 12 def id @id end |
#links ⇒ Array<OCI::Marketplace::Models::Link>
Reference links.
47 48 49 |
# File 'lib/oci/marketplace/models/publisher.rb', line 47 def links @links end |
#logo ⇒ OCI::Marketplace::Models::UploadData
43 44 45 |
# File 'lib/oci/marketplace/models/publisher.rb', line 43 def logo @logo end |
#name ⇒ String
The name of the publisher.
16 17 18 |
# File 'lib/oci/marketplace/models/publisher.rb', line 16 def name @name end |
#website_url ⇒ String
The publisher's website.
28 29 30 |
# File 'lib/oci/marketplace/models/publisher.rb', line 28 def website_url @website_url end |
#year_founded ⇒ Integer
The year the publisher's company or organization was founded.
24 25 26 |
# File 'lib/oci/marketplace/models/publisher.rb', line 24 def year_founded @year_founded end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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 && logo == other.logo && links == other.links end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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
174 175 176 |
# File 'lib/oci/marketplace/models/publisher.rb', line 174 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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, logo, links].hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
221 222 223 |
# File 'lib/oci/marketplace/models/publisher.rb', line 221 def to_s to_hash.to_s end |