Skip to content

Commit

Permalink
feat(dialogflow): Add SetAgentRequest and DeleteAgentRequest
Browse files Browse the repository at this point in the history
* Add AgentsClient methods:
  * AgentsClient#set_agent (SetAgentRequest)
  * AgentsClient#delete_agent (DeleteAgentRequest)
* Add Agent#api_version (Agent::ApiVersion)
* Add Agent#tier (Agent::Tier)
* Add service_address and service_port to client constructor method
* Update product links
* Update documentation
  • Loading branch information
yoshi-automation authored and quartzmo committed Jul 5, 2019
1 parent 91e7db7 commit e47df64
Show file tree
Hide file tree
Showing 31 changed files with 566 additions and 98 deletions.
2 changes: 1 addition & 1 deletion google-cloud-dialogflow/google-cloud-dialogflow.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.0.0"

gem.add_dependency "google-gax", "~> 1.3"
gem.add_dependency "google-gax", "~> 1.7"
gem.add_dependency "googleapis-common-protos", ">= 1.3.9", "< 2.0"

gem.add_development_dependency "minitest", "~> 5.10"
Expand Down
38 changes: 31 additions & 7 deletions google-cloud-dialogflow/lib/google/cloud/dialogflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@ module Agents
# You can create an agent using both Dialogflow Standard Edition and
# Dialogflow Enterprise Edition. For details, see
# [Dialogflow
# Editions](https://cloud.google.com/dialogflow-enterprise/docs/editions).
# Editions](https://cloud.google.com/dialogflow/docs/editions).
#
# You can save your agent for backup or versioning by exporting the agent by
# using the {Google::Cloud::Dialogflow::V2::Agents::ExportAgent ExportAgent} method. You can import a saved
# agent by using the {Google::Cloud::Dialogflow::V2::Agents::ImportAgent ImportAgent} method.
#
# Dialogflow provides several
# [prebuilt
# agents](https://cloud.google.com/dialogflow-enterprise/docs/agents-prebuilt)
# agents](https://cloud.google.com/dialogflow/docs/agents-prebuilt)
# for common conversation scenarios such as determining a date and time,
# converting currency, and so on.
#
# For more information about agents, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/agents-overview).
# documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
#
# @param version [Symbol, String]
# The major version of the service to be used. By default :v2
Expand Down Expand Up @@ -148,6 +148,10 @@ module Agents
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down Expand Up @@ -185,7 +189,7 @@ module Contexts
#
# For more information about contexts, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview).
# documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
#
# @param version [Symbol, String]
# The major version of the service to be used. By default :v2
Expand Down Expand Up @@ -217,6 +221,10 @@ module Contexts
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down Expand Up @@ -264,7 +272,7 @@ module EntityTypes
#
# For more information about entity types, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
#
# @param version [Symbol, String]
# The major version of the service to be used. By default :v2
Expand Down Expand Up @@ -296,6 +304,10 @@ module EntityTypes
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down Expand Up @@ -347,7 +359,7 @@ module Intents
#
# For more information about intents, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/intents-overview).
# documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
#
# @param version [Symbol, String]
# The major version of the service to be used. By default :v2
Expand Down Expand Up @@ -379,6 +391,10 @@ module Intents
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down Expand Up @@ -411,7 +427,7 @@ module SessionEntityTypes
#
# For more information about entity types, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
#
# @param version [Symbol, String]
# The major version of the service to be used. By default :v2
Expand Down Expand Up @@ -443,6 +459,10 @@ module SessionEntityTypes
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down Expand Up @@ -498,6 +518,10 @@ module Sessions
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand Down
62 changes: 55 additions & 7 deletions google-cloud-dialogflow/lib/google/cloud/dialogflow/v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ module Agents
# You can create an agent using both Dialogflow Standard Edition and
# Dialogflow Enterprise Edition. For details, see
# [Dialogflow
# Editions](https://cloud.google.com/dialogflow-enterprise/docs/editions).
# Editions](https://cloud.google.com/dialogflow/docs/editions).
#
# You can save your agent for backup or versioning by exporting the agent by
# using the {Google::Cloud::Dialogflow::V2::Agents::ExportAgent ExportAgent} method. You can import a saved
# agent by using the {Google::Cloud::Dialogflow::V2::Agents::ImportAgent ImportAgent} method.
#
# Dialogflow provides several
# [prebuilt
# agents](https://cloud.google.com/dialogflow-enterprise/docs/agents-prebuilt)
# agents](https://cloud.google.com/dialogflow/docs/agents-prebuilt)
# for common conversation scenarios such as determining a date and time,
# converting currency, and so on.
#
# For more information about agents, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/agents-overview).
# documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
Expand Down Expand Up @@ -145,6 +145,10 @@ module Agents
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -154,6 +158,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -165,6 +171,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::AgentsClient.new(**kwargs)
Expand All @@ -190,7 +198,7 @@ module Contexts
#
# For more information about contexts, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/contexts-overview).
# documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
Expand Down Expand Up @@ -218,6 +226,10 @@ module Contexts
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -227,6 +239,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -238,6 +252,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::ContextsClient.new(**kwargs)
Expand Down Expand Up @@ -273,7 +289,7 @@ module EntityTypes
#
# For more information about entity types, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
Expand Down Expand Up @@ -301,6 +317,10 @@ module EntityTypes
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -310,6 +330,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -321,6 +343,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::EntityTypesClient.new(**kwargs)
Expand Down Expand Up @@ -360,7 +384,7 @@ module Intents
#
# For more information about intents, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/intents-overview).
# documentation](https://cloud.google.com/dialogflow/docs/intents-overview).
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
Expand Down Expand Up @@ -388,6 +412,10 @@ module Intents
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -397,6 +425,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -408,6 +438,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::IntentsClient.new(**kwargs)
Expand All @@ -428,7 +460,7 @@ module SessionEntityTypes
#
# For more information about entity types, see the
# [Dialogflow
# documentation](https://cloud.google.com/dialogflow-enterprise/docs/entities-overview).
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
#
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
Expand Down Expand Up @@ -456,6 +488,10 @@ module SessionEntityTypes
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -465,6 +501,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -476,6 +514,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::SessionEntityTypesClient.new(**kwargs)
Expand Down Expand Up @@ -515,6 +555,10 @@ module Sessions
# The default timeout, in seconds, for calls made through this client.
# @param metadata [Hash]
# Default metadata to be sent with each request. This can be overridden on a per call basis.
# @param service_address [String]
# Override for the service hostname, or `nil` to leave as the default.
# @param service_port [Integer]
# Override for the service port, or `nil` to leave as the default.
# @param exception_transformer [Proc]
# An optional proc that intercepts any exceptions raised during an API call to inject
# custom error handling.
Expand All @@ -524,6 +568,8 @@ def self.new \
client_config: nil,
timeout: nil,
metadata: nil,
service_address: nil,
service_port: nil,
exception_transformer: nil,
lib_name: nil,
lib_version: nil
Expand All @@ -535,6 +581,8 @@ def self.new \
metadata: metadata,
exception_transformer: exception_transformer,
lib_name: lib_name,
service_address: service_address,
service_port: service_port,
lib_version: lib_version
}.select { |_, v| v != nil }
Google::Cloud::Dialogflow::V2::SessionsClient.new(**kwargs)
Expand Down
Loading

0 comments on commit e47df64

Please sign in to comment.