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\Apigee\Resource;
19
20use Google\Service\Apigee\GoogleCloudApigeeV1FlowHook;
21
22/**
23 * The "flowhooks" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $apigeeService = new Google\Service\Apigee(...);
27 *   $flowhooks = $apigeeService->flowhooks;
28 *  </code>
29 */
30class OrganizationsEnvironmentsFlowhooks extends \Google\Service\Resource
31{
32  /**
33   * Attaches a shared flow to a flow hook. (flowhooks.attachSharedFlowToFlowHook)
34   *
35   * @param string $name Required. Name of the flow hook to which the shared flow
36   * should be attached in the following format:
37   * `organizations/{org}/environments/{env}/flowhooks/{flowhook}`
38   * @param GoogleCloudApigeeV1FlowHook $postBody
39   * @param array $optParams Optional parameters.
40   * @return GoogleCloudApigeeV1FlowHook
41   */
42  public function attachSharedFlowToFlowHook($name, GoogleCloudApigeeV1FlowHook $postBody, $optParams = [])
43  {
44    $params = ['name' => $name, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('attachSharedFlowToFlowHook', [$params], GoogleCloudApigeeV1FlowHook::class);
47  }
48  /**
49   * Detaches a shared flow from a flow hook.
50   * (flowhooks.detachSharedFlowFromFlowHook)
51   *
52   * @param string $name Required. Name of the flow hook to detach in the
53   * following format:
54   * `organizations/{org}/environments/{env}/flowhooks/{flowhook}`
55   * @param array $optParams Optional parameters.
56   * @return GoogleCloudApigeeV1FlowHook
57   */
58  public function detachSharedFlowFromFlowHook($name, $optParams = [])
59  {
60    $params = ['name' => $name];
61    $params = array_merge($params, $optParams);
62    return $this->call('detachSharedFlowFromFlowHook', [$params], GoogleCloudApigeeV1FlowHook::class);
63  }
64  /**
65   * Returns the name of the shared flow attached to the specified flow hook. If
66   * there's no shared flow attached to the flow hook, the API does not return an
67   * error; it simply does not return a name in the response. (flowhooks.get)
68   *
69   * @param string $name Required. Name of the flow hook in the following format:
70   * `organizations/{org}/environments/{env}/flowhooks/{flowhook}`
71   * @param array $optParams Optional parameters.
72   * @return GoogleCloudApigeeV1FlowHook
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], GoogleCloudApigeeV1FlowHook::class);
79  }
80}
81
82// Adding a class alias for backwards compatibility with the previous class name.
83class_alias(OrganizationsEnvironmentsFlowhooks::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsFlowhooks');
84