Class: Trycourier::Resources::Notifications
- Inherits:
-
Object
- Object
- Trycourier::Resources::Notifications
- Defined in:
- lib/trycourier/resources/notifications.rb,
lib/trycourier/resources/notifications/draft.rb,
lib/trycourier/resources/notifications/checks.rb
Defined Under Namespace
Instance Attribute Summary collapse
- #checks ⇒ Trycourier::Resources::Notifications::Checks readonly
- #draft ⇒ Trycourier::Resources::Notifications::Draft readonly
Instance Method Summary collapse
-
#initialize(client:) ⇒ Notifications
constructor
private
A new instance of Notifications.
- #list(cursor: nil, notes: nil, request_options: {}) ⇒ Trycourier::Models::NotificationListResponse
- #retrieve_content(id, request_options: {}) ⇒ Trycourier::Models::NotificationGetContent
Constructor Details
#initialize(client:) ⇒ Notifications
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 Notifications.
54 55 56 57 58 |
# File 'lib/trycourier/resources/notifications.rb', line 54 def initialize(client:) @client = client @draft = Trycourier::Resources::Notifications::Draft.new(client: client) @checks = Trycourier::Resources::Notifications::Checks.new(client: client) end |
Instance Attribute Details
#checks ⇒ Trycourier::Resources::Notifications::Checks (readonly)
10 11 12 |
# File 'lib/trycourier/resources/notifications.rb', line 10 def checks @checks end |
#draft ⇒ Trycourier::Resources::Notifications::Draft (readonly)
7 8 9 |
# File 'lib/trycourier/resources/notifications.rb', line 7 def draft @draft end |
Instance Method Details
#list(cursor: nil, notes: nil, request_options: {}) ⇒ Trycourier::Models::NotificationListResponse
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/trycourier/resources/notifications.rb', line 23 def list(params = {}) parsed, = Trycourier::NotificationListParams.dump_request(params) @client.request( method: :get, path: "notifications", query: parsed, model: Trycourier::Models::NotificationListResponse, options: ) end |
#retrieve_content(id, request_options: {}) ⇒ Trycourier::Models::NotificationGetContent
42 43 44 45 46 47 48 49 |
# File 'lib/trycourier/resources/notifications.rb', line 42 def retrieve_content(id, params = {}) @client.request( method: :get, path: ["notifications/%1$s/content", id], model: Trycourier::NotificationGetContent, options: params[:request_options] ) end |