Class: Trycourier::Resources::Notifications

Inherits:
Object
  • Object
show all
Defined in:
lib/trycourier/resources/notifications.rb,
lib/trycourier/resources/notifications/draft.rb,
lib/trycourier/resources/notifications/checks.rb

Defined Under Namespace

Classes: Checks, Draft

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:



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

#checksTrycourier::Resources::Notifications::Checks (readonly)



10
11
12
# File 'lib/trycourier/resources/notifications.rb', line 10

def checks
  @checks
end

#draftTrycourier::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

Parameters:

  • cursor (String, nil)
  • notes (Boolean, nil)

    Retrieve the notes from the Notification template settings.

  • request_options (Trycourier::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'lib/trycourier/resources/notifications.rb', line 23

def list(params = {})
  parsed, options = Trycourier::NotificationListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "notifications",
    query: parsed,
    model: Trycourier::Models::NotificationListResponse,
    options: options
  )
end

#retrieve_content(id, request_options: {}) ⇒ Trycourier::Models::NotificationGetContent

Parameters:

Returns:

See Also:



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