Class: Ifeelgoods::ClientSummary
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Ifeelgoods::ClientSummary
- Defined in:
- lib/ifeelgoods/models/client_summary.rb
Overview
A Client represents a customer account that will be either retrieving or delivering Rewards to end users.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#balance ⇒ Object
Advertiser remaining budget.
-
#balance_currency ⇒ Object
Advertiser remaining budget currency.
-
#billing_location ⇒ Object
Returns the value of attribute billing_location.
-
#budget_alerts ⇒ Object
Returns the value of attribute budget_alerts.
-
#contact_email ⇒ Object
Returns the value of attribute contact_email.
-
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
-
#id ⇒ Object
Returns the value of attribute id.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#logo_url ⇒ Object
Returns the value of attribute logo_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#ui_id ⇒ Object
Returns the value of attribute ui_id.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ClientSummary
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ClientSummary
Initializes the object
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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 125 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Ifeelgoods::ClientSummary` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Ifeelgoods::ClientSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'ui_id') self.ui_id = attributes[:'ui_id'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'billing_location') self.billing_location = attributes[:'billing_location'] end if attributes.key?(:'contact_email') self.contact_email = attributes[:'contact_email'] end if attributes.key?(:'contact_phone') self.contact_phone = attributes[:'contact_phone'] end if attributes.key?(:'locale') self.locale = attributes[:'locale'] end if attributes.key?(:'logo_url') self.logo_url = attributes[:'logo_url'] end if attributes.key?(:'balance') self.balance = attributes[:'balance'] end if attributes.key?(:'balance_currency') self.balance_currency = attributes[:'balance_currency'] end if attributes.key?(:'budget_alerts') self.budget_alerts = attributes[:'budget_alerts'] end end |
Instance Attribute Details
#balance ⇒ Object
Advertiser remaining budget
38 39 40 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 38 def balance @balance end |
#balance_currency ⇒ Object
Advertiser remaining budget currency
41 42 43 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 41 def balance_currency @balance_currency end |
#billing_location ⇒ Object
Returns the value of attribute billing_location.
27 28 29 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 27 def billing_location @billing_location end |
#budget_alerts ⇒ Object
Returns the value of attribute budget_alerts.
43 44 45 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 43 def budget_alerts @budget_alerts end |
#contact_email ⇒ Object
Returns the value of attribute contact_email.
29 30 31 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 29 def contact_email @contact_email end |
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
31 32 33 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 31 def contact_phone @contact_phone end |
#id ⇒ Object
Returns the value of attribute id.
19 20 21 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 19 def id @id end |
#locale ⇒ Object
Returns the value of attribute locale.
33 34 35 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 33 def locale @locale end |
#logo_url ⇒ Object
Returns the value of attribute logo_url.
35 36 37 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 35 def logo_url @logo_url end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 21 def name @name end |
#status ⇒ Object
Returns the value of attribute status.
25 26 27 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 25 def status @status end |
#ui_id ⇒ Object
Returns the value of attribute ui_id.
23 24 25 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 23 def ui_id @ui_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
86 87 88 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 86 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
91 92 93 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 91 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 68 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'ui_id' => :'ui_id', :'status' => :'status', :'billing_location' => :'billing_location', :'contact_email' => :'contact_email', :'contact_phone' => :'contact_phone', :'locale' => :'locale', :'logo_url' => :'logo_url', :'balance' => :'balance', :'balance_currency' => :'balance_currency', :'budget_alerts' => :'budget_alerts' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 249 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
114 115 116 117 118 119 120 121 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 114 def self.openapi_nullable Set.new([ :'contact_email', :'contact_phone', :'logo_url', :'budget_alerts' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 96 def self.openapi_types { :'id' => :'Integer', :'name' => :'String', :'ui_id' => :'String', :'status' => :'String', :'billing_location' => :'String', :'contact_email' => :'String', :'contact_phone' => :'String', :'locale' => :'String', :'logo_url' => :'String', :'balance' => :'String', :'balance_currency' => :'String', :'budget_alerts' => :'ClientSummaryBudgetAlerts' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 217 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && ui_id == o.ui_id && status == o.status && billing_location == o.billing_location && contact_email == o.contact_email && contact_phone == o.contact_phone && locale == o.locale && logo_url == o.logo_url && balance == o.balance && balance_currency == o.balance_currency && budget_alerts == o.budget_alerts end |
#eql?(o) ⇒ Boolean
236 237 238 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 236 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
242 243 244 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 242 def hash [id, name, ui_id, status, billing_location, contact_email, contact_phone, locale, logo_url, balance, balance_currency, budget_alerts].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
190 191 192 193 194 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 190 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 271 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
198 199 200 201 202 203 |
# File 'lib/ifeelgoods/models/client_summary.rb', line 198 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' status_validator = EnumAttributeValidator.new('String', ["enabled", "disabled"]) return false unless status_validator.valid?(@status) true end |