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\Dfareporting\Resource;
19
20use Google\Service\Dfareporting\AccountUserProfile;
21use Google\Service\Dfareporting\AccountUserProfilesListResponse;
22
23/**
24 * The "accountUserProfiles" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $dfareportingService = new Google\Service\Dfareporting(...);
28 *   $accountUserProfiles = $dfareportingService->accountUserProfiles;
29 *  </code>
30 */
31class AccountUserProfiles extends \Google\Service\Resource
32{
33  /**
34   * Gets one account user profile by ID. (accountUserProfiles.get)
35   *
36   * @param string $profileId User profile ID associated with this request.
37   * @param string $id User profile ID.
38   * @param array $optParams Optional parameters.
39   * @return AccountUserProfile
40   */
41  public function get($profileId, $id, $optParams = [])
42  {
43    $params = ['profileId' => $profileId, 'id' => $id];
44    $params = array_merge($params, $optParams);
45    return $this->call('get', [$params], AccountUserProfile::class);
46  }
47  /**
48   * Inserts a new account user profile. (accountUserProfiles.insert)
49   *
50   * @param string $profileId User profile ID associated with this request.
51   * @param AccountUserProfile $postBody
52   * @param array $optParams Optional parameters.
53   * @return AccountUserProfile
54   */
55  public function insert($profileId, AccountUserProfile $postBody, $optParams = [])
56  {
57    $params = ['profileId' => $profileId, 'postBody' => $postBody];
58    $params = array_merge($params, $optParams);
59    return $this->call('insert', [$params], AccountUserProfile::class);
60  }
61  /**
62   * Retrieves a list of account user profiles, possibly filtered. This method
63   * supports paging. (accountUserProfiles.listAccountUserProfiles)
64   *
65   * @param string $profileId User profile ID associated with this request.
66   * @param array $optParams Optional parameters.
67   *
68   * @opt_param bool active Select only active user profiles.
69   * @opt_param string ids Select only user profiles with these IDs.
70   * @opt_param int maxResults Maximum number of results to return.
71   * @opt_param string pageToken Value of the nextPageToken from the previous
72   * result page.
73   * @opt_param string searchString Allows searching for objects by name, ID or
74   * email. Wildcards (*) are allowed. For example, "user profile*2015" will
75   * return objects with names like "user profile June 2015", "user profile April
76   * 2015", or simply "user profile 2015". Most of the searches also add wildcards
77   * implicitly at the start and the end of the search string. For example, a
78   * search string of "user profile" will match objects with name "my user
79   * profile", "user profile 2015", or simply "user profile".
80   * @opt_param string sortField Field by which to sort the list.
81   * @opt_param string sortOrder Order of sorted results.
82   * @opt_param string subaccountId Select only user profiles with the specified
83   * subaccount ID.
84   * @opt_param string userRoleId Select only user profiles with the specified
85   * user role ID.
86   * @return AccountUserProfilesListResponse
87   */
88  public function listAccountUserProfiles($profileId, $optParams = [])
89  {
90    $params = ['profileId' => $profileId];
91    $params = array_merge($params, $optParams);
92    return $this->call('list', [$params], AccountUserProfilesListResponse::class);
93  }
94  /**
95   * Updates an existing account user profile. This method supports patch
96   * semantics. (accountUserProfiles.patch)
97   *
98   * @param string $profileId User profile ID associated with this request.
99   * @param string $id AccountUserProfile ID.
100   * @param AccountUserProfile $postBody
101   * @param array $optParams Optional parameters.
102   * @return AccountUserProfile
103   */
104  public function patch($profileId, $id, AccountUserProfile $postBody, $optParams = [])
105  {
106    $params = ['profileId' => $profileId, 'id' => $id, 'postBody' => $postBody];
107    $params = array_merge($params, $optParams);
108    return $this->call('patch', [$params], AccountUserProfile::class);
109  }
110  /**
111   * Updates an existing account user profile. (accountUserProfiles.update)
112   *
113   * @param string $profileId User profile ID associated with this request.
114   * @param AccountUserProfile $postBody
115   * @param array $optParams Optional parameters.
116   * @return AccountUserProfile
117   */
118  public function update($profileId, AccountUserProfile $postBody, $optParams = [])
119  {
120    $params = ['profileId' => $profileId, 'postBody' => $postBody];
121    $params = array_merge($params, $optParams);
122    return $this->call('update', [$params], AccountUserProfile::class);
123  }
124}
125
126// Adding a class alias for backwards compatibility with the previous class name.
127class_alias(AccountUserProfiles::class, 'Google_Service_Dfareporting_Resource_AccountUserProfiles');
128