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
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.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.
33 34 35 |
# File 'lib/oci/marketplace/models/publisher.rb', line 33 def contact_email @contact_email end |
#contact_phone ⇒ String
The phone number of the publisher.
37 38 39 |
# File 'lib/oci/marketplace/models/publisher.rb', line 37 def contact_phone @contact_phone end |
#description ⇒ String
A description of the publisher.
21 22 23 |
# File 'lib/oci/marketplace/models/publisher.rb', line 21 def description @description end |
#hq_address ⇒ String
The address of the publisher's headquarters.
41 42 43 |
# File 'lib/oci/marketplace/models/publisher.rb', line 41 def hq_address @hq_address end |
#id ⇒ String
Unique identifier for the publisher.
13 14 15 |
# File 'lib/oci/marketplace/models/publisher.rb', line 13 def id @id end |
#links ⇒ Array<OCI::Marketplace::Models::Link>
Reference links.
48 49 50 |
# File 'lib/oci/marketplace/models/publisher.rb', line 48 def links @links end |
#logo ⇒ OCI::Marketplace::Models::UploadData
44 45 46 |
# File 'lib/oci/marketplace/models/publisher.rb', line 44 def logo @logo end |
#name ⇒ String
The name of the publisher.
17 18 19 |
# File 'lib/oci/marketplace/models/publisher.rb', line 17 def name @name end |
#website_url ⇒ String
The publisher's website.
29 30 31 |
# File 'lib/oci/marketplace/models/publisher.rb', line 29 def website_url @website_url end |
#year_founded ⇒ Integer
The year the publisher's company or organization was founded.
25 26 27 |
# File 'lib/oci/marketplace/models/publisher.rb', line 25 def year_founded @year_founded end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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 && logo == other.logo && links == other.links end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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
175 176 177 |
# File 'lib/oci/marketplace/models/publisher.rb', line 175 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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, logo, links].hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
222 223 224 |
# File 'lib/oci/marketplace/models/publisher.rb', line 222 def to_s to_hash.to_s end |