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\SQLAdmin\Resource;
19
20use Google\Service\SQLAdmin\Operation;
21use Google\Service\SQLAdmin\SqlInstancesRescheduleMaintenanceRequestBody;
22use Google\Service\SQLAdmin\SqlInstancesStartExternalSyncRequest;
23use Google\Service\SQLAdmin\SqlInstancesVerifyExternalSyncSettingsRequest;
24use Google\Service\SQLAdmin\SqlInstancesVerifyExternalSyncSettingsResponse;
25
26/**
27 * The "instances" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $sqladminService = new Google\Service\SQLAdmin(...);
31 *   $instances = $sqladminService->instances;
32 *  </code>
33 */
34class ProjectsInstances extends \Google\Service\Resource
35{
36  /**
37   * Reschedules the maintenance on the given instance.
38   * (instances.rescheduleMaintenance)
39   *
40   * @param string $project ID of the project that contains the instance.
41   * @param string $instance Cloud SQL instance ID. This does not include the
42   * project ID.
43   * @param SqlInstancesRescheduleMaintenanceRequestBody $postBody
44   * @param array $optParams Optional parameters.
45   * @return Operation
46   */
47  public function rescheduleMaintenance($project, $instance, SqlInstancesRescheduleMaintenanceRequestBody $postBody, $optParams = [])
48  {
49    $params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('rescheduleMaintenance', [$params], Operation::class);
52  }
53  /**
54   * Start External primary instance migration. (instances.startExternalSync)
55   *
56   * @param string $project ID of the project that contains the instance.
57   * @param string $instance Cloud SQL instance ID. This does not include the
58   * project ID.
59   * @param SqlInstancesStartExternalSyncRequest $postBody
60   * @param array $optParams Optional parameters.
61   * @return Operation
62   */
63  public function startExternalSync($project, $instance, SqlInstancesStartExternalSyncRequest $postBody, $optParams = [])
64  {
65    $params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
66    $params = array_merge($params, $optParams);
67    return $this->call('startExternalSync', [$params], Operation::class);
68  }
69  /**
70   * Verify External primary instance external sync settings.
71   * (instances.verifyExternalSyncSettings)
72   *
73   * @param string $project Project ID of the project that contains the instance.
74   * @param string $instance Cloud SQL instance ID. This does not include the
75   * project ID.
76   * @param SqlInstancesVerifyExternalSyncSettingsRequest $postBody
77   * @param array $optParams Optional parameters.
78   * @return SqlInstancesVerifyExternalSyncSettingsResponse
79   */
80  public function verifyExternalSyncSettings($project, $instance, SqlInstancesVerifyExternalSyncSettingsRequest $postBody, $optParams = [])
81  {
82    $params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
83    $params = array_merge($params, $optParams);
84    return $this->call('verifyExternalSyncSettings', [$params], SqlInstancesVerifyExternalSyncSettingsResponse::class);
85  }
86}
87
88// Adding a class alias for backwards compatibility with the previous class name.
89class_alias(ProjectsInstances::class, 'Google_Service_SQLAdmin_Resource_ProjectsInstances');
90