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\BigtableAdmin\Resource;
19
20use Google\Service\BigtableAdmin\AppProfile;
21use Google\Service\BigtableAdmin\BigtableadminEmpty;
22use Google\Service\BigtableAdmin\ListAppProfilesResponse;
23use Google\Service\BigtableAdmin\Operation;
24
25/**
26 * The "appProfiles" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $bigtableadminService = new Google\Service\BigtableAdmin(...);
30 *   $appProfiles = $bigtableadminService->appProfiles;
31 *  </code>
32 */
33class ProjectsInstancesAppProfiles extends \Google\Service\Resource
34{
35  /**
36   * Creates an app profile within an instance. (appProfiles.create)
37   *
38   * @param string $parent Required. The unique name of the instance in which to
39   * create the new app profile. Values are of the form
40   * `projects/{project}/instances/{instance}`.
41   * @param AppProfile $postBody
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param string appProfileId Required. The ID to be used when referring to
45   * the new app profile within its instance, e.g., just `myprofile` rather than
46   * `projects/myproject/instances/myinstance/appProfiles/myprofile`.
47   * @opt_param bool ignoreWarnings If true, ignore safety checks when creating
48   * the app profile.
49   * @return AppProfile
50   */
51  public function create($parent, AppProfile $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('create', [$params], AppProfile::class);
56  }
57  /**
58   * Deletes an app profile from an instance. (appProfiles.delete)
59   *
60   * @param string $name Required. The unique name of the app profile to be
61   * deleted. Values are of the form
62   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
63   * @param array $optParams Optional parameters.
64   *
65   * @opt_param bool ignoreWarnings Required. If true, ignore safety checks when
66   * deleting the app profile.
67   * @return BigtableadminEmpty
68   */
69  public function delete($name, $optParams = [])
70  {
71    $params = ['name' => $name];
72    $params = array_merge($params, $optParams);
73    return $this->call('delete', [$params], BigtableadminEmpty::class);
74  }
75  /**
76   * Gets information about an app profile. (appProfiles.get)
77   *
78   * @param string $name Required. The unique name of the requested app profile.
79   * Values are of the form
80   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
81   * @param array $optParams Optional parameters.
82   * @return AppProfile
83   */
84  public function get($name, $optParams = [])
85  {
86    $params = ['name' => $name];
87    $params = array_merge($params, $optParams);
88    return $this->call('get', [$params], AppProfile::class);
89  }
90  /**
91   * Lists information about app profiles in an instance.
92   * (appProfiles.listProjectsInstancesAppProfiles)
93   *
94   * @param string $parent Required. The unique name of the instance for which a
95   * list of app profiles is requested. Values are of the form
96   * `projects/{project}/instances/{instance}`. Use `{instance} = '-'` to list
97   * AppProfiles for all Instances in a project, e.g.,
98   * `projects/myproject/instances/-`.
99   * @param array $optParams Optional parameters.
100   *
101   * @opt_param int pageSize Maximum number of results per page. A page_size of
102   * zero lets the server choose the number of items to return. A page_size which
103   * is strictly positive will return at most that many items. A negative
104   * page_size will cause an error. Following the first request, subsequent
105   * paginated calls are not required to pass a page_size. If a page_size is set
106   * in subsequent calls, it must match the page_size given in the first request.
107   * @opt_param string pageToken The value of `next_page_token` returned by a
108   * previous call.
109   * @return ListAppProfilesResponse
110   */
111  public function listProjectsInstancesAppProfiles($parent, $optParams = [])
112  {
113    $params = ['parent' => $parent];
114    $params = array_merge($params, $optParams);
115    return $this->call('list', [$params], ListAppProfilesResponse::class);
116  }
117  /**
118   * Updates an app profile within an instance. (appProfiles.patch)
119   *
120   * @param string $name The unique name of the app profile. Values are of the
121   * form `projects/{project}/instances/{instance}/appProfiles/_a-zA-Z0-9*`.
122   * @param AppProfile $postBody
123   * @param array $optParams Optional parameters.
124   *
125   * @opt_param bool ignoreWarnings If true, ignore safety checks when updating
126   * the app profile.
127   * @opt_param string updateMask Required. The subset of app profile fields which
128   * should be replaced. If unset, all fields will be replaced.
129   * @return Operation
130   */
131  public function patch($name, AppProfile $postBody, $optParams = [])
132  {
133    $params = ['name' => $name, 'postBody' => $postBody];
134    $params = array_merge($params, $optParams);
135    return $this->call('patch', [$params], Operation::class);
136  }
137}
138
139// Adding a class alias for backwards compatibility with the previous class name.
140class_alias(ProjectsInstancesAppProfiles::class, 'Google_Service_BigtableAdmin_Resource_ProjectsInstancesAppProfiles');
141