<?php
/*
 * Copyright 2014 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

namespace Google\Service\Contactcenterinsights\Resource;

use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1AssistantSession;
use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1ListAssistantSessionsResponse;
use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1StreamChatRequest;
use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1StreamChatResponse;

/**
 * The "assistantSessions" collection of methods.
 * Typical usage is:
 *  <code>
 *   $contactcenterinsightsService = new Google\Service\Contactcenterinsights(...);
 *   $assistantSessions = $contactcenterinsightsService->projects_locations_assistantSessions;
 *  </code>
 */
class ProjectsLocationsAssistantSessions extends \Google\Service\Resource
{
  /**
   * Creates an assistant session. (assistantSessions.create)
   *
   * @param string $parent Required. The parent resource where this assistant
   * session will be created. Format: projects/{project}/locations/{location}
   * @param GoogleCloudContactcenterinsightsV1AssistantSession $postBody
   * @param array $optParams Optional parameters.
   *
   * @opt_param string assistantSessionId Optional. The ID to use for the
   * assistant session, which will become the final component of the assistant
   * session's resource name. If not provided, a random UUID will be generated by
   * the server. This value should be 4-64 characters and must match the regular
   * expression `^[a-z0-9-]{4,64}$`.
   * @return GoogleCloudContactcenterinsightsV1AssistantSession
   * @throws \Google\Service\Exception
   */
  public function create($parent, GoogleCloudContactcenterinsightsV1AssistantSession $postBody, $optParams = [])
  {
    $params = ['parent' => $parent, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('create', [$params], GoogleCloudContactcenterinsightsV1AssistantSession::class);
  }
  /**
   * Gets an assistant session. (assistantSessions.get)
   *
   * @param string $name Required. The name of the assistant session to retrieve.
   * Format: `projects/{project}/locations/{location}/assistantSessions/{assistant
   * _session}`
   * @param array $optParams Optional parameters.
   * @return GoogleCloudContactcenterinsightsV1AssistantSession
   * @throws \Google\Service\Exception
   */
  public function get($name, $optParams = [])
  {
    $params = ['name' => $name];
    $params = array_merge($params, $optParams);
    return $this->call('get', [$params], GoogleCloudContactcenterinsightsV1AssistantSession::class);
  }
  /**
   * Lists assistant sessions.
   * (assistantSessions.listProjectsLocationsAssistantSessions)
   *
   * @param string $parent Required. The parent resource, which owns this
   * collection of assistant sessions. Format:
   * `projects/{project}/locations/{location}`
   * @param array $optParams Optional parameters.
   *
   * @opt_param string filter Optional. A filter to reduce results to a specific
   * subset.
   * @opt_param int pageSize Optional. The maximum number of assistant sessions to
   * return in a single response. If unspecified, at most 100 assistant sessions
   * will be returned. The maximum value is 1000; values above 1000 will be
   * coerced to 1000.
   * @opt_param string pageToken Optional. A page token, received from a previous
   * `ListAssistantSessions` call. Provide this to retrieve the subsequent page.
   * @return GoogleCloudContactcenterinsightsV1ListAssistantSessionsResponse
   * @throws \Google\Service\Exception
   */
  public function listProjectsLocationsAssistantSessions($parent, $optParams = [])
  {
    $params = ['parent' => $parent];
    $params = array_merge($params, $optParams);
    return $this->call('list', [$params], GoogleCloudContactcenterinsightsV1ListAssistantSessionsResponse::class);
  }
  /**
   * Streams chat messages from the assistant. (assistantSessions.streamChat)
   *
   * @param string $name Required. The name of the assistant session to stream
   * chat. Format: `projects/{project}/locations/{location}/assistantSessions/{ass
   * istant_session}`
   * @param GoogleCloudContactcenterinsightsV1StreamChatRequest $postBody
   * @param array $optParams Optional parameters.
   * @return GoogleCloudContactcenterinsightsV1StreamChatResponse
   * @throws \Google\Service\Exception
   */
  public function streamChat($name, GoogleCloudContactcenterinsightsV1StreamChatRequest $postBody, $optParams = [])
  {
    $params = ['name' => $name, 'postBody' => $postBody];
    $params = array_merge($params, $optParams);
    return $this->call('streamChat', [$params], GoogleCloudContactcenterinsightsV1StreamChatResponse::class);
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsAssistantSessions::class, 'Google_Service_Contactcenterinsights_Resource_ProjectsLocationsAssistantSessions');
