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\GoogleCloudApigeeV1DeploymentChangeReport;
21
22/**
23 * The "deployments" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $apigeeService = new Google\Service\Apigee(...);
27 *   $deployments = $apigeeService->deployments;
28 *  </code>
29 */
30class OrganizationsEnvironmentsApisRevisionsDeployments extends \Google\Service\Resource
31{
32  /**
33   * Generates a report for a dry run analysis of a DeployApiProxy request without
34   * committing the deployment. In addition to the standard validations performed
35   * when adding deployments, additional analysis will be done to detect possible
36   * traffic routing changes that would result from this deployment being created.
37   * Any potential routing conflicts or unsafe changes will be reported in the
38   * response. This routing analysis is not performed for a non-dry-run
39   * DeployApiProxy request. For a request path `organizations/{org}/environments/
40   * {env}/apis/{api}/revisions/{rev}/deployments:generateDeployChangeReport`, two
41   * permissions are required: * `apigee.deployments.create` on the resource
42   * `organizations/{org}/environments/{env}` * `apigee.proxyrevisions.deploy` on
43   * the resource `organizations/{org}/apis/{api}/revisions/{rev}`
44   * (deployments.generateDeployChangeReport)
45   *
46   * @param string $name Name of the API proxy revision deployment in the
47   * following format:
48   * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
49   * @param array $optParams Optional parameters.
50   *
51   * @opt_param bool override Flag that specifies whether to force the deployment
52   * of the new revision over the currently deployed revision by overriding
53   * conflict checks.
54   * @return GoogleCloudApigeeV1DeploymentChangeReport
55   */
56  public function generateDeployChangeReport($name, $optParams = [])
57  {
58    $params = ['name' => $name];
59    $params = array_merge($params, $optParams);
60    return $this->call('generateDeployChangeReport', [$params], GoogleCloudApigeeV1DeploymentChangeReport::class);
61  }
62  /**
63   * Generates a report for a dry run analysis of an UndeployApiProxy request
64   * without committing the undeploy. In addition to the standard validations
65   * performed when removing deployments, additional analysis will be done to
66   * detect possible traffic routing changes that would result from this
67   * deployment being removed. Any potential routing conflicts or unsafe changes
68   * will be reported in the response. This routing analysis is not performed for
69   * a non-dry-run UndeployApiProxy request. For a request path `organizations/{or
70   * g}/environments/{env}/apis/{api}/revisions/{rev}/deployments:generateUndeploy
71   * ChangeReport`, two permissions are required: * `apigee.deployments.delete` on
72   * the resource `organizations/{org}/environments/{env}` *
73   * `apigee.proxyrevisions.undeploy` on the resource
74   * `organizations/{org}/apis/{api}/revisions/{rev}`
75   * (deployments.generateUndeployChangeReport)
76   *
77   * @param string $name Name of the API proxy revision deployment in the
78   * following format:
79   * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
80   * @param array $optParams Optional parameters.
81   * @return GoogleCloudApigeeV1DeploymentChangeReport
82   */
83  public function generateUndeployChangeReport($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('generateUndeployChangeReport', [$params], GoogleCloudApigeeV1DeploymentChangeReport::class);
88  }
89}
90
91// Adding a class alias for backwards compatibility with the previous class name.
92class_alias(OrganizationsEnvironmentsApisRevisionsDeployments::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsApisRevisionsDeployments');
93