Class: Courier::Resources::Notifications::Checks

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/notifications/checks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Checks

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

Parameters:



94
95
96
# File 'lib/courier/resources/notifications/checks.rb', line 94

def initialize(client:)
  @client = client
end

Instance Method Details

#delete(submission_id, id:, request_options: {}) ⇒ nil

Cancel a notification template submission.

Parameters:

  • submission_id (String)

    Submission ID.

  • id (String)

    Notification template ID.

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

Returns:

  • (nil)

See Also:



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/courier/resources/notifications/checks.rb', line 77

def delete(submission_id, params)
  parsed, options = Courier::Notifications::CheckDeleteParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["notifications/%1$s/%2$s/checks", id, submission_id],
    model: NilClass,
    options: options
  )
end

#list(submission_id, id:, request_options: {}) ⇒ Courier::Models::Notifications::CheckListResponse

Retrieve the checks for a notification template submission.

Parameters:

  • submission_id (String)

    Submission ID.

  • id (String)

    Notification template ID.

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

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/courier/resources/notifications/checks.rb', line 50

def list(submission_id, params)
  parsed, options = Courier::Notifications::CheckListParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["notifications/%1$s/%2$s/checks", id, submission_id],
    model: Courier::Models::Notifications::CheckListResponse,
    options: options
  )
end

#update(submission_id, id:, checks:, request_options: {}) ⇒ Courier::Models::Notifications::CheckUpdateResponse

Replace the checks for a notification template submission.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/courier/resources/notifications/checks.rb', line 22

def update(submission_id, params)
  parsed, options = Courier::Notifications::CheckUpdateParams.dump_request(params)
  id =
    parsed.delete(:id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["notifications/%1$s/%2$s/checks", id, submission_id],
    body: parsed,
    model: Courier::Models::Notifications::CheckUpdateResponse,
    options: options
  )
end