Class: Telnyx::Resources::DialogflowConnections

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/dialogflow_connections.rb

Overview

Dialogflow Connection Operations.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ DialogflowConnections

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

Parameters:



122
123
124
# File 'lib/telnyx/resources/dialogflow_connections.rb', line 122

def initialize(client:)
  @client = client
end

Instance Method Details

#create(connection_id, service_account:, conversation_profile_id: nil, dialogflow_api: nil, environment: nil, location: nil, request_options: {}) ⇒ Telnyx::Models::DialogflowConnectionCreateResponse

Some parameter documentations has been truncated, see Models::DialogflowConnectionCreateParams for more details.

Save Dialogflow Credentiails to Telnyx, so it can be used with other Telnyx services.

Parameters:

  • connection_id (String)

    Uniquely identifies a Telnyx application (Call Control).

  • service_account (Hash{Symbol=>Object})

    The JSON map to connect your Dialoglow account.

  • conversation_profile_id (String)

    The id of a configured conversation profile on your Dialogflow account. (If you

  • dialogflow_api (Symbol, Telnyx::Models::DialogflowConnectionCreateParams::DialogflowAPI)

    Determine which Dialogflow will be used.

  • environment (String)

    Which Dialogflow environment will be used.

  • location (String)

    The region of your agent is. (If you use Dialogflow CX, this param is required)

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

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/telnyx/resources/dialogflow_connections.rb', line 32

def create(connection_id, params)
  parsed, options = Telnyx::DialogflowConnectionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["dialogflow_connections/%1$s", connection_id],
    body: parsed,
    model: Telnyx::Models::DialogflowConnectionCreateResponse,
    options: options
  )
end

#delete(connection_id, request_options: {}) ⇒ nil

Deletes a stored Dialogflow Connection.

Parameters:

  • connection_id (String)

    Uniquely identifies a Telnyx application (Call Control).

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

Returns:

  • (nil)

See Also:



110
111
112
113
114
115
116
117
# File 'lib/telnyx/resources/dialogflow_connections.rb', line 110

def delete(connection_id, params = {})
  @client.request(
    method: :delete,
    path: ["dialogflow_connections/%1$s", connection_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#retrieve(connection_id, request_options: {}) ⇒ Telnyx::Models::DialogflowConnectionRetrieveResponse

Return details of the Dialogflow connection associated with the given CallControl connection.

Parameters:

  • connection_id (String)

    Uniquely identifies a Telnyx application (Call Control).

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

Returns:

See Also:



55
56
57
58
59
60
61
62
# File 'lib/telnyx/resources/dialogflow_connections.rb', line 55

def retrieve(connection_id, params = {})
  @client.request(
    method: :get,
    path: ["dialogflow_connections/%1$s", connection_id],
    model: Telnyx::Models::DialogflowConnectionRetrieveResponse,
    options: params[:request_options]
  )
end

#update(connection_id, service_account:, conversation_profile_id: nil, dialogflow_api: nil, environment: nil, location: nil, request_options: {}) ⇒ Telnyx::Models::DialogflowConnectionUpdateResponse

Some parameter documentations has been truncated, see Models::DialogflowConnectionUpdateParams for more details.

Updates a stored Dialogflow Connection.

Parameters:

  • connection_id (String)

    Uniquely identifies a Telnyx application (Call Control).

  • service_account (Hash{Symbol=>Object})

    The JSON map to connect your Dialoglow account.

  • conversation_profile_id (String)

    The id of a configured conversation profile on your Dialogflow account. (If you

  • dialogflow_api (Symbol, Telnyx::Models::DialogflowConnectionUpdateParams::DialogflowAPI)

    Determine which Dialogflow will be used.

  • environment (String)

    Which Dialogflow environment will be used.

  • location (String)

    The region of your agent is. (If you use Dialogflow CX, this param is required)

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

Returns:

See Also:



88
89
90
91
92
93
94
95
96
97
# File 'lib/telnyx/resources/dialogflow_connections.rb', line 88

def update(connection_id, params)
  parsed, options = Telnyx::DialogflowConnectionUpdateParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["dialogflow_connections/%1$s", connection_id],
    body: parsed,
    model: Telnyx::Models::DialogflowConnectionUpdateResponse,
    options: options
  )
end