Class: Believe::Resources::PepTalk

Inherits:
Object
  • Object
show all
Defined in:
lib/believe/resources/pep_talk.rb

Overview

Server-Sent Events (SSE) streaming endpoints

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PepTalk

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

Parameters:



35
36
37
# File 'lib/believe/resources/pep_talk.rb', line 35

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(stream: nil, request_options: {}) ⇒ ::Believe::Models::PepTalkRetrieveResponse

Get a motivational pep talk from Ted Lasso himself. By default returns the complete pep talk. Add ‘?stream=true` to get Server-Sent Events (SSE) streaming the pep talk chunk by chunk.

Parameters:

  • stream (Boolean)

    If true, returns SSE stream instead of full response

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

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/believe/resources/pep_talk.rb', line 20

def retrieve(params = {})
  parsed, options = ::Believe::PepTalkRetrieveParams.dump_request(params)
  query = ::Believe::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "pep-talk",
    query: query,
    model: ::Believe::Models::PepTalkRetrieveResponse,
    options: options
  )
end