Class: WhopSDK::Resources::DisputeAlerts

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/dispute_alerts.rb

Overview

Dispute alerts

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ DisputeAlerts

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

Parameters:



84
85
86
# File 'lib/whop_sdk/resources/dispute_alerts.rb', line 84

def initialize(client:)
  @client = client
end

Instance Method Details

#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::DisputeAlertListResponse>

Returns a paginated list of dispute alerts for a company, with optional filtering by creation date.

Required permissions:

  • ‘payment:dispute_alert:read`

  • ‘payment:basic:read`

  • ‘payment:dispute:read`

Parameters:

  • company_id (String)

    The unique identifier of the company to list dispute alerts for.

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • created_after (Time, nil)

    Only return dispute alerts created after this timestamp.

  • created_before (Time, nil)

    Only return dispute alerts created before this timestamp.

  • direction (Symbol, WhopSDK::Models::Direction, nil)

    The direction of the sort.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

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

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/whop_sdk/resources/dispute_alerts.rb', line 68

def list(params)
  parsed, options = WhopSDK::DisputeAlertListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "dispute_alerts",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::DisputeAlertListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::DisputeAlertRetrieveResponse

Retrieves the details of an existing dispute alert.

Required permissions:

  • ‘payment:dispute_alert:read`

  • ‘payment:basic:read`

  • ‘member:email:read`

  • ‘member:basic:read`

  • ‘member:phone:read`

  • ‘payment:dispute:read`

Parameters:

  • id (String)

    The unique identifier of the dispute alert.

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

Returns:

See Also:



27
28
29
30
31
32
33
34
# File 'lib/whop_sdk/resources/dispute_alerts.rb', line 27

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["dispute_alerts/%1$s", id],
    model: WhopSDK::Models::DisputeAlertRetrieveResponse,
    options: params[:request_options]
  )
end