Class: ShellDataReportingApIs::CartTypeAccount
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::CartTypeAccount
- Defined in:
- lib/shell_data_reporting_ap_is/models/cart_type_account.rb
Overview
CartTypeAccount Model.
Instance Attribute Summary collapse
-
#account_id ⇒ Integer
Account Id of the customer.
-
#account_number ⇒ String
Account Number of the customer.
-
#customer_card_type_id ⇒ Integer
Customer Card Type Id in Cards Platform.
-
#day_time_restrictions ⇒ CardDayTimeRestrictions
Default Purchase category of the card type.
-
#default_purchase_category_id ⇒ Integer
Default Purchase category of the card type.
-
#emboss_account_name ⇒ String
Default Name to be embossed on the card.
-
#is_default ⇒ TrueClass | FalseClass
Whether card type is default or not.
-
#is_visible_to_customers ⇒ TrueClass | FalseClass
True/False – Whether the card type can be used for card ordering.
-
#usage_restrictions ⇒ CardUsageRestrictions
Default Purchase category of the card type.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account_id = SKIP, account_number = SKIP, is_default = SKIP, customer_card_type_id = SKIP, is_visible_to_customers = SKIP, emboss_account_name = SKIP, default_purchase_category_id = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP) ⇒ CartTypeAccount
constructor
A new instance of CartTypeAccount.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_id = SKIP, account_number = SKIP, is_default = SKIP, customer_card_type_id = SKIP, is_visible_to_customers = SKIP, emboss_account_name = SKIP, default_purchase_category_id = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP) ⇒ CartTypeAccount
Returns a new instance of CartTypeAccount.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 87 def initialize(account_id = SKIP, account_number = SKIP, is_default = SKIP, customer_card_type_id = SKIP, is_visible_to_customers = SKIP, emboss_account_name = SKIP, default_purchase_category_id = SKIP, usage_restrictions = SKIP, day_time_restrictions = SKIP) @account_id = account_id unless account_id == SKIP @account_number = account_number unless account_number == SKIP @is_default = is_default unless is_default == SKIP @customer_card_type_id = customer_card_type_id unless customer_card_type_id == SKIP @is_visible_to_customers = is_visible_to_customers unless is_visible_to_customers == SKIP @emboss_account_name = emboss_account_name unless emboss_account_name == SKIP unless default_purchase_category_id == SKIP @default_purchase_category_id = default_purchase_category_id end @usage_restrictions = usage_restrictions unless usage_restrictions == SKIP @day_time_restrictions = day_time_restrictions unless day_time_restrictions == SKIP end |
Instance Attribute Details
#account_id ⇒ Integer
Account Id of the customer.
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 14 def account_id @account_id end |
#account_number ⇒ String
Account Number of the customer.
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 18 def account_number @account_number end |
#customer_card_type_id ⇒ Integer
Customer Card Type Id in Cards Platform.
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 26 def customer_card_type_id @customer_card_type_id end |
#day_time_restrictions ⇒ CardDayTimeRestrictions
Default Purchase category of the card type.
48 49 50 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 48 def day_time_restrictions @day_time_restrictions end |
#default_purchase_category_id ⇒ Integer
Default Purchase category of the card type.
40 41 42 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 40 def default_purchase_category_id @default_purchase_category_id end |
#emboss_account_name ⇒ String
Default Name to be embossed on the card.
36 37 38 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 36 def emboss_account_name @emboss_account_name end |
#is_default ⇒ TrueClass | FalseClass
Whether card type is default or not.
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 22 def is_default @is_default end |
#is_visible_to_customers ⇒ TrueClass | FalseClass
True/False – Whether the card type can be used for card ordering.
Note - IsVisibleToCustomers will be set as ‘false’ when the card type is not active or. configured in MS to be not visible.
32 33 34 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 32 def is_visible_to_customers @is_visible_to_customers end |
#usage_restrictions ⇒ CardUsageRestrictions
Default Purchase category of the card type.
44 45 46 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 44 def usage_restrictions @usage_restrictions end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 107 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('AccountId') ? hash['AccountId'] : SKIP account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP is_default = hash.key?('IsDefault') ? hash['IsDefault'] : SKIP customer_card_type_id = hash.key?('CustomerCardTypeId') ? hash['CustomerCardTypeId'] : SKIP is_visible_to_customers = hash.key?('IsVisibleToCustomers') ? hash['IsVisibleToCustomers'] : SKIP emboss_account_name = hash.key?('EmbossAccountName') ? hash['EmbossAccountName'] : SKIP default_purchase_category_id = hash.key?('DefaultPurchaseCategoryId') ? hash['DefaultPurchaseCategoryId'] : SKIP usage_restrictions = CardUsageRestrictions.from_hash(hash['UsageRestrictions']) if hash['UsageRestrictions'] day_time_restrictions = CardDayTimeRestrictions.from_hash(hash['DayTimeRestrictions']) if hash['DayTimeRestrictions'] # Create object from extracted values. CartTypeAccount.new(account_id, account_number, is_default, customer_card_type_id, is_visible_to_customers, emboss_account_name, default_purchase_category_id, usage_restrictions, day_time_restrictions) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'AccountId' @_hash['account_number'] = 'AccountNumber' @_hash['is_default'] = 'IsDefault' @_hash['customer_card_type_id'] = 'CustomerCardTypeId' @_hash['is_visible_to_customers'] = 'IsVisibleToCustomers' @_hash['emboss_account_name'] = 'EmbossAccountName' @_hash['default_purchase_category_id'] = 'DefaultPurchaseCategoryId' @_hash['usage_restrictions'] = 'UsageRestrictions' @_hash['day_time_restrictions'] = 'DayTimeRestrictions' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 84 85 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 81 def self.nullables %w[ account_id ] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 66 def self.optionals %w[ account_id account_number is_default customer_card_type_id is_visible_to_customers emboss_account_name default_purchase_category_id usage_restrictions day_time_restrictions ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
150 151 152 153 154 155 156 157 158 159 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 150 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, account_number:"\ " #{@account_number.inspect}, is_default: #{@is_default.inspect}, customer_card_type_id:"\ " #{@customer_card_type_id.inspect}, is_visible_to_customers:"\ " #{@is_visible_to_customers.inspect}, emboss_account_name: #{@emboss_account_name.inspect},"\ " default_purchase_category_id: #{@default_purchase_category_id.inspect},"\ " usage_restrictions: #{@usage_restrictions.inspect}, day_time_restrictions:"\ " #{@day_time_restrictions.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
140 141 142 143 144 145 146 147 |
# File 'lib/shell_data_reporting_ap_is/models/cart_type_account.rb', line 140 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, account_number: #{@account_number}, is_default:"\ " #{@is_default}, customer_card_type_id: #{@customer_card_type_id}, is_visible_to_customers:"\ " #{@is_visible_to_customers}, emboss_account_name: #{@emboss_account_name},"\ " default_purchase_category_id: #{@default_purchase_category_id}, usage_restrictions:"\ " #{@usage_restrictions}, day_time_restrictions: #{@day_time_restrictions}>" end |