source: vendor/google/apiclient-services/src/SQLAdmin/Resource/Users.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[e3d4e0a]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\User;
22use Google\Service\SQLAdmin\UsersListResponse;
23
24/**
25 * The "users" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $sqladminService = new Google\Service\SQLAdmin(...);
29 * $users = $sqladminService->users;
30 * </code>
31 */
32class Users extends \Google\Service\Resource
33{
34 /**
35 * Deletes a user from a Cloud SQL instance. (users.delete)
36 *
37 * @param string $project Project ID of the project that contains the instance.
38 * @param string $instance Database instance ID. This does not include the
39 * project ID.
40 * @param array $optParams Optional parameters.
41 *
42 * @opt_param string host Host of the user in the instance.
43 * @opt_param string name Name of the user in the instance.
44 * @return Operation
45 * @throws \Google\Service\Exception
46 */
47 public function delete($project, $instance, $optParams = [])
48 {
49 $params = ['project' => $project, 'instance' => $instance];
50 $params = array_merge($params, $optParams);
51 return $this->call('delete', [$params], Operation::class);
52 }
53 /**
54 * Retrieves a resource containing information about a user. (users.get)
55 *
56 * @param string $project Project ID of the project that contains the instance.
57 * @param string $instance Database instance ID. This does not include the
58 * project ID.
59 * @param string $name User of the instance.
60 * @param array $optParams Optional parameters.
61 *
62 * @opt_param string host Host of a user of the instance.
63 * @return User
64 * @throws \Google\Service\Exception
65 */
66 public function get($project, $instance, $name, $optParams = [])
67 {
68 $params = ['project' => $project, 'instance' => $instance, 'name' => $name];
69 $params = array_merge($params, $optParams);
70 return $this->call('get', [$params], User::class);
71 }
72 /**
73 * Creates a new user in a Cloud SQL instance. (users.insert)
74 *
75 * @param string $project Project ID of the project that contains the instance.
76 * @param string $instance Database instance ID. This does not include the
77 * project ID.
78 * @param User $postBody
79 * @param array $optParams Optional parameters.
80 * @return Operation
81 * @throws \Google\Service\Exception
82 */
83 public function insert($project, $instance, User $postBody, $optParams = [])
84 {
85 $params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
86 $params = array_merge($params, $optParams);
87 return $this->call('insert', [$params], Operation::class);
88 }
89 /**
90 * Lists users in the specified Cloud SQL instance. (users.listUsers)
91 *
92 * @param string $project Project ID of the project that contains the instance.
93 * @param string $instance Database instance ID. This does not include the
94 * project ID.
95 * @param array $optParams Optional parameters.
96 * @return UsersListResponse
97 * @throws \Google\Service\Exception
98 */
99 public function listUsers($project, $instance, $optParams = [])
100 {
101 $params = ['project' => $project, 'instance' => $instance];
102 $params = array_merge($params, $optParams);
103 return $this->call('list', [$params], UsersListResponse::class);
104 }
105 /**
106 * Updates an existing user in a Cloud SQL instance. (users.update)
107 *
108 * @param string $project Project ID of the project that contains the instance.
109 * @param string $instance Database instance ID. This does not include the
110 * project ID.
111 * @param User $postBody
112 * @param array $optParams Optional parameters.
113 *
114 * @opt_param string host Optional. Host of the user in the instance.
115 * @opt_param string name Name of the user in the instance.
116 * @return Operation
117 * @throws \Google\Service\Exception
118 */
119 public function update($project, $instance, User $postBody, $optParams = [])
120 {
121 $params = ['project' => $project, 'instance' => $instance, 'postBody' => $postBody];
122 $params = array_merge($params, $optParams);
123 return $this->call('update', [$params], Operation::class);
124 }
125}
126
127// Adding a class alias for backwards compatibility with the previous class name.
128class_alias(Users::class, 'Google_Service_SQLAdmin_Resource_Users');
Note: See TracBrowser for help on using the repository browser.