Class: Knockapi::Resources::Users::Guides

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/users/guides.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Guides

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 Guides.

Parameters:



169
170
171
# File 'lib/knockapi/resources/users/guides.rb', line 169

def initialize(client:)
  @client = client
end

Instance Method Details

#get_channel(user_id, channel_id, data: nil, tenant: nil, type: nil, request_options: {}) ⇒ Knockapi::Models::Users::GuideGetChannelResponse

Returns a list of eligible in-app guides for a specific user and channel.

Parameters:

  • user_id (String)

    The unique identifier of the user.

  • channel_id (String)

    The unique identifier for the channel.

  • data (String)

    The data (JSON encoded object) to use for targeting and rendering guides.

  • tenant (String)

    The tenant ID to use for targeting and rendering guides.

  • type (String)

    The type of guides to filter by.

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

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/knockapi/resources/users/guides.rb', line 26

def get_channel(user_id, channel_id, params = {})
  parsed, options = Knockapi::Users::GuideGetChannelParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/users/%1$s/guides/%2$s", user_id, channel_id],
    query: parsed,
    model: Knockapi::Models::Users::GuideGetChannelResponse,
    options: options
  )
end

#mark_message_as_archived(user_id, message_id, channel_id:, guide_id:, guide_key:, guide_step_ref:, content: nil, data: nil, is_final: nil, metadata: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Models::Users::GuideMarkMessageAsArchivedResponse

Records that a guide has been archived by a user, triggering any associated archived events.

Parameters:

  • user_id (String)

    The unique identifier of the user.

  • message_id (String)
  • channel_id (String)

    The unique identifier for the channel.

  • guide_id (String)

    The unique identifier for the guide.

  • guide_key (String)

    The key of the guide.

  • guide_step_ref (String)

    The step reference of the guide.

  • content (Hash{Symbol=>Object})

    The content of the guide.

  • data (Hash{Symbol=>Object})

    The data of the guide.

  • is_final (Boolean)

    Whether the guide is final.

  • metadata (Hash{Symbol=>Object})

    The metadata of the guide.

  • tenant (String, nil)

    The tenant ID of the guide.

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

Returns:

See Also:



69
70
71
72
73
74
75
76
77
78
# File 'lib/knockapi/resources/users/guides.rb', line 69

def mark_message_as_archived(user_id, message_id, params)
  parsed, options = Knockapi::Users::GuideMarkMessageAsArchivedParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["v1/users/%1$s/guides/messages/%2$s/archived", user_id, message_id],
    body: parsed,
    model: Knockapi::Models::Users::GuideMarkMessageAsArchivedResponse,
    options: options
  )
end

#mark_message_as_interacted(user_id, message_id, channel_id:, guide_id:, guide_key:, guide_step_ref:, content: nil, data: nil, is_final: nil, metadata: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Models::Users::GuideMarkMessageAsInteractedResponse

Records that a user has interacted with a guide, triggering any associated interacted events.

Parameters:

  • user_id (String)

    The unique identifier of the user.

  • message_id (String)
  • channel_id (String)

    The unique identifier for the channel.

  • guide_id (String)

    The unique identifier for the guide.

  • guide_key (String)

    The key of the guide.

  • guide_step_ref (String)

    The step reference of the guide.

  • content (Hash{Symbol=>Object})

    The content of the guide.

  • data (Hash{Symbol=>Object})

    The data of the guide.

  • is_final (Boolean)

    Whether the guide is final.

  • metadata (Hash{Symbol=>Object})

    The metadata of the guide.

  • tenant (String, nil)

    The tenant ID of the guide.

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

Returns:

See Also:



112
113
114
115
116
117
118
119
120
121
# File 'lib/knockapi/resources/users/guides.rb', line 112

def mark_message_as_interacted(user_id, message_id, params)
  parsed, options = Knockapi::Users::GuideMarkMessageAsInteractedParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["v1/users/%1$s/guides/messages/%2$s/interacted", user_id, message_id],
    body: parsed,
    model: Knockapi::Models::Users::GuideMarkMessageAsInteractedResponse,
    options: options
  )
end

#mark_message_as_seen(user_id, message_id, channel_id:, guide_id:, guide_key:, guide_step_ref:, content: nil, data: nil, is_final: nil, metadata: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Models::Users::GuideMarkMessageAsSeenResponse

Records that a guide has been seen by a user, triggering any associated seen events.

Parameters:

  • user_id (String)

    The unique identifier of the user.

  • message_id (String)
  • channel_id (String)

    The unique identifier for the channel.

  • guide_id (String)

    The unique identifier for the guide.

  • guide_key (String)

    The key of the guide.

  • guide_step_ref (String)

    The step reference of the guide.

  • content (Hash{Symbol=>Object})

    The content of the guide.

  • data (Hash{Symbol=>Object})

    The data of the guide.

  • is_final (Boolean)

    Whether the guide is final.

  • metadata (Hash{Symbol=>Object})

    The metadata of the guide.

  • tenant (String, nil)

    The tenant ID of the guide.

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

Returns:

See Also:



155
156
157
158
159
160
161
162
163
164
# File 'lib/knockapi/resources/users/guides.rb', line 155

def mark_message_as_seen(user_id, message_id, params)
  parsed, options = Knockapi::Users::GuideMarkMessageAsSeenParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["v1/users/%1$s/guides/messages/%2$s/seen", user_id, message_id],
    body: parsed,
    model: Knockapi::Models::Users::GuideMarkMessageAsSeenResponse,
    options: options
  )
end