Class: TripletexRubyClient::TripletexAccount2
- Inherits:
-
Object
- Object
- TripletexRubyClient::TripletexAccount2
- Defined in:
- lib/tripletex_ruby_client/models/tripletex_account2.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_type ⇒ Object
Is this a test account or a paying account?.
-
#accounting_office ⇒ Object
Returns the value of attribute accounting_office.
-
#administrator ⇒ Object
Employee to create.
-
#administrator_password ⇒ Object
Password for the administrator user to create.
-
#auditor ⇒ Object
Returns the value of attribute auditor.
-
#auto_validate_user_login ⇒ Object
If true, the users created will be allowed to log in without validating their email address.
-
#bank_account ⇒ Object
Main bank account.
-
#chart_of_accounts_type ⇒ Object
The chart of accounts to use for the new company.
-
#company ⇒ Object
Information about the company to create.
-
#create_administrator_api_token ⇒ Object
Create an API token for the administrator user for the consumer token used during this call.
-
#create_company_owned_api_token ⇒ Object
Create an API token for the company to use to call their clients, only possible for accounting and auditor accounts.
-
#customer_category_id2 ⇒ Object
Customer category id used to indicate that the customer is created by Salesforce.
-
#invoice_start_date ⇒ Object
Start date for invoicing.
-
#marketing_consent ⇒ Object
Marketing consent.
-
#may_create_tripletex_accounts ⇒ Object
Should the company we are creating be able to create new Tripletex accounts?.
-
#modules ⇒ Object
Sales modules (functionality in the application) to activate for the newly created account.
-
#number_of_prepaid_users ⇒ Object
Number of users Prepaid.
-
#number_of_vouchers ⇒ Object
Used to calculate prices.
-
#post_account ⇒ Object
Swedish post account number (PlusGirot).
-
#reseller ⇒ Object
Returns the value of attribute reseller.
-
#send_emails ⇒ Object
Should the regular creation emails be sent to the company created and its users? If false you probably want to set autoValidateUserLogin to true.
-
#vat_status_type ⇒ Object
VAT type.
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
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ TripletexAccount2
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 = {}) ⇒ TripletexAccount2
Initializes the object
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 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 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 158 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 } if attributes.has_key?(:'company') self.company = attributes[:'company'] end if attributes.has_key?(:'administrator') self.administrator = attributes[:'administrator'] end if attributes.has_key?(:'accountType') self.account_type = attributes[:'accountType'] end if attributes.has_key?(:'modules') if (value = attributes[:'modules']).is_a?(Array) self.modules = value end end if attributes.has_key?(:'administratorPassword') self.administrator_password = attributes[:'administratorPassword'] end if attributes.has_key?(:'sendEmails') self.send_emails = attributes[:'sendEmails'] end if attributes.has_key?(:'autoValidateUserLogin') self.auto_validate_user_login = attributes[:'autoValidateUserLogin'] end if attributes.has_key?(:'createAdministratorApiToken') self.create_administrator_api_token = attributes[:'createAdministratorApiToken'] end if attributes.has_key?(:'createCompanyOwnedApiToken') self.create_company_owned_api_token = attributes[:'createCompanyOwnedApiToken'] end if attributes.has_key?(:'mayCreateTripletexAccounts') self.may_create_tripletex_accounts = attributes[:'mayCreateTripletexAccounts'] end if attributes.has_key?(:'numberOfVouchers') self.number_of_vouchers = attributes[:'numberOfVouchers'] end if attributes.has_key?(:'chartOfAccountsType') self.chart_of_accounts_type = attributes[:'chartOfAccountsType'] end if attributes.has_key?(:'vatStatusType') self.vat_status_type = attributes[:'vatStatusType'] end if attributes.has_key?(:'bankAccount') self.bank_account = attributes[:'bankAccount'] end if attributes.has_key?(:'postAccount') self.post_account = attributes[:'postAccount'] end if attributes.has_key?(:'numberOfPrepaidUsers') self.number_of_prepaid_users = attributes[:'numberOfPrepaidUsers'] end if attributes.has_key?(:'customerCategoryId2') self.customer_category_id2 = attributes[:'customerCategoryId2'] end if attributes.has_key?(:'marketingConsent') self. = attributes[:'marketingConsent'] end if attributes.has_key?(:'invoiceStartDate') self.invoice_start_date = attributes[:'invoiceStartDate'] end if attributes.has_key?(:'accountingOffice') self.accounting_office = attributes[:'accountingOffice'] end if attributes.has_key?(:'auditor') self.auditor = attributes[:'auditor'] end if attributes.has_key?(:'reseller') self.reseller = attributes[:'reseller'] end end |
Instance Attribute Details
#account_type ⇒ Object
Is this a test account or a paying account?
22 23 24 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 22 def account_type @account_type end |
#accounting_office ⇒ Object
Returns the value of attribute accounting_office.
72 73 74 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 72 def accounting_office @accounting_office end |
#administrator ⇒ Object
Employee to create. Department on this object will also be created if supplied. If null a dummy user and department will be created instead
19 20 21 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 19 def administrator @administrator end |
#administrator_password ⇒ Object
Password for the administrator user to create. Not a part of the administrator employee object since this is a value that never can be read (it is salted and hashed before storing)
28 29 30 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 28 def administrator_password @administrator_password end |
#auditor ⇒ Object
Returns the value of attribute auditor.
74 75 76 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 74 def auditor @auditor end |
#auto_validate_user_login ⇒ Object
If true, the users created will be allowed to log in without validating their email address. ONLY USE THIS IF YOU ALREADY HAVE VALIDATED THE USER EMAILS.
34 35 36 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 34 def auto_validate_user_login @auto_validate_user_login end |
#bank_account ⇒ Object
Main bank account
55 56 57 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 55 def bank_account @bank_account end |
#chart_of_accounts_type ⇒ Object
The chart of accounts to use for the new company
49 50 51 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 49 def chart_of_accounts_type @chart_of_accounts_type end |
#company ⇒ Object
Information about the company to create. Supply as much info as you have, but at least name, type and address.
16 17 18 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 16 def company @company end |
#create_administrator_api_token ⇒ Object
Create an API token for the administrator user for the consumer token used during this call. The token will be returned in the response.
37 38 39 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 37 def create_administrator_api_token @create_administrator_api_token end |
#create_company_owned_api_token ⇒ Object
Create an API token for the company to use to call their clients, only possible for accounting and auditor accounts. The token will be returned in the response.
40 41 42 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 40 def create_company_owned_api_token @create_company_owned_api_token end |
#customer_category_id2 ⇒ Object
Customer category id used to indicate that the customer is created by Salesforce
64 65 66 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 64 def customer_category_id2 @customer_category_id2 end |
#invoice_start_date ⇒ Object
Start date for invoicing
70 71 72 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 70 def invoice_start_date @invoice_start_date end |
#marketing_consent ⇒ Object
Marketing consent
67 68 69 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 67 def @marketing_consent end |
#may_create_tripletex_accounts ⇒ Object
Should the company we are creating be able to create new Tripletex accounts?
43 44 45 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 43 def may_create_tripletex_accounts @may_create_tripletex_accounts end |
#modules ⇒ Object
Sales modules (functionality in the application) to activate for the newly created account. Some modules have extra costs.
25 26 27 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 25 def modules @modules end |
#number_of_prepaid_users ⇒ Object
Number of users Prepaid. Only available for some consumers.
61 62 63 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 61 def number_of_prepaid_users @number_of_prepaid_users end |
#number_of_vouchers ⇒ Object
Used to calculate prices.
46 47 48 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 46 def number_of_vouchers @number_of_vouchers end |
#post_account ⇒ Object
Swedish post account number (PlusGirot)
58 59 60 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 58 def post_account @post_account end |
#reseller ⇒ Object
Returns the value of attribute reseller.
76 77 78 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 76 def reseller @reseller end |
#send_emails ⇒ Object
Should the regular creation emails be sent to the company created and its users? If false you probably want to set autoValidateUserLogin to true
31 32 33 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 31 def send_emails @send_emails end |
#vat_status_type ⇒ Object
VAT type
52 53 54 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 52 def vat_status_type @vat_status_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 101 def self.attribute_map { :'company' => :'company', :'administrator' => :'administrator', :'account_type' => :'accountType', :'modules' => :'modules', :'administrator_password' => :'administratorPassword', :'send_emails' => :'sendEmails', :'auto_validate_user_login' => :'autoValidateUserLogin', :'create_administrator_api_token' => :'createAdministratorApiToken', :'create_company_owned_api_token' => :'createCompanyOwnedApiToken', :'may_create_tripletex_accounts' => :'mayCreateTripletexAccounts', :'number_of_vouchers' => :'numberOfVouchers', :'chart_of_accounts_type' => :'chartOfAccountsType', :'vat_status_type' => :'vatStatusType', :'bank_account' => :'bankAccount', :'post_account' => :'postAccount', :'number_of_prepaid_users' => :'numberOfPrepaidUsers', :'customer_category_id2' => :'customerCategoryId2', :'marketing_consent' => :'marketingConsent', :'invoice_start_date' => :'invoiceStartDate', :'accounting_office' => :'accountingOffice', :'auditor' => :'auditor', :'reseller' => :'reseller' } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 129 def self.swagger_types { :'company' => :'Company', :'administrator' => :'Employee', :'account_type' => :'String', :'modules' => :'Array<SalesModuleDTO>', :'administrator_password' => :'String', :'send_emails' => :'BOOLEAN', :'auto_validate_user_login' => :'BOOLEAN', :'create_administrator_api_token' => :'BOOLEAN', :'create_company_owned_api_token' => :'BOOLEAN', :'may_create_tripletex_accounts' => :'BOOLEAN', :'number_of_vouchers' => :'String', :'chart_of_accounts_type' => :'String', :'vat_status_type' => :'String', :'bank_account' => :'String', :'post_account' => :'String', :'number_of_prepaid_users' => :'Integer', :'customer_category_id2' => :'Integer', :'marketing_consent' => :'String', :'invoice_start_date' => :'String', :'accounting_office' => :'BOOLEAN', :'auditor' => :'BOOLEAN', :'reseller' => :'BOOLEAN' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 355 def ==(o) return true if self.equal?(o) self.class == o.class && company == o.company && administrator == o.administrator && account_type == o.account_type && modules == o.modules && administrator_password == o.administrator_password && send_emails == o.send_emails && auto_validate_user_login == o.auto_validate_user_login && create_administrator_api_token == o.create_administrator_api_token && create_company_owned_api_token == o.create_company_owned_api_token && may_create_tripletex_accounts == o.may_create_tripletex_accounts && number_of_vouchers == o.number_of_vouchers && chart_of_accounts_type == o.chart_of_accounts_type && vat_status_type == o.vat_status_type && bank_account == o.bank_account && post_account == o.post_account && number_of_prepaid_users == o.number_of_prepaid_users && customer_category_id2 == o.customer_category_id2 && == o. && invoice_start_date == o.invoice_start_date && accounting_office == o.accounting_office && auditor == o.auditor && reseller == o.reseller end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 418 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 temp_model = TripletexRubyClient.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 484 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 397 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean
384 385 386 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 384 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
390 391 392 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 390 def hash [company, administrator, account_type, modules, administrator_password, send_emails, auto_validate_user_login, create_administrator_api_token, create_company_owned_api_token, may_create_tripletex_accounts, number_of_vouchers, chart_of_accounts_type, vat_status_type, bank_account, post_account, number_of_prepaid_users, customer_category_id2, , invoice_start_date, accounting_office, auditor, reseller].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 257 def list_invalid_properties invalid_properties = Array.new if @company.nil? invalid_properties.push('invalid value for "company", company cannot be nil.') end if @account_type.nil? invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') end if @modules.nil? invalid_properties.push('invalid value for "modules", modules cannot be nil.') end if @administrator_password.nil? invalid_properties.push('invalid value for "administrator_password", administrator_password cannot be nil.') end if @number_of_vouchers.nil? invalid_properties.push('invalid value for "number_of_vouchers", number_of_vouchers cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
464 465 466 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 464 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
470 471 472 473 474 475 476 477 478 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 470 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
458 459 460 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 458 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/tripletex_ruby_client/models/tripletex_account2.rb', line 284 def valid? return false if @company.nil? return false if @account_type.nil? account_type_validator = EnumAttributeValidator.new('String', ['TEST', 'PAYING']) return false unless account_type_validator.valid?(@account_type) return false if @modules.nil? return false if @administrator_password.nil? return false if @number_of_vouchers.nil? number_of_vouchers_validator = EnumAttributeValidator.new('String', ['INTERVAL_0_100', 'INTERVAL_101_500', 'INTERVAL_0_500', 'INTERVAL_501_1000', 'INTERVAL_1001_2000', 'INTERVAL_2001_3500', 'INTERVAL_3501_5000', 'INTERVAL_5001_10000', 'INTERVAL_UNLIMITED']) return false unless number_of_vouchers_validator.valid?(@number_of_vouchers) chart_of_accounts_type_validator = EnumAttributeValidator.new('String', ['DEFAULT', 'MAMUT_STD_PAYROLL', 'MAMUT_NARF_PAYROLL', 'AGRO_FORRETNING_PAYROLL', 'AGRO_LANDBRUK_PAYROLL', 'AGRO_FISKE_PAYROLL', 'AGRO_FORSOKSRING_PAYROLL', 'AGRO_IDRETTSLAG_PAYROLL', 'AGRO_FORENING_PAYROLL']) return false unless chart_of_accounts_type_validator.valid?(@chart_of_accounts_type) vat_status_type_validator = EnumAttributeValidator.new('String', ['VAT_REGISTERED', 'VAT_NOT_REGISTERED', 'VAT_APPLICANT']) return false unless vat_status_type_validator.valid?(@vat_status_type) = EnumAttributeValidator.new('String', ['DEFAULT', 'GRANTED', 'DENIED']) return false unless .valid?(@marketing_consent) true end |