Class: Lithic::Resources::TransactionMonitoring::Cases::Comments

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Comments

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

Parameters:



104
105
106
# File 'lib/lithic/resources/transaction_monitoring/cases/comments.rb', line 104

def initialize(client:)
  @client = client
end

Instance Method Details

#create(case_token, comment:, actor_token: nil, request_options: {}) ⇒ Lithic::Models::TransactionMonitoring::CaseActivityEntry

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

Adds a comment to a case.

Parameters:

  • case_token (String)

    Globally unique identifier for the case.

  • comment (String)

    Text of the comment

  • actor_token (String)

    Optional client-provided identifier for the actor performing this action,

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/lithic/resources/transaction_monitoring/cases/comments.rb', line 27

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

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

Deletes a comment from a case.

Parameters:

  • comment_token (String)

    Globally unique identifier for the comment.

  • case_token (String)

    Globally unique identifier for the case.

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

Returns:

  • (nil)

See Also:



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/lithic/resources/transaction_monitoring/cases/comments.rb', line 87

def delete(comment_token, params)
  parsed, options = Lithic::TransactionMonitoring::Cases::CommentDeleteParams.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/comments/%2$s", case_token, comment_token],
    model: NilClass,
    options: options
  )
end

#update(comment_token, case_token:, comment:, actor_token: nil, request_options: {}) ⇒ Lithic::Models::TransactionMonitoring::CaseActivityEntry

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

Edits an existing comment on a case.

Parameters:

  • comment_token (String)

    Path param: Globally unique identifier for the comment.

  • case_token (String)

    Path param: Globally unique identifier for the case.

  • comment (String)

    Body param: New text of the comment

  • actor_token (String)

    Body param: Optional client-provided identifier for the actor performing this ac

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

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/lithic/resources/transaction_monitoring/cases/comments.rb', line 59

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