1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Contactcenterinsights\Resource;
19
20use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1CalculateStatsResponse;
21use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1Conversation;
22use Google\Service\Contactcenterinsights\GoogleCloudContactcenterinsightsV1ListConversationsResponse;
23use Google\Service\Contactcenterinsights\GoogleProtobufEmpty;
24
25/**
26 * The "conversations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $contactcenterinsightsService = new Google\Service\Contactcenterinsights(...);
30 *   $conversations = $contactcenterinsightsService->conversations;
31 *  </code>
32 */
33class ProjectsLocationsConversations extends \Google\Service\Resource
34{
35  /**
36   * Gets conversation statistics. (conversations.calculateStats)
37   *
38   * @param string $location Required. The location of the conversations.
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string filter A filter to reduce results to a specific subset.
42   * This field is useful for getting statistics about conversations with specific
43   * properties.
44   * @return GoogleCloudContactcenterinsightsV1CalculateStatsResponse
45   */
46  public function calculateStats($location, $optParams = [])
47  {
48    $params = ['location' => $location];
49    $params = array_merge($params, $optParams);
50    return $this->call('calculateStats', [$params], GoogleCloudContactcenterinsightsV1CalculateStatsResponse::class);
51  }
52  /**
53   * Creates a conversation. (conversations.create)
54   *
55   * @param string $parent Required. The parent resource of the conversation.
56   * @param GoogleCloudContactcenterinsightsV1Conversation $postBody
57   * @param array $optParams Optional parameters.
58   *
59   * @opt_param string conversationId A unique ID for the new conversation. This
60   * ID will become the final component of the conversation's resource name. If no
61   * ID is specified, a server-generated ID will be used. This value should be
62   * 4-64 characters and must match the regular expression `^[a-z0-9-]{4,64}$`.
63   * Valid characters are `a-z-`
64   * @return GoogleCloudContactcenterinsightsV1Conversation
65   */
66  public function create($parent, GoogleCloudContactcenterinsightsV1Conversation $postBody, $optParams = [])
67  {
68    $params = ['parent' => $parent, 'postBody' => $postBody];
69    $params = array_merge($params, $optParams);
70    return $this->call('create', [$params], GoogleCloudContactcenterinsightsV1Conversation::class);
71  }
72  /**
73   * Deletes a conversation. (conversations.delete)
74   *
75   * @param string $name Required. The name of the conversation to delete.
76   * @param array $optParams Optional parameters.
77   *
78   * @opt_param bool force If set to true, all of this conversation's analyses
79   * will also be deleted. Otherwise, the request will only succeed if the
80   * conversation has no analyses.
81   * @return GoogleProtobufEmpty
82   */
83  public function delete($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
88  }
89  /**
90   * Gets a conversation. (conversations.get)
91   *
92   * @param string $name Required. The name of the conversation to get.
93   * @param array $optParams Optional parameters.
94   *
95   * @opt_param string view The level of details of the conversation. Default is
96   * `FULL`.
97   * @return GoogleCloudContactcenterinsightsV1Conversation
98   */
99  public function get($name, $optParams = [])
100  {
101    $params = ['name' => $name];
102    $params = array_merge($params, $optParams);
103    return $this->call('get', [$params], GoogleCloudContactcenterinsightsV1Conversation::class);
104  }
105  /**
106   * Lists conversations. (conversations.listProjectsLocationsConversations)
107   *
108   * @param string $parent Required. The parent resource of the conversation.
109   * @param array $optParams Optional parameters.
110   *
111   * @opt_param string filter A filter to reduce results to a specific subset.
112   * Useful for querying conversations with specific properties.
113   * @opt_param int pageSize The maximum number of conversations to return in the
114   * response. A valid page size ranges from 0 to 1,000 inclusive. If the page
115   * size is zero or unspecified, a default page size of 100 will be chosen. Note
116   * that a call might return fewer results than the requested page size.
117   * @opt_param string pageToken The value returned by the last
118   * `ListConversationsResponse`. This value indicates that this is a continuation
119   * of a prior `ListConversations` call and that the system should return the
120   * next page of data.
121   * @opt_param string view The level of details of the conversation. Default is
122   * `BASIC`.
123   * @return GoogleCloudContactcenterinsightsV1ListConversationsResponse
124   */
125  public function listProjectsLocationsConversations($parent, $optParams = [])
126  {
127    $params = ['parent' => $parent];
128    $params = array_merge($params, $optParams);
129    return $this->call('list', [$params], GoogleCloudContactcenterinsightsV1ListConversationsResponse::class);
130  }
131  /**
132   * Updates a conversation. (conversations.patch)
133   *
134   * @param string $name Immutable. The resource name of the conversation. Format:
135   * projects/{project}/locations/{location}/conversations/{conversation}
136   * @param GoogleCloudContactcenterinsightsV1Conversation $postBody
137   * @param array $optParams Optional parameters.
138   *
139   * @opt_param string updateMask The list of fields to be updated.
140   * @return GoogleCloudContactcenterinsightsV1Conversation
141   */
142  public function patch($name, GoogleCloudContactcenterinsightsV1Conversation $postBody, $optParams = [])
143  {
144    $params = ['name' => $name, 'postBody' => $postBody];
145    $params = array_merge($params, $optParams);
146    return $this->call('patch', [$params], GoogleCloudContactcenterinsightsV1Conversation::class);
147  }
148}
149
150// Adding a class alias for backwards compatibility with the previous class name.
151class_alias(ProjectsLocationsConversations::class, 'Google_Service_Contactcenterinsights_Resource_ProjectsLocationsConversations');
152