Class: LinodeOpenapiClient::PutAccountRequest
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::PutAccountRequest
- Defined in:
- lib/linode_openapi_client/models/put_account_request.rb
Overview
Account object.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#active_promotions ⇒ Object
Returns the value of attribute active_promotions.
-
#active_since ⇒ Object
Read-only The date and time the account was activated.
-
#address_1 ⇒ Object
First line of this Account’s billing address.
-
#address_2 ⇒ Object
Second line of this Account’s billing address.
-
#balance ⇒ Object
Read-only This Account’s balance, in US dollars.
-
#balance_uninvoiced ⇒ Object
Read-only This Account’s current estimated invoice in US dollars.
-
#billing_source ⇒ Object
Read-only The source of service charges for this Account, as determined by its relationship with Akamai.
-
#capabilities ⇒ Object
Read-only A list of capabilities your account supports.
-
#city ⇒ Object
The city for this Account’s billing address.
-
#company ⇒ Object
The company name associated with this Account.
-
#country ⇒ Object
The two-letter ISO 3166 country code of this Account’s billing address.
-
#credit_card ⇒ Object
Returns the value of attribute credit_card.
-
#email ⇒ Object
The email address of the person associated with this Account.
-
#euuid ⇒ Object
Read-only An external unique identifier for this account.
-
#first_name ⇒ Object
The first name of the person associated with this Account.
-
#last_name ⇒ Object
The last name of the person associated with this Account.
-
#phone ⇒ Object
The phone number associated with this Account.
-
#state ⇒ Object
If billing address is in the United States (US) or Canada (CA), only the two-letter ISO 3166 State or Province code are accepted.
-
#tax_id ⇒ Object
The tax identification number associated with this Account, for tax calculations in some countries.
-
#zip ⇒ Object
The zip code of this Account’s billing address.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PutAccountRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PutAccountRequest
Initializes the object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 164 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::PutAccountRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `LinodeOpenapiClient::PutAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'credit_card') self.credit_card = attributes[:'credit_card'] end if attributes.key?(:'active_since') self.active_since = attributes[:'active_since'] end if attributes.key?(:'balance') self.balance = attributes[:'balance'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.key?(:'zip') self.zip = attributes[:'zip'] end if attributes.key?(:'address_2') self.address_2 = attributes[:'address_2'] end if attributes.key?(:'capabilities') if (value = attributes[:'capabilities']).is_a?(Array) self.capabilities = value end end if attributes.key?(:'company') self.company = attributes[:'company'] end if attributes.key?(:'active_promotions') if (value = attributes[:'active_promotions']).is_a?(Array) self.active_promotions = value end end if attributes.key?(:'phone') self.phone = attributes[:'phone'] end if attributes.key?(:'tax_id') self.tax_id = attributes[:'tax_id'] end if attributes.key?(:'balance_uninvoiced') self.balance_uninvoiced = attributes[:'balance_uninvoiced'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'billing_source') self.billing_source = attributes[:'billing_source'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.key?(:'euuid') self.euuid = attributes[:'euuid'] end if attributes.key?(:'address_1') self.address_1 = attributes[:'address_1'] end end |
Instance Attribute Details
#active_promotions ⇒ Object
Returns the value of attribute active_promotions.
48 49 50 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 48 def active_promotions @active_promotions end |
#active_since ⇒ Object
Read-only The date and time the account was activated.
22 23 24 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 22 def active_since @active_since end |
#address_1 ⇒ Object
First line of this Account’s billing address.
75 76 77 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 75 def address_1 @address_1 end |
#address_2 ⇒ Object
Second line of this Account’s billing address.
40 41 42 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 40 def address_2 @address_2 end |
#balance ⇒ Object
Read-only This Account’s balance, in US dollars.
25 26 27 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 25 def balance @balance end |
#balance_uninvoiced ⇒ Object
Read-only This Account’s current estimated invoice in US dollars. This is not your final invoice balance. Transfer charges are not included in the estimate.
57 58 59 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 57 def balance_uninvoiced @balance_uninvoiced end |
#billing_source ⇒ Object
Read-only The source of service charges for this Account, as determined by its relationship with Akamai. Accounts that are associated with Akamai-specific customers return a value of ‘akamai`. All other Accounts return a value of `linode`.
63 64 65 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 63 def billing_source @billing_source end |
#capabilities ⇒ Object
Read-only A list of capabilities your account supports.
43 44 45 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 43 def capabilities @capabilities end |
#city ⇒ Object
The city for this Account’s billing address.
28 29 30 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 28 def city @city end |
#company ⇒ Object
The company name associated with this Account. Must not include any of the following characters: ‘<` `>` `(` `)` `"` `=`
46 47 48 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 46 def company @company end |
#country ⇒ Object
The two-letter ISO 3166 country code of this Account’s billing address.
66 67 68 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 66 def country @country end |
#credit_card ⇒ Object
Returns the value of attribute credit_card.
19 20 21 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 19 def credit_card @credit_card end |
#email ⇒ Object
The email address of the person associated with this Account.
60 61 62 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 60 def email @email end |
#euuid ⇒ Object
Read-only An external unique identifier for this account.
72 73 74 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 72 def euuid @euuid end |
#first_name ⇒ Object
The first name of the person associated with this Account. Must not include any of the following characters: ‘<` `>` `(` `)` `"` `=`
34 35 36 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 34 def first_name @first_name end |
#last_name ⇒ Object
The last name of the person associated with this Account. Must not include any of the following characters: ‘<` `>` `(` `)` `"` `=`
69 70 71 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 69 def last_name @last_name end |
#phone ⇒ Object
The phone number associated with this Account.
51 52 53 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 51 def phone @phone end |
#state ⇒ Object
If billing address is in the United States (US) or Canada (CA), only the two-letter ISO 3166 State or Province code are accepted. If entering a US military address, state abbreviations (AA, AE, AP) should be entered. If the address is outside the US or CA, this is the Province associated with the Account’s billing address.
31 32 33 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 31 def state @state end |
#tax_id ⇒ Object
The tax identification number associated with this Account, for tax calculations in some countries. If you do not live in a country that collects tax, this should be an empty string (‘""`).
54 55 56 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 54 def tax_id @tax_id end |
#zip ⇒ Object
The zip code of this Account’s billing address. The following restrictions apply: - Can only contain ASCII letters, numbers, and hyphens (‘-`). - Must not contain more than 9 letter or number characters.
37 38 39 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 37 def zip @zip end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 545 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = LinodeOpenapiClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
126 127 128 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 126 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 100 def self.attribute_map { :'credit_card' => :'credit_card', :'active_since' => :'active_since', :'balance' => :'balance', :'city' => :'city', :'state' => :'state', :'first_name' => :'first_name', :'zip' => :'zip', :'address_2' => :'address_2', :'capabilities' => :'capabilities', :'company' => :'company', :'active_promotions' => :'active_promotions', :'phone' => :'phone', :'tax_id' => :'tax_id', :'balance_uninvoiced' => :'balance_uninvoiced', :'email' => :'email', :'billing_source' => :'billing_source', :'country' => :'country', :'last_name' => :'last_name', :'euuid' => :'euuid', :'address_1' => :'address_1' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 521 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
157 158 159 160 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 157 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 131 def self.openapi_types { :'credit_card' => :'PutAccountRequestCreditCard', :'active_since' => :'Time', :'balance' => :'Float', :'city' => :'String', :'state' => :'String', :'first_name' => :'String', :'zip' => :'String', :'address_2' => :'String', :'capabilities' => :'Array<String>', :'company' => :'String', :'active_promotions' => :'Array<PutAccountRequestActivePromotionsInner>', :'phone' => :'String', :'tax_id' => :'String', :'balance_uninvoiced' => :'Float', :'email' => :'String', :'billing_source' => :'String', :'country' => :'String', :'last_name' => :'String', :'euuid' => :'String', :'address_1' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 481 def ==(o) return true if self.equal?(o) self.class == o.class && credit_card == o.credit_card && active_since == o.active_since && balance == o.balance && city == o.city && state == o.state && first_name == o.first_name && zip == o.zip && address_2 == o.address_2 && capabilities == o.capabilities && company == o.company && active_promotions == o.active_promotions && phone == o.phone && tax_id == o.tax_id && balance_uninvoiced == o.balance_uninvoiced && email == o.email && billing_source == o.billing_source && country == o.country && last_name == o.last_name && euuid == o.euuid && address_1 == o.address_1 end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
616 617 618 619 620 621 622 623 624 625 626 627 628 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 616 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
508 509 510 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 508 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
514 515 516 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 514 def hash [credit_card, active_since, balance, city, state, first_name, zip, address_2, capabilities, company, active_promotions, phone, tax_id, balance_uninvoiced, email, billing_source, country, last_name, euuid, address_1].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 264 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@city.nil? && @city.to_s.length > 24 invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 24.') end if !@state.nil? && @state.to_s.length > 24 invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 24.') end if !@first_name.nil? && @first_name.to_s.length > 50 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 50.') end if !@address_2.nil? && @address_2.to_s.length > 64 invalid_properties.push('invalid value for "address_2", the character length must be smaller than or equal to 64.') end if !@company.nil? && @company.to_s.length > 128 invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 128.') end if !@phone.nil? && @phone.to_s.length > 32 invalid_properties.push('invalid value for "phone", the character length must be smaller than or equal to 32.') end if !@tax_id.nil? && @tax_id.to_s.length > 25 invalid_properties.push('invalid value for "tax_id", the character length must be smaller than or equal to 25.') end if !@email.nil? && @email.to_s.length > 128 invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 128.') end if !@last_name.nil? && @last_name.to_s.length > 50 invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 50.') end if !@address_1.nil? && @address_1.to_s.length > 64 invalid_properties.push('invalid value for "address_1", the character length must be smaller than or equal to 64.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
592 593 594 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 592 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
598 599 600 601 602 603 604 605 606 607 608 609 610 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 598 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 |
#to_s ⇒ String
Returns the string representation of the object
586 587 588 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 586 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/linode_openapi_client/models/put_account_request.rb', line 312 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@city.nil? && @city.to_s.length > 24 return false if !@state.nil? && @state.to_s.length > 24 return false if !@first_name.nil? && @first_name.to_s.length > 50 return false if !@address_2.nil? && @address_2.to_s.length > 64 return false if !@company.nil? && @company.to_s.length > 128 return false if !@phone.nil? && @phone.to_s.length > 32 return false if !@tax_id.nil? && @tax_id.to_s.length > 25 return false if !@email.nil? && @email.to_s.length > 128 billing_source_validator = EnumAttributeValidator.new('String', ["akamai", "linode"]) return false unless billing_source_validator.valid?(@billing_source) return false if !@last_name.nil? && @last_name.to_s.length > 50 return false if !@address_1.nil? && @address_1.to_s.length > 64 true end |