Class: Courier::Resources::Journeys
- Inherits:
-
Object
- Object
- Courier::Resources::Journeys
- Defined in:
- lib/courier/resources/journeys.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Journeys
constructor
private
A new instance of Journeys.
-
#invoke(template_id, data: nil, profile: nil, user_id: nil, request_options: {}) ⇒ Courier::Models::JourneysInvokeResponse
Some parameter documentations has been truncated, see Models::JourneyInvokeParams for more details.
-
#list(cursor: nil, version: nil, request_options: {}) ⇒ Courier::Models::JourneysListResponse
Some parameter documentations has been truncated, see Models::JourneyListParams for more details.
Constructor Details
#initialize(client:) ⇒ Journeys
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 Journeys.
68 69 70 |
# File 'lib/courier/resources/journeys.rb', line 68 def initialize(client:) @client = client end |
Instance Method Details
#invoke(template_id, data: nil, profile: nil, user_id: nil, request_options: {}) ⇒ Courier::Models::JourneysInvokeResponse
Some parameter documentations has been truncated, see Models::JourneyInvokeParams for more details.
Invoke a journey run from a journey template.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/courier/resources/journeys.rb', line 54 def invoke(template_id, params = {}) parsed, = Courier::JourneyInvokeParams.dump_request(params) @client.request( method: :post, path: ["journeys/%1$s/invoke", template_id], body: parsed, model: Courier::JourneysInvokeResponse, options: ) end |
#list(cursor: nil, version: nil, request_options: {}) ⇒ Courier::Models::JourneysListResponse
Some parameter documentations has been truncated, see Models::JourneyListParams for more details.
Get the list of journeys.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/courier/resources/journeys.rb', line 22 def list(params = {}) parsed, = Courier::JourneyListParams.dump_request(params) query = Courier::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "journeys", query: query, model: Courier::JourneysListResponse, options: ) end |