Class: Lithic::Resources::ManagementOperations

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/management_operations.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ManagementOperations

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ManagementOperations.

Parameters:



139
140
141
# File 'lib/lithic/resources/management_operations.rb', line 139

def initialize(client:)
  @client = client
end

Instance Method Details

#create(amount:, category:, direction:, effective_date:, event_type:, financial_account_token:, token: nil, memo: nil, on_closed_account: nil, subtype: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::ManagementOperationTransaction

Create management operation

Parameters:

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
# File 'lib/lithic/resources/management_operations.rb', line 37

def create(params)
  parsed, options = Lithic::ManagementOperationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/management_operations",
    body: parsed,
    model: Lithic::ManagementOperationTransaction,
    options: options
  )
end

#list(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::ManagementOperationTransaction>

Some parameter documentations has been truncated, see Models::ManagementOperationListParams for more details.

List management operations

Parameters:

  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • business_account_token (String)
  • category (Symbol, Lithic::Models::ManagementOperationListParams::Category)

    Management operation category to be returned.

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • financial_account_token (String)

    Globally unique identifier for the financial account. Accepted type dependent on

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

  • status (Symbol, Lithic::Models::ManagementOperationListParams::Status)

    Management operation status to be returned.

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/lithic/resources/management_operations.rb', line 98

def list(params = {})
  parsed, options = Lithic::ManagementOperationListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/management_operations",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::ManagementOperationTransaction,
    options: options
  )
end

#retrieve(management_operation_token, request_options: {}) ⇒ Lithic::Models::ManagementOperationTransaction

Get management operation

Parameters:

  • management_operation_token (String)

    Globally unique identifier for the management operation

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
# File 'lib/lithic/resources/management_operations.rb', line 59

def retrieve(management_operation_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/management_operations/%1$s", management_operation_token],
    model: Lithic::ManagementOperationTransaction,
    options: params[:request_options]
  )
end

#reverse(management_operation_token, effective_date:, memo: nil, request_options: {}) ⇒ Lithic::Models::ManagementOperationTransaction

Reverse a management operation

Parameters:

  • management_operation_token (String)

    Globally unique identifier for the management operation

  • effective_date (Date)
  • memo (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



125
126
127
128
129
130
131
132
133
134
# File 'lib/lithic/resources/management_operations.rb', line 125

def reverse(management_operation_token, params)
  parsed, options = Lithic::ManagementOperationReverseParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/management_operations/%1$s/reverse", management_operation_token],
    body: parsed,
    model: Lithic::ManagementOperationTransaction,
    options: options
  )
end