Class: Lithic::Resources::TransactionMonitoring::Cases::Files

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/transaction_monitoring/cases/files.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Files

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 Files.

Parameters:



124
125
126
# File 'lib/lithic/resources/transaction_monitoring/cases/files.rb', line 124

def initialize(client:)
  @client = client
end

Instance Method Details

#create(case_token, name:, request_options: {}) ⇒ Lithic::Models::TransactionMonitoring::Cases::CaseFile

Creates a file record and returns a presigned URL for uploading the file to the case.

Parameters:

  • case_token (String)

    Globally unique identifier for the case.

  • name (String)

    Name of the file to upload

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

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
# File 'lib/lithic/resources/transaction_monitoring/cases/files.rb', line 22

def create(case_token, params)
  parsed, options = Lithic::TransactionMonitoring::Cases::FileCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/transaction_monitoring/cases/%1$s/files", case_token],
    body: parsed,
    model: Lithic::TransactionMonitoring::Cases::CaseFile,
    options: options
  )
end

#delete(file_token, case_token:, request_options: {}) ⇒ nil

Deletes a file from a case.

Parameters:

  • file_token (String)

    Globally unique identifier for the file.

  • case_token (String)

    Globally unique identifier for the case.

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

Returns:

  • (nil)

See Also:



107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/lithic/resources/transaction_monitoring/cases/files.rb', line 107

def delete(file_token, params)
  parsed, options = Lithic::TransactionMonitoring::Cases::FileDeleteParams.dump_request(params)
  case_token =
    parsed.delete(:case_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["v1/transaction_monitoring/cases/%1$s/files/%2$s", case_token, file_token],
    model: NilClass,
    options: options
  )
end

#list(case_token, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::TransactionMonitoring::Cases::CaseFile>

Some parameter documentations has been truncated, see Models::TransactionMonitoring::Cases::FileListParams for more details.

Lists the files attached to a case.

Parameters:

  • case_token (String)

    Globally unique identifier for the case.

  • ending_before (String)

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

  • 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

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

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/lithic/resources/transaction_monitoring/cases/files.rb', line 81

def list(case_token, params = {})
  parsed, options = Lithic::TransactionMonitoring::Cases::FileListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/transaction_monitoring/cases/%1$s/files", case_token],
    query: query,
    page: Lithic::Internal::CursorPage,
    model: Lithic::TransactionMonitoring::Cases::CaseFile,
    options: options
  )
end

#retrieve(file_token, case_token:, request_options: {}) ⇒ Lithic::Models::TransactionMonitoring::Cases::CaseFile

Retrieves a single file attached to a case, including a presigned download URL when the file is ready.

Parameters:

  • file_token (String)

    Globally unique identifier for the file.

  • case_token (String)

    Globally unique identifier for the case.

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

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/lithic/resources/transaction_monitoring/cases/files.rb', line 47

def retrieve(file_token, params)
  parsed, options = Lithic::TransactionMonitoring::Cases::FileRetrieveParams.dump_request(params)
  case_token =
    parsed.delete(:case_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/transaction_monitoring/cases/%1$s/files/%2$s", case_token, file_token],
    model: Lithic::TransactionMonitoring::Cases::CaseFile,
    options: options
  )
end