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\Appengine\Resource;
19
20use Google\Service\Appengine\ListServicesResponse;
21use Google\Service\Appengine\Operation;
22use Google\Service\Appengine\Service;
23
24/**
25 * The "services" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $appengineService = new Google\Service\Appengine(...);
29 *   $services = $appengineService->services;
30 *  </code>
31 */
32class AppsServices extends \Google\Service\Resource
33{
34  /**
35   * Deletes the specified service and all enclosed versions. (services.delete)
36   *
37   * @param string $appsId Part of `name`. Name of the resource requested.
38   * Example: apps/myapp/services/default.
39   * @param string $servicesId Part of `name`. See documentation of `appsId`.
40   * @param array $optParams Optional parameters.
41   * @return Operation
42   */
43  public function delete($appsId, $servicesId, $optParams = [])
44  {
45    $params = ['appsId' => $appsId, 'servicesId' => $servicesId];
46    $params = array_merge($params, $optParams);
47    return $this->call('delete', [$params], Operation::class);
48  }
49  /**
50   * Gets the current configuration of the specified service. (services.get)
51   *
52   * @param string $appsId Part of `name`. Name of the resource requested.
53   * Example: apps/myapp/services/default.
54   * @param string $servicesId Part of `name`. See documentation of `appsId`.
55   * @param array $optParams Optional parameters.
56   * @return Service
57   */
58  public function get($appsId, $servicesId, $optParams = [])
59  {
60    $params = ['appsId' => $appsId, 'servicesId' => $servicesId];
61    $params = array_merge($params, $optParams);
62    return $this->call('get', [$params], Service::class);
63  }
64  /**
65   * Lists all the services in the application. (services.listAppsServices)
66   *
67   * @param string $appsId Part of `parent`. Name of the parent Application
68   * resource. Example: apps/myapp.
69   * @param array $optParams Optional parameters.
70   *
71   * @opt_param int pageSize Maximum results to return per page.
72   * @opt_param string pageToken Continuation token for fetching the next page of
73   * results.
74   * @return ListServicesResponse
75   */
76  public function listAppsServices($appsId, $optParams = [])
77  {
78    $params = ['appsId' => $appsId];
79    $params = array_merge($params, $optParams);
80    return $this->call('list', [$params], ListServicesResponse::class);
81  }
82  /**
83   * Updates the configuration of the specified service. (services.patch)
84   *
85   * @param string $appsId Part of `name`. Name of the resource to update.
86   * Example: apps/myapp/services/default.
87   * @param string $servicesId Part of `name`. See documentation of `appsId`.
88   * @param Service $postBody
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param bool migrateTraffic Set to true to gradually shift traffic to one
92   * or more versions that you specify. By default, traffic is shifted
93   * immediately. For gradual traffic migration, the target versions must be
94   * located within instances that are configured for both warmup requests
95   * (https://cloud.google.com/appengine/docs/admin-
96   * api/reference/rest/v1/apps.services.versions#InboundServiceType) and
97   * automatic scaling (https://cloud.google.com/appengine/docs/admin-
98   * api/reference/rest/v1/apps.services.versions#AutomaticScaling). You must
99   * specify the shardBy (https://cloud.google.com/appengine/docs/admin-
100   * api/reference/rest/v1/apps.services#ShardBy) field in the Service resource.
101   * Gradual traffic migration is not supported in the App Engine flexible
102   * environment. For examples, see Migrating and Splitting Traffic
103   * (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-
104   * traffic).
105   * @opt_param string updateMask Required. Standard field mask for the set of
106   * fields to be updated.
107   * @return Operation
108   */
109  public function patch($appsId, $servicesId, Service $postBody, $optParams = [])
110  {
111    $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'postBody' => $postBody];
112    $params = array_merge($params, $optParams);
113    return $this->call('patch', [$params], Operation::class);
114  }
115}
116
117// Adding a class alias for backwards compatibility with the previous class name.
118class_alias(AppsServices::class, 'Google_Service_Appengine_Resource_AppsServices');
119