Class: ShellDataReportingApIs::CardDayTimeRestrictions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb

Overview

CardDayTimeRestrictions Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(level = SKIP, monday = SKIP, tuesday = SKIP, wednesday = SKIP, thursday = SKIP, friday = SKIP, saturday = SKIP, sunday = SKIP, time_from = SKIP, time_to = SKIP) ⇒ CardDayTimeRestrictions

Returns a new instance of CardDayTimeRestrictions.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 108

def initialize(level = SKIP, monday = SKIP, tuesday = SKIP,
               wednesday = SKIP, thursday = SKIP, friday = SKIP,
               saturday = SKIP, sunday = SKIP, time_from = SKIP,
               time_to = SKIP)
  @level = level unless level == SKIP
  @monday = monday unless monday == SKIP
  @tuesday = tuesday unless tuesday == SKIP
  @wednesday = wednesday unless wednesday == SKIP
  @thursday = thursday unless thursday == SKIP
  @friday = friday unless friday == SKIP
  @saturday = saturday unless saturday == SKIP
  @sunday = sunday unless sunday == SKIP
  @time_from = time_from unless time_from == SKIP
  @time_to = time_to unless time_to == SKIP
end

Instance Attribute Details

#fridayTrueClass | FalseClass

Whether the transaction is allowed on Fridays or not.

Returns:

  • (TrueClass | FalseClass)


37
38
39
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 37

def friday
  @friday
end

#levelString

Describes at which level the restriction is set at. Possible values: OU = Restriction set at ColCo card type Customer = Restriction set at customer card type

Returns:

  • (String)


17
18
19
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 17

def level
  @level
end

#mondayTrueClass | FalseClass

Whether the transaction is allowed on Mondays or not.

Returns:

  • (TrueClass | FalseClass)


21
22
23
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 21

def monday
  @monday
end

#saturdayTrueClass | FalseClass

Whether the transaction is allowed on Saturdays or not.

Returns:

  • (TrueClass | FalseClass)


41
42
43
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 41

def saturday
  @saturday
end

#sundayTrueClass | FalseClass

Whether the transaction is allowed on Sundays or not.

Returns:

  • (TrueClass | FalseClass)


45
46
47
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 45

def sunday
  @sunday
end

#thursdayTrueClass | FalseClass

Whether the transaction is allowed on Thursdays or not.

Returns:

  • (TrueClass | FalseClass)


33
34
35
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 33

def thursday
  @thursday
end

#time_fromString

The time in the day from when the transaction is allowed. Format: HH:mm: ss E.g., 21:00:00 Note: 1) The client application has to convert the value to the required date-time data type. 2) The value will be 00:00:00 when no restriction set for this field.

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 55

def time_from
  @time_from
end

#time_toString

allowed. Format: HH:mm: ss E.g., 21:00:00 Note: 1) The client application has to convert the value to the required date-time data type. 2) The value will be 00:00:00 when no restriction set for this field.

Returns:

  • (String)


65
66
67
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 65

def time_to
  @time_to
end

#tuesdayTrueClass | FalseClass

Whether the transaction is allowed on Tuesdays or not.

Returns:

  • (TrueClass | FalseClass)


25
26
27
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 25

def tuesday
  @tuesday
end

#wednesdayTrueClass | FalseClass

Whether the transaction is allowed on Wednesdays or not.

Returns:

  • (TrueClass | FalseClass)


29
30
31
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 29

def wednesday
  @wednesday
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 125

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  level = hash.key?('Level') ? hash['Level'] : SKIP
  monday = hash.key?('Monday') ? hash['Monday'] : SKIP
  tuesday = hash.key?('Tuesday') ? hash['Tuesday'] : SKIP
  wednesday = hash.key?('Wednesday') ? hash['Wednesday'] : SKIP
  thursday = hash.key?('Thursday') ? hash['Thursday'] : SKIP
  friday = hash.key?('Friday') ? hash['Friday'] : SKIP
  saturday = hash.key?('Saturday') ? hash['Saturday'] : SKIP
  sunday = hash.key?('Sunday') ? hash['Sunday'] : SKIP
  time_from = hash.key?('TimeFrom') ? hash['TimeFrom'] : SKIP
  time_to = hash.key?('TimeTo') ? hash['TimeTo'] : SKIP

  # Create object from extracted values.
  CardDayTimeRestrictions.new(level,
                              monday,
                              tuesday,
                              wednesday,
                              thursday,
                              friday,
                              saturday,
                              sunday,
                              time_from,
                              time_to)
end

.namesObject

A mapping from model property names to API property names.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 68

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['level'] = 'Level'
  @_hash['monday'] = 'Monday'
  @_hash['tuesday'] = 'Tuesday'
  @_hash['wednesday'] = 'Wednesday'
  @_hash['thursday'] = 'Thursday'
  @_hash['friday'] = 'Friday'
  @_hash['saturday'] = 'Saturday'
  @_hash['sunday'] = 'Sunday'
  @_hash['time_from'] = 'TimeFrom'
  @_hash['time_to'] = 'TimeTo'
  @_hash
end

.nullablesObject

An array for nullable fields



100
101
102
103
104
105
106
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 100

def self.nullables
  %w[
    level
    time_from
    time_to
  ]
end

.optionalsObject

An array for optional fields



84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb', line 84

def self.optionals
  %w[
    level
    monday
    tuesday
    wednesday
    thursday
    friday
    saturday
    sunday
    time_from
    time_to
  ]
end