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\ListVersionsResponse; 21use Google\Service\Appengine\Operation; 22use Google\Service\Appengine\Version; 23 24/** 25 * The "versions" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $appengineService = new Google\Service\Appengine(...); 29 * $versions = $appengineService->versions; 30 * </code> 31 */ 32class AppsServicesVersions extends \Google\Service\Resource 33{ 34 /** 35 * Deploys code and resource files to a new version. (versions.create) 36 * 37 * @param string $appsId Part of `parent`. Name of the parent resource to create 38 * this version under. Example: apps/myapp/services/default. 39 * @param string $servicesId Part of `parent`. See documentation of `appsId`. 40 * @param Version $postBody 41 * @param array $optParams Optional parameters. 42 * @return Operation 43 */ 44 public function create($appsId, $servicesId, Version $postBody, $optParams = []) 45 { 46 $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'postBody' => $postBody]; 47 $params = array_merge($params, $optParams); 48 return $this->call('create', [$params], Operation::class); 49 } 50 /** 51 * Deletes an existing Version resource. (versions.delete) 52 * 53 * @param string $appsId Part of `name`. Name of the resource requested. 54 * Example: apps/myapp/services/default/versions/v1. 55 * @param string $servicesId Part of `name`. See documentation of `appsId`. 56 * @param string $versionsId Part of `name`. See documentation of `appsId`. 57 * @param array $optParams Optional parameters. 58 * @return Operation 59 */ 60 public function delete($appsId, $servicesId, $versionsId, $optParams = []) 61 { 62 $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId]; 63 $params = array_merge($params, $optParams); 64 return $this->call('delete', [$params], Operation::class); 65 } 66 /** 67 * Gets the specified Version resource. By default, only a BASIC_VIEW will be 68 * returned. Specify the FULL_VIEW parameter to get the full resource. 69 * (versions.get) 70 * 71 * @param string $appsId Part of `name`. Name of the resource requested. 72 * Example: apps/myapp/services/default/versions/v1. 73 * @param string $servicesId Part of `name`. See documentation of `appsId`. 74 * @param string $versionsId Part of `name`. See documentation of `appsId`. 75 * @param array $optParams Optional parameters. 76 * 77 * @opt_param string view Controls the set of fields returned in the Get 78 * response. 79 * @return Version 80 */ 81 public function get($appsId, $servicesId, $versionsId, $optParams = []) 82 { 83 $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId]; 84 $params = array_merge($params, $optParams); 85 return $this->call('get', [$params], Version::class); 86 } 87 /** 88 * Lists the versions of a service. (versions.listAppsServicesVersions) 89 * 90 * @param string $appsId Part of `parent`. Name of the parent Service resource. 91 * Example: apps/myapp/services/default. 92 * @param string $servicesId Part of `parent`. See documentation of `appsId`. 93 * @param array $optParams Optional parameters. 94 * 95 * @opt_param int pageSize Maximum results to return per page. 96 * @opt_param string pageToken Continuation token for fetching the next page of 97 * results. 98 * @opt_param string view Controls the set of fields returned in the List 99 * response. 100 * @return ListVersionsResponse 101 */ 102 public function listAppsServicesVersions($appsId, $servicesId, $optParams = []) 103 { 104 $params = ['appsId' => $appsId, 'servicesId' => $servicesId]; 105 $params = array_merge($params, $optParams); 106 return $this->call('list', [$params], ListVersionsResponse::class); 107 } 108 /** 109 * Updates the specified Version resource. You can specify the following fields 110 * depending on the App Engine environment and type of scaling that the version 111 * resource uses:Standard environment instance_class 112 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 113 * vices.versions#Version.FIELDS.instance_class)automatic scaling in the 114 * standard environment: automatic_scaling.min_idle_instances 115 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 116 * vices.versions#Version.FIELDS.automatic_scaling) 117 * automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs 118 * /admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_ 119 * scaling) automaticScaling.standard_scheduler_settings.max_instances 120 * (https://cloud.google.com/appengine/docs/admin- 121 * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) 122 * automaticScaling.standard_scheduler_settings.min_instances 123 * (https://cloud.google.com/appengine/docs/admin- 124 * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) 125 * automaticScaling.standard_scheduler_settings.target_cpu_utilization 126 * (https://cloud.google.com/appengine/docs/admin- 127 * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings) 128 * automaticScaling.standard_scheduler_settings.target_throughput_utilization 129 * (https://cloud.google.com/appengine/docs/admin- 130 * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)basic 131 * scaling or manual scaling in the standard environment: serving_status 132 * (https://cloud.google.com/appengine/docs/admin- 133 * api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status) 134 * manual_scaling.instances (https://cloud.google.com/appengine/docs/admin- 135 * api/reference/rest/v1/apps.services.versions#manualscaling)Flexible 136 * environment serving_status (https://cloud.google.com/appengine/docs/admin-api 137 * /reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)autom 138 * atic scaling in the flexible environment: 139 * automatic_scaling.min_total_instances 140 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 141 * vices.versions#Version.FIELDS.automatic_scaling) 142 * automatic_scaling.max_total_instances 143 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 144 * vices.versions#Version.FIELDS.automatic_scaling) 145 * automatic_scaling.cool_down_period_sec 146 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 147 * vices.versions#Version.FIELDS.automatic_scaling) 148 * automatic_scaling.cpu_utilization.target_utilization 149 * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser 150 * vices.versions#Version.FIELDS.automatic_scaling)manual scaling in the 151 * flexible environment: manual_scaling.instances 152 * (https://cloud.google.com/appengine/docs/admin- 153 * api/reference/rest/v1/apps.services.versions#manualscaling) (versions.patch) 154 * 155 * @param string $appsId Part of `name`. Name of the resource to update. 156 * Example: apps/myapp/services/default/versions/1. 157 * @param string $servicesId Part of `name`. See documentation of `appsId`. 158 * @param string $versionsId Part of `name`. See documentation of `appsId`. 159 * @param Version $postBody 160 * @param array $optParams Optional parameters. 161 * 162 * @opt_param string updateMask Standard field mask for the set of fields to be 163 * updated. 164 * @return Operation 165 */ 166 public function patch($appsId, $servicesId, $versionsId, Version $postBody, $optParams = []) 167 { 168 $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId, 'postBody' => $postBody]; 169 $params = array_merge($params, $optParams); 170 return $this->call('patch', [$params], Operation::class); 171 } 172} 173 174// Adding a class alias for backwards compatibility with the previous class name. 175class_alias(AppsServicesVersions::class, 'Google_Service_Appengine_Resource_AppsServicesVersions'); 176