Class: ApiReference::MarkAsPaidRequestParams

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/mark_as_paid_request_params.rb

Overview

MarkAsPaidRequestParams Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(payment_received_date:, external_id: SKIP, notes: SKIP) ⇒ MarkAsPaidRequestParams

Returns a new instance of MarkAsPaidRequestParams.



49
50
51
52
53
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 49

def initialize(payment_received_date:, external_id: SKIP, notes: SKIP)
  @payment_received_date = payment_received_date
  @external_id = external_id unless external_id == SKIP
  @notes = notes unless notes == SKIP
end

Instance Attribute Details

#external_idString

An optional external ID to associate with the payment.

Returns:

  • (String)


18
19
20
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 18

def external_id
  @external_id
end

#notesString

An optional note to associate with the payment.

Returns:

  • (String)


22
23
24
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 22

def notes
  @notes
end

#payment_received_dateDate

A date string to specify the date of the payment.

Returns:

  • (Date)


14
15
16
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 14

def payment_received_date
  @payment_received_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_received_date =
    hash.key?('payment_received_date') ? hash['payment_received_date'] : nil
  external_id = hash.key?('external_id') ? hash['external_id'] : SKIP
  notes = hash.key?('notes') ? hash['notes'] : SKIP

  # Create object from extracted values.
  MarkAsPaidRequestParams.new(payment_received_date: payment_received_date,
                              external_id: external_id,
                              notes: notes)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_received_date'] = 'payment_received_date'
  @_hash['external_id'] = 'external_id'
  @_hash['notes'] = 'notes'
  @_hash
end

.nullablesObject

An array for nullable fields



42
43
44
45
46
47
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 42

def self.nullables
  %w[
    external_id
    notes
  ]
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 34

def self.optionals
  %w[
    external_id
    notes
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



79
80
81
82
83
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 79

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_received_date: #{@payment_received_date.inspect}, external_id:"\
  " #{@external_id.inspect}, notes: #{@notes.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



72
73
74
75
76
# File 'lib/api_reference/models/mark_as_paid_request_params.rb', line 72

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_received_date: #{@payment_received_date}, external_id:"\
  " #{@external_id}, notes: #{@notes}>"
end