Method: Courier::ListsClient#list
- Defined in:
- lib/trycourier/lists/client.rb
#list(cursor: nil, pattern: nil, request_options: nil) ⇒ Lists::ListGetAllResponse
Returns all of the lists, with the ability to filter based on a pattern.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/trycourier/lists/client.rb', line 29 def list(cursor: nil, pattern: nil, request_options: nil) response = @request_client.conn.get("/lists") do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? unless &..nil? req.headers["Authorization"] = . end req.headers = { **req.headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "pattern": pattern }.compact end Lists::ListGetAllResponse.from_json(json_object: response.body) end |