Class: WalmartApIs::PayoutStatusResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::PayoutStatusResponse
- Defined in:
- lib/walmart_ap_is/models/payout_status_response.rb
Overview
PayoutStatusResponse Model.
Instance Attribute Summary collapse
-
#amount ⇒ Money
TODO: Write general description for this method.
-
#completed_date ⇒ DateTime
TODO: Write general description for this method.
-
#scheduled_date ⇒ DateTime
TODO: Write general description for this method.
-
#status ⇒ Status11
TODO: Write general description for this method.
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(status: SKIP, amount: SKIP, scheduled_date: SKIP, completed_date: SKIP, additional_properties: nil) ⇒ PayoutStatusResponse
constructor
A new instance of PayoutStatusResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_completed_date ⇒ Object
- #to_custom_scheduled_date ⇒ Object
-
#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(status: SKIP, amount: SKIP, scheduled_date: SKIP, completed_date: SKIP, additional_properties: nil) ⇒ PayoutStatusResponse
Returns a new instance of PayoutStatusResponse.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 54 def initialize(status: SKIP, amount: SKIP, scheduled_date: SKIP, completed_date: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @status = status unless status == SKIP @amount = amount unless amount == SKIP @scheduled_date = scheduled_date unless scheduled_date == SKIP @completed_date = completed_date unless completed_date == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Money
TODO: Write general description for this method
19 20 21 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 19 def amount @amount end |
#completed_date ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 27 def completed_date @completed_date end |
#scheduled_date ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 23 def scheduled_date @scheduled_date end |
#status ⇒ Status11
TODO: Write general description for this method
15 16 17 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 15 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. status = hash.key?('status') ? hash['status'] : SKIP amount = Money.from_hash(hash['amount']) if hash['amount'] scheduled_date = if hash.key?('scheduledDate') (DateTimeHelper.from_rfc3339(hash['scheduledDate']) if hash['scheduledDate']) else SKIP end completed_date = if hash.key?('completedDate') (DateTimeHelper.from_rfc3339(hash['completedDate']) if hash['completedDate']) else SKIP end # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PayoutStatusResponse.new(status: status, amount: amount, scheduled_date: scheduled_date, completed_date: completed_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['status'] = 'status' @_hash['amount'] = 'amount' @_hash['scheduled_date'] = 'scheduledDate' @_hash['completed_date'] = 'completedDate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 40 def self.optionals %w[ status amount scheduled_date completed_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
115 116 117 118 119 120 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 115 def inspect class_name = self.class.name.split('::').last "<#{class_name} status: #{@status.inspect}, amount: #{@amount.inspect}, scheduled_date:"\ " #{@scheduled_date.inspect}, completed_date: #{@completed_date.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_completed_date ⇒ Object
103 104 105 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 103 def to_custom_completed_date DateTimeHelper.to_rfc3339(completed_date) end |
#to_custom_scheduled_date ⇒ Object
99 100 101 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 99 def to_custom_scheduled_date DateTimeHelper.to_rfc3339(scheduled_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 |
# File 'lib/walmart_ap_is/models/payout_status_response.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} status: #{@status}, amount: #{@amount}, scheduled_date: #{@scheduled_date},"\ " completed_date: #{@completed_date}, additional_properties: #{@additional_properties}>" end |