Class: Knockapi::Resources::Schedules
- Inherits:
-
Object
- Object
- Knockapi::Resources::Schedules
- Defined in:
- lib/knockapi/resources/schedules.rb,
lib/knockapi/resources/schedules/bulk.rb
Defined Under Namespace
Classes: Bulk
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(recipients:, workflow:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Some parameter documentations has been truncated, see Models::ScheduleCreateParams for more details.
-
#delete(schedule_ids:, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Permanently deletes one or more schedules identified by the provided schedule IDs.
-
#initialize(client:) ⇒ Schedules
constructor
private
A new instance of Schedules.
-
#list(workflow:, after: nil, before: nil, page_size: nil, recipients: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Internal::EntriesCursor<Knockapi::Models::Schedule>
Returns a paginated list of schedules for the current environment, filtered by workflow and optionally by recipients and tenant.
-
#update(schedule_ids:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Some parameter documentations has been truncated, see Models::ScheduleUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Schedules
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 Schedules.
153 154 155 156 |
# File 'lib/knockapi/resources/schedules.rb', line 153 def initialize(client:) @client = client @bulk = Knockapi::Resources::Schedules::Bulk.new(client: client) end |
Instance Attribute Details
#bulk ⇒ Knockapi::Resources::Schedules::Bulk (readonly)
7 8 9 |
# File 'lib/knockapi/resources/schedules.rb', line 7 def bulk @bulk end |
Instance Method Details
#create(recipients:, workflow:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Some parameter documentations has been truncated, see Models::ScheduleCreateParams for more details.
Creates one or more schedules for a workflow with the specified recipients, timing, and data. Schedules can be one-time or recurring. This endpoint also handles [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the ‘actor`, `recipient`, and `tenant` fields.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/knockapi/resources/schedules.rb', line 41 def create(params) parsed, = Knockapi::ScheduleCreateParams.dump_request(params) @client.request( method: :post, path: "v1/schedules", body: parsed, model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: ) end |
#delete(schedule_ids:, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Permanently deletes one or more schedules identified by the provided schedule IDs. This operation cannot be undone.
139 140 141 142 143 144 145 146 147 148 |
# File 'lib/knockapi/resources/schedules.rb', line 139 def delete(params) parsed, = Knockapi::ScheduleDeleteParams.dump_request(params) @client.request( method: :delete, path: "v1/schedules", body: parsed, model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: ) end |
#list(workflow:, after: nil, before: nil, page_size: nil, recipients: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Internal::EntriesCursor<Knockapi::Models::Schedule>
Returns a paginated list of schedules for the current environment, filtered by workflow and optionally by recipients and tenant.
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/knockapi/resources/schedules.rb', line 115 def list(params) parsed, = Knockapi::ScheduleListParams.dump_request(params) @client.request( method: :get, path: "v1/schedules", query: parsed, page: Knockapi::Internal::EntriesCursor, model: Knockapi::Schedule, options: ) end |
#update(schedule_ids:, actor: nil, data: nil, ending_at: nil, repeats: nil, scheduled_at: nil, tenant: nil, request_options: {}) ⇒ Array<Knockapi::Models::Schedule>
Some parameter documentations has been truncated, see Models::ScheduleUpdateParams for more details.
Updates one or more existing schedules with new timing, data, or other properties. All specified schedule IDs will be updated with the same values. This endpoint also handles [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the ‘actor`, `recipient`, and `tenant` fields.
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/knockapi/resources/schedules.rb', line 82 def update(params) parsed, = Knockapi::ScheduleUpdateParams.dump_request(params) @client.request( method: :put, path: "v1/schedules", body: parsed, model: Knockapi::Internal::Type::ArrayOf[Knockapi::Schedule], options: ) end |