Class: Courier::Resources::Notifications::Checks
- Inherits:
-
Object
- Object
- Courier::Resources::Notifications::Checks
- Defined in:
- lib/courier/resources/notifications/checks.rb,
sig/courier/resources/notifications/checks.rbs
Overview
Create, update, version, publish, and localize notification templates and their content.
Instance Method Summary collapse
-
#delete(submission_id, id:, request_options: {}) ⇒ nil
Cancels a pending template submission, withdrawing it from the approval workflow.
-
#initialize(client:) ⇒ Checks
constructor
private
A new instance of Checks.
-
#list(submission_id, id:, request_options: {}) ⇒ Courier::Models::Notifications::CheckListResponse
Returns the approval checks recorded for a template submission, each with its pass or fail result.
-
#update(submission_id, id:, checks:, request_options: {}) ⇒ Courier::Models::Notifications::CheckUpdateResponse
Replaces the approval checks on a template submission with the complete set supplied in the request body.
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.
99 100 101 |
# File 'lib/courier/resources/notifications/checks.rb', line 99 def initialize(client:) @client = client end |
Instance Method Details
#delete(submission_id, id:, request_options: {}) ⇒ nil
Cancels a pending template submission, withdrawing it from the approval workflow. The template stays in draft and can be resubmitted later.
82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/courier/resources/notifications/checks.rb', line 82 def delete(submission_id, params) parsed, = 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: ) end |
#list(submission_id, id:, request_options: {}) ⇒ Courier::Models::Notifications::CheckListResponse
Returns the approval checks recorded for a template submission, each with its pass or fail result.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/courier/resources/notifications/checks.rb', line 54 def list(submission_id, params) parsed, = 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: ) end |
#update(submission_id, id:, checks:, request_options: {}) ⇒ Courier::Models::Notifications::CheckUpdateResponse
Replaces the approval checks on a template submission with the complete set supplied in the request body.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/courier/resources/notifications/checks.rb', line 25 def update(submission_id, params) parsed, = 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: ) end |