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\Compute\Resource;
19
20use Google\Service\Compute\BulkInsertInstanceResource;
21use Google\Service\Compute\Operation;
22
23/**
24 * The "regionInstances" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $computeService = new Google\Service\Compute(...);
28 *   $regionInstances = $computeService->regionInstances;
29 *  </code>
30 */
31class RegionInstances extends \Google\Service\Resource
32{
33  /**
34   * Creates multiple instances in a given region. Count specifies the number of
35   * instances to create. (regionInstances.bulkInsert)
36   *
37   * @param string $project Project ID for this request.
38   * @param string $region The name of the region for this request.
39   * @param BulkInsertInstanceResource $postBody
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string requestId An optional request ID to identify requests.
43   * Specify a unique request ID so that if you must retry your request, the
44   * server will know to ignore the request if it has already been completed. For
45   * example, consider a situation where you make an initial request and the
46   * request times out. If you make the request again with the same request ID,
47   * the server can check if original operation with the same request ID was
48   * received, and if so, will ignore the second request. This prevents clients
49   * from accidentally creating duplicate commitments. The request ID must be a
50   * valid UUID with the exception that zero UUID is not supported (
51   * 00000000-0000-0000-0000-000000000000).
52   * @return Operation
53   */
54  public function bulkInsert($project, $region, BulkInsertInstanceResource $postBody, $optParams = [])
55  {
56    $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
57    $params = array_merge($params, $optParams);
58    return $this->call('bulkInsert', [$params], Operation::class);
59  }
60}
61
62// Adding a class alias for backwards compatibility with the previous class name.
63class_alias(RegionInstances::class, 'Google_Service_Compute_Resource_RegionInstances');
64