Class: Gusto::AchTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/ach_transaction.rb

Overview

Representation of an ACH transaction

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, company_uuid: OMIT, payment_event_type: OMIT, payment_event_uuid: OMIT, recipient_type: OMIT, recipient_uuid: OMIT, error_code: OMIT, transaction_type: OMIT, payment_status: OMIT, payment_direction: OMIT, payment_event_check_date: OMIT, payment_date: OMIT, amount: OMIT, description: OMIT, additional_properties: nil) ⇒ Gusto::AchTransaction

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/fern_gusto/types/ach_transaction.rb', line 74

def initialize(uuid:, company_uuid: OMIT, payment_event_type: OMIT, payment_event_uuid: OMIT, recipient_type: OMIT, recipient_uuid: OMIT, error_code: OMIT, transaction_type: OMIT, payment_status: OMIT, payment_direction: OMIT, payment_event_check_date: OMIT, payment_date: OMIT, amount: OMIT, description: OMIT, additional_properties: nil)
  @uuid = uuid
  @company_uuid = company_uuid if company_uuid != OMIT
  @payment_event_type = payment_event_type if payment_event_type != OMIT
  @payment_event_uuid = payment_event_uuid if payment_event_uuid != OMIT
  @recipient_type = recipient_type if recipient_type != OMIT
  @recipient_uuid = recipient_uuid if recipient_uuid != OMIT
  @error_code = error_code if error_code != OMIT
  @transaction_type = transaction_type if transaction_type != OMIT
  @payment_status = payment_status if payment_status != OMIT
  @payment_direction = payment_direction if payment_direction != OMIT
  @payment_event_check_date = payment_event_check_date if payment_event_check_date != OMIT
  @payment_date = payment_date if payment_date != OMIT
  @amount = amount if amount != OMIT
  @description = description if description != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "company_uuid": company_uuid, "payment_event_type": payment_event_type, "payment_event_uuid": payment_event_uuid, "recipient_type": recipient_type, "recipient_uuid": recipient_uuid, "error_code": error_code, "transaction_type": transaction_type, "payment_status": payment_status, "payment_direction": payment_direction, "payment_event_check_date": payment_event_check_date, "payment_date": payment_date, "amount": amount, "description": description }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



46
47
48
# File 'lib/fern_gusto/types/ach_transaction.rb', line 46

def additional_properties
  @additional_properties
end

#amountObject (readonly)

non-negative.



41
42
43
# File 'lib/fern_gusto/types/ach_transaction.rb', line 41

def amount
  @amount
end

#company_uuidString (readonly)

Returns Unique identifier of the company to which the ACH transaction belongs.

Returns:

  • (String)

    Unique identifier of the company to which the ACH transaction belongs



15
16
17
# File 'lib/fern_gusto/types/ach_transaction.rb', line 15

def company_uuid
  @company_uuid
end

#descriptionObject (readonly)

transaction on the recipient’s bank statement.



44
45
46
# File 'lib/fern_gusto/types/ach_transaction.rb', line 44

def description
  @description
end

#error_codeObject (readonly)

for a complete list of ACH return codes.



28
29
30
# File 'lib/fern_gusto/types/ach_transaction.rb', line 28

def error_code
  @error_code
end

#payment_dateString (readonly)

Returns The date of the payment associated with the ACH transaction.

Returns:

  • (String)

    The date of the payment associated with the ACH transaction



38
39
40
# File 'lib/fern_gusto/types/ach_transaction.rb', line 38

def payment_date
  @payment_date
end

#payment_directionGusto::AchTransactionPaymentDirection (readonly)

Returns The direction of the payment.

Returns:



34
35
36
# File 'lib/fern_gusto/types/ach_transaction.rb', line 34

def payment_direction
  @payment_direction
end

#payment_event_check_dateString (readonly)

Returns The date of the payment event check associated with the ACH transaction.

Returns:

  • (String)

    The date of the payment event check associated with the ACH transaction



36
37
38
# File 'lib/fern_gusto/types/ach_transaction.rb', line 36

def payment_event_check_date
  @payment_event_check_date
end

#payment_event_typeGusto::AchTransactionPaymentEventType (readonly)

Returns The type of payment event associated with the ACH transaction.

Returns:



17
18
19
# File 'lib/fern_gusto/types/ach_transaction.rb', line 17

def payment_event_type
  @payment_event_type
end

#payment_event_uuidString (readonly)

Returns Unique identifier for the payment event associated with the ACH transaction.

Returns:

  • (String)

    Unique identifier for the payment event associated with the ACH transaction



19
20
21
# File 'lib/fern_gusto/types/ach_transaction.rb', line 19

def payment_event_uuid
  @payment_event_uuid
end

#payment_statusGusto::AchTransactionPaymentStatus (readonly)

Returns The status of the ACH transaction.

Returns:



32
33
34
# File 'lib/fern_gusto/types/ach_transaction.rb', line 32

def payment_status
  @payment_status
end

#recipient_typeGusto::AchTransactionRecipientType (readonly)

Returns The type of recipient associated with the ACH transaction.

Returns:



21
22
23
# File 'lib/fern_gusto/types/ach_transaction.rb', line 21

def recipient_type
  @recipient_type
end

#recipient_uuidString (readonly)

Returns Unique identifier for the recipient associated with the ACH transaction.

Returns:

  • (String)

    Unique identifier for the recipient associated with the ACH transaction



23
24
25
# File 'lib/fern_gusto/types/ach_transaction.rb', line 23

def recipient_uuid
  @recipient_uuid
end

#transaction_typeString (readonly)

Returns The type of transaction associated with the ACH transaction.

Returns:

  • (String)

    The type of transaction associated with the ACH transaction



30
31
32
# File 'lib/fern_gusto/types/ach_transaction.rb', line 30

def transaction_type
  @transaction_type
end

#uuidString (readonly)

Returns Unique identifier of an ACH transaction.

Returns:

  • (String)

    Unique identifier of an ACH transaction



13
14
15
# File 'lib/fern_gusto/types/ach_transaction.rb', line 13

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::AchTransaction

Parameters:

  • json_object (String)

Returns:



98
99
100
101
102
103
104
105
106
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
# File 'lib/fern_gusto/types/ach_transaction.rb', line 98

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  company_uuid = parsed_json["company_uuid"]
  payment_event_type = parsed_json["payment_event_type"]
  payment_event_uuid = parsed_json["payment_event_uuid"]
  recipient_type = parsed_json["recipient_type"]
  recipient_uuid = parsed_json["recipient_uuid"]
  error_code = parsed_json["error_code"]
  transaction_type = parsed_json["transaction_type"]
  payment_status = parsed_json["payment_status"]
  payment_direction = parsed_json["payment_direction"]
  payment_event_check_date = parsed_json["payment_event_check_date"]
  payment_date = parsed_json["payment_date"]
  amount = parsed_json["amount"]
  description = parsed_json["description"]
  new(
    uuid: uuid,
    company_uuid: company_uuid,
    payment_event_type: payment_event_type,
    payment_event_uuid: payment_event_uuid,
    recipient_type: recipient_type,
    recipient_uuid: recipient_uuid,
    error_code: error_code,
    transaction_type: transaction_type,
    payment_status: payment_status,
    payment_direction: payment_direction,
    payment_event_check_date: payment_event_check_date,
    payment_date: payment_date,
    amount: amount,
    description: description,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/fern_gusto/types/ach_transaction.rb', line 145

def self.validate_raw(obj:)
  obj.uuid.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.company_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.")
  obj.payment_event_type&.is_a?(Gusto::AchTransactionPaymentEventType) != false || raise("Passed value for field obj.payment_event_type is not the expected type, validation failed.")
  obj.payment_event_uuid&.is_a?(String) != false || raise("Passed value for field obj.payment_event_uuid is not the expected type, validation failed.")
  obj.recipient_type&.is_a?(Gusto::AchTransactionRecipientType) != false || raise("Passed value for field obj.recipient_type is not the expected type, validation failed.")
  obj.recipient_uuid&.is_a?(String) != false || raise("Passed value for field obj.recipient_uuid is not the expected type, validation failed.")
  obj.error_code&.is_a?(String) != false || raise("Passed value for field obj.error_code is not the expected type, validation failed.")
  obj.transaction_type&.is_a?(String) != false || raise("Passed value for field obj.transaction_type is not the expected type, validation failed.")
  obj.payment_status&.is_a?(Gusto::AchTransactionPaymentStatus) != false || raise("Passed value for field obj.payment_status is not the expected type, validation failed.")
  obj.payment_direction&.is_a?(Gusto::AchTransactionPaymentDirection) != false || raise("Passed value for field obj.payment_direction is not the expected type, validation failed.")
  obj.payment_event_check_date&.is_a?(String) != false || raise("Passed value for field obj.payment_event_check_date is not the expected type, validation failed.")
  obj.payment_date&.is_a?(String) != false || raise("Passed value for field obj.payment_date is not the expected type, validation failed.")
  obj.amount&.is_a?(String) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


136
137
138
# File 'lib/fern_gusto/types/ach_transaction.rb', line 136

def to_json
  @_field_set&.to_json
end