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\GoogleCloudApigeeV1Deployment;
21use Google\Service\Apigee\GoogleProtobufEmpty;
22
23/**
24 * The "revisions" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $apigeeService = new Google\Service\Apigee(...);
28 *   $revisions = $apigeeService->revisions;
29 *  </code>
30 */
31class OrganizationsEnvironmentsSharedflowsRevisions extends \Google\Service\Resource
32{
33  /**
34   * Deploys a revision of a shared flow. If another revision of the same shared
35   * flow is currently deployed, set the `override` parameter to `true` to have
36   * this revision replace the currently deployed revision. You cannot use a
37   * shared flow until it has been deployed to an environment. For a request path
38   * `organizations/{org}/environments/{env}/sharedflows/{sf}/revisions/{rev}/depl
39   * oyments`, two permissions are required: * `apigee.deployments.create` on the
40   * resource `organizations/{org}/environments/{env}` *
41   * `apigee.sharedflowrevisions.deploy` on the resource
42   * `organizations/{org}/sharedflows/{sf}/revisions/{rev}` (revisions.deploy)
43   *
44   * @param string $name Required. Name of the shared flow revision to deploy in
45   * the following format: `organizations/{org}/environments/{env}/sharedflows/{sh
46   * aredflow}/revisions/{rev}`
47   * @param array $optParams Optional parameters.
48   *
49   * @opt_param bool override Flag that specifies whether the new deployment
50   * replaces other deployed revisions of the shared flow in the environment. Set
51   * `override` to `true` to replace other deployed revisions. By default,
52   * `override` is `false` and the deployment is rejected if other revisions of
53   * the shared flow are deployed in the environment.
54   * @opt_param string serviceAccount Google Cloud IAM service account. The
55   * service account represents the identity of the deployed proxy, and determines
56   * what permissions it has. The format must be
57   * `{ACCOUNT_ID}@{PROJECT}.iam.gserviceaccount.com`.
58   * @return GoogleCloudApigeeV1Deployment
59   */
60  public function deploy($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('deploy', [$params], GoogleCloudApigeeV1Deployment::class);
65  }
66  /**
67   * Gets the deployment of a shared flow revision and actual state reported by
68   * runtime pods. (revisions.getDeployments)
69   *
70   * @param string $name Required. Name representing a shared flow in an
71   * environment in the following format: `organizations/{org}/environments/{env}/
72   * sharedflows/{sharedflow}/revisions/{rev}`
73   * @param array $optParams Optional parameters.
74   * @return GoogleCloudApigeeV1Deployment
75   */
76  public function getDeployments($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('getDeployments', [$params], GoogleCloudApigeeV1Deployment::class);
81  }
82  /**
83   * Undeploys a shared flow revision from an environment. For a request path `org
84   * anizations/{org}/environments/{env}/sharedflows/{sf}/revisions/{rev}/deployme
85   * nts`, two permissions are required: * `apigee.deployments.delete` on the
86   * resource `organizations/{org}/environments/{env}` *
87   * `apigee.sharedflowrevisions.undeploy` on the resource
88   * `organizations/{org}/sharedflows/{sf}/revisions/{rev}` (revisions.undeploy)
89   *
90   * @param string $name Required. Name of the shared flow revision to undeploy in
91   * the following format: `organizations/{org}/environments/{env}/sharedflows/{sh
92   * aredflow}/revisions/{rev}`
93   * @param array $optParams Optional parameters.
94   * @return GoogleProtobufEmpty
95   */
96  public function undeploy($name, $optParams = [])
97  {
98    $params = ['name' => $name];
99    $params = array_merge($params, $optParams);
100    return $this->call('undeploy', [$params], GoogleProtobufEmpty::class);
101  }
102}
103
104// Adding a class alias for backwards compatibility with the previous class name.
105class_alias(OrganizationsEnvironmentsSharedflowsRevisions::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsSharedflowsRevisions');
106