Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.
REST client for the SessionService service.
Service for managing Sessions and Session-related resources.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the SessionService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all SessionService clients ::Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the SessionService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_session
def create_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
def create_session(parent: nil, session: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
def create_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
create_session
via a request object, either of type
CreateSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_session(parent: nil, session: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
create_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. Full resource name of parent data store. Format:
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}
- session (::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash) — Required. The session to create.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Session)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::CreateSessionRequest.new # Call the create_session method. result = client.create_session request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session. p result
#delete_session
def delete_session(request, options = nil) -> ::Google::Protobuf::Empty
def delete_session(name: nil) -> ::Google::Protobuf::Empty
def delete_session(request, options = nil) -> ::Google::Protobuf::Empty
delete_session
via a request object, either of type
DeleteSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::DeleteSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_session(name: nil) -> ::Google::Protobuf::Empty
delete_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the Session to delete. Format:
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::DeleteSessionRequest.new # Call the delete_session method. result = client.delete_session request # The returned object is of type Google::Protobuf::Empty. p result
#get_session
def get_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
def get_session(name: nil, include_answer_details: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
Gets a Session.
def get_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
get_session
via a request object, either of type
GetSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::GetSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_session(name: nil, include_answer_details: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
get_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. The resource name of the Session to get. Format:
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}
- include_answer_details (::Boolean) — Optional. If set to true, the full session including all answer details will be returned.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Session)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::GetSessionRequest.new # Call the get_session method. result = client.get_session request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new SessionService REST client object.
- (config) — Configure the SessionService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_sessions
def list_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>
def list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>
Lists all Sessions by their parent DataStore.
def list_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>
list_sessions
via a request object, either of type
ListSessionsRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::ListSessionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>
list_sessions
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The data store resource name. Format:
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}
- page_size (::Integer) — Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
-
page_token (::String) — A page token, received from a previous
ListSessions
call. Provide this to retrieve the subsequent page. -
filter (::String) — A comma-separated list of fields to filter by, in EBNF grammar.
The supported fields are:
user_pseudo_id
state
display_name
starred
is_pinned
labels
create_time
update_time
Examples: "user_pseudo_id = some_id" "display_name = \"some_name\"" "starred = true" "is_pinned=true AND (NOT labels:hidden)" "create_time > \"1970-01-01T12:00:00Z\""
-
order_by (::String) —
A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields:
update_time
create_time
session_name
is_pinned
Example:
- "update_time desc"
- "create_time"
- "is_pinned desc,update_time desc": list sessions by is_pinned first, then by update_time.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Session>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::ListSessionsRequest.new # Call the list_sessions method. result = client.list_sessions request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Session. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_session
def update_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
def update_session(session: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
Updates a Session.
Session action type cannot be changed. If the Session to update does not exist, a NOT_FOUND error is returned.
def update_session(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
update_session
via a request object, either of type
UpdateSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1beta::UpdateSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_session(session: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::Session
update_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- session (::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash) — Required. The Session to update.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
Session to update. The
following are NOT supported:
If not set or empty, all supported fields are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DiscoveryEngine::V1beta::Session)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/discovery_engine/v1beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DiscoveryEngine::V1beta::SessionService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1beta::UpdateSessionRequest.new # Call the update_session method. result = client.update_session request # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Session. p result