[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Dialogflow\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListWebhooksResponse;
|
---|
| 21 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3Webhook;
|
---|
| 22 | use Google\Service\Dialogflow\GoogleProtobufEmpty;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "webhooks" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $dialogflowService = new Google\Service\Dialogflow(...);
|
---|
| 29 | * $webhooks = $dialogflowService->projects_locations_agents_webhooks;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsAgentsWebhooks extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a webhook in the specified agent. (webhooks.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The agent to create a webhook for. Format:
|
---|
| 38 | * `projects//locations//agents/`.
|
---|
| 39 | * @param GoogleCloudDialogflowCxV3Webhook $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | * @return GoogleCloudDialogflowCxV3Webhook
|
---|
| 42 | * @throws \Google\Service\Exception
|
---|
| 43 | */
|
---|
| 44 | public function create($parent, GoogleCloudDialogflowCxV3Webhook $postBody, $optParams = [])
|
---|
| 45 | {
|
---|
| 46 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 47 | $params = array_merge($params, $optParams);
|
---|
| 48 | return $this->call('create', [$params], GoogleCloudDialogflowCxV3Webhook::class);
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * Deletes the specified webhook. (webhooks.delete)
|
---|
| 52 | *
|
---|
| 53 | * @param string $name Required. The name of the webhook to delete. Format:
|
---|
| 54 | * `projects//locations//agents//webhooks/`.
|
---|
| 55 | * @param array $optParams Optional parameters.
|
---|
| 56 | *
|
---|
| 57 | * @opt_param bool force This field has no effect for webhook not being used.
|
---|
| 58 | * For webhooks that are used by pages/flows/transition route groups: * If
|
---|
| 59 | * `force` is set to false, an error will be returned with message indicating
|
---|
| 60 | * the referenced resources. * If `force` is set to true, Dialogflow will remove
|
---|
| 61 | * the webhook, as well as any references to the webhook (i.e. Webhook and tagin
|
---|
| 62 | * fulfillments that point to this webhook will be removed).
|
---|
| 63 | * @return GoogleProtobufEmpty
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function delete($name, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['name' => $name];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * Retrieves the specified webhook. (webhooks.get)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. The name of the webhook. Format:
|
---|
| 76 | * `projects//locations//agents//webhooks/`.
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | * @return GoogleCloudDialogflowCxV3Webhook
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function get($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('get', [$params], GoogleCloudDialogflowCxV3Webhook::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Returns the list of all webhooks in the specified agent.
|
---|
| 89 | * (webhooks.listProjectsLocationsAgentsWebhooks)
|
---|
| 90 | *
|
---|
| 91 | * @param string $parent Required. The agent to list all webhooks for. Format:
|
---|
| 92 | * `projects//locations//agents/`.
|
---|
| 93 | * @param array $optParams Optional parameters.
|
---|
| 94 | *
|
---|
| 95 | * @opt_param int pageSize The maximum number of items to return in a single
|
---|
| 96 | * page. By default 100 and at most 1000.
|
---|
| 97 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 98 | * previous list request.
|
---|
| 99 | * @return GoogleCloudDialogflowCxV3ListWebhooksResponse
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function listProjectsLocationsAgentsWebhooks($parent, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['parent' => $parent];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListWebhooksResponse::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Updates the specified webhook. (webhooks.patch)
|
---|
| 110 | *
|
---|
| 111 | * @param string $name The unique identifier of the webhook. Required for the
|
---|
| 112 | * Webhooks.UpdateWebhook method. Webhooks.CreateWebhook populates the name
|
---|
| 113 | * automatically. Format: `projects//locations//agents//webhooks/`.
|
---|
| 114 | * @param GoogleCloudDialogflowCxV3Webhook $postBody
|
---|
| 115 | * @param array $optParams Optional parameters.
|
---|
| 116 | *
|
---|
| 117 | * @opt_param string updateMask The mask to control which fields get updated. If
|
---|
| 118 | * the mask is not present, all fields will be updated.
|
---|
| 119 | * @return GoogleCloudDialogflowCxV3Webhook
|
---|
| 120 | * @throws \Google\Service\Exception
|
---|
| 121 | */
|
---|
| 122 | public function patch($name, GoogleCloudDialogflowCxV3Webhook $postBody, $optParams = [])
|
---|
| 123 | {
|
---|
| 124 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 125 | $params = array_merge($params, $optParams);
|
---|
| 126 | return $this->call('patch', [$params], GoogleCloudDialogflowCxV3Webhook::class);
|
---|
| 127 | }
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 131 | class_alias(ProjectsLocationsAgentsWebhooks::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsWebhooks');
|
---|