Class: ShellCardManagementApIs::ScheduleCardBlockRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::ScheduleCardBlockRequest
- Defined in:
- lib/shell_card_management_ap_is/models/schedule_card_block_request.rb
Overview
ScheduleCardBlockRequest Model.
Instance Attribute Summary collapse
-
#is_time_supported ⇒ TrueClass | FalseClass
Default: False True – It supports both date & time.
-
#schedule_card_block_cards ⇒ Array[ScheduleCardBlockCardsItems]
List of ScheduleCardBlockCard entity.
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(is_time_supported = SKIP, schedule_card_block_cards = SKIP) ⇒ ScheduleCardBlockRequest
constructor
A new instance of ScheduleCardBlockRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(is_time_supported = SKIP, schedule_card_block_cards = SKIP) ⇒ ScheduleCardBlockRequest
Returns a new instance of ScheduleCardBlockRequest.
45 46 47 48 49 50 51 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 45 def initialize(is_time_supported = SKIP, schedule_card_block_cards = SKIP) @is_time_supported = is_time_supported unless is_time_supported == SKIP unless schedule_card_block_cards == SKIP @schedule_card_block_cards = schedule_card_block_cards end end |
Instance Attribute Details
#is_time_supported ⇒ TrueClass | FalseClass
Default: False True – It supports both date & time. False – It supports only date. Time will be ignored if it is provided in the request.
17 18 19 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 17 def is_time_supported @is_time_supported end |
#schedule_card_block_cards ⇒ Array[ScheduleCardBlockCardsItems]
List of ScheduleCardBlockCard entity. Each card in the list will be scheduled for Block or Unblock. The details of the entity are given below.
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 22 def schedule_card_block_cards @schedule_card_block_cards end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. is_time_supported = hash.key?('IsTimeSupported') ? hash['IsTimeSupported'] : SKIP # Parameter is an array, so we need to iterate through it schedule_card_block_cards = nil unless hash['ScheduleCardBlockCards'].nil? schedule_card_block_cards = [] hash['ScheduleCardBlockCards'].each do |structure| schedule_card_block_cards << (ScheduleCardBlockCardsItems.from_hash(structure) if structure) end end schedule_card_block_cards = SKIP unless hash.key?('ScheduleCardBlockCards') # Create object from extracted values. ScheduleCardBlockRequest.new(is_time_supported, schedule_card_block_cards) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['is_time_supported'] = 'IsTimeSupported' @_hash['schedule_card_block_cards'] = 'ScheduleCardBlockCards' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/shell_card_management_ap_is/models/schedule_card_block_request.rb', line 33 def self.optionals %w[ is_time_supported schedule_card_block_cards ] end |