Reference documentation and code samples for the Google Ads Ad Manager V1 Client class UserServiceClient.
Service Description: Provides methods for handling User objects.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Ads \ AdManager \ V1 \ ClientMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
options |
array|Google\ApiCore\Options\ClientOptions
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
Google\Auth\FetchAuthTokenInterface|Google\ApiCore\CredentialsWrapper
This option should only be used with a pre-constructed Google\Auth\FetchAuthTokenInterface or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important: If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|Google\ApiCore\Transport\TransportInterface
The transport used for executing network requests. At the moment, supports only |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'rest' => [...], ]; See the Google\ApiCore\Transport\RestTransport::build() method for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
↳ logger |
false|Psr\Log\LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
↳ universeDomain |
string
The service domain for the client. Defaults to 'googleapis.com'. |
batchActivateUsers
Activates a list of User objects.
The async variant is UserServiceClient::batchActivateUsersAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchActivateUsersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\BatchActivateUsersResponse |
|
use Google\Ads\AdManager\V1\BatchActivateUsersRequest;
use Google\Ads\AdManager\V1\BatchActivateUsersResponse;
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\ApiCore\ApiException;
/**
* @param string $formattedParent Format: `networks/{network_code}`
* Please see {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $namesElement The resource names of the `User` objects to activate.
*/
function batch_activate_users_sample(string $formattedParent, string $namesElement): void
{
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$names = [$namesElement];
$request = (new BatchActivateUsersRequest())
->setParent($formattedParent)
->setNames($names);
// Call the API and handle any network failures.
try {
/** @var BatchActivateUsersResponse $response */
$response = $userServiceClient->batchActivateUsers($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
$namesElement = '[NAMES]';
batch_activate_users_sample($formattedParent, $namesElement);
}
batchCreateUsers
Creates User objects.
The async variant is UserServiceClient::batchCreateUsersAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchCreateUsersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\BatchCreateUsersResponse |
|
use Google\Ads\AdManager\V1\BatchCreateUsersRequest;
use Google\Ads\AdManager\V1\BatchCreateUsersResponse;
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\CreateUserRequest;
use Google\Ads\AdManager\V1\User;
use Google\ApiCore\ApiException;
/**
* @param string $formattedParent The parent resource where `Users` will be created.
* Format: `networks/{network_code}`
* The parent field in the CreateUserRequest must match this
* field. Please see
* {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $formattedRequestsParent The parent resource where this `User` will be created.
* Format: `networks/{network_code}`
* Please see {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $requestsUserDisplayName The name of the User. It has a maximum length of 128 characters.
* @param string $requestsUserEmail The email or login of the User. In order to create a new user,
* you must already have a Google Account.
* @param string $formattedRequestsUserRole The unique Role ID of the User. Roles that are created by Google
* will have negative IDs. Please see
* {@see UserServiceClient::roleName()} for help formatting this field.
*/
function batch_create_users_sample(
string $formattedParent,
string $formattedRequestsParent,
string $requestsUserDisplayName,
string $requestsUserEmail,
string $formattedRequestsUserRole
): void {
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$requestsUser = (new User())
->setDisplayName($requestsUserDisplayName)
->setEmail($requestsUserEmail)
->setRole($formattedRequestsUserRole);
$createUserRequest = (new CreateUserRequest())
->setParent($formattedRequestsParent)
->setUser($requestsUser);
$requests = [$createUserRequest];
$request = (new BatchCreateUsersRequest())
->setParent($formattedParent)
->setRequests($requests);
// Call the API and handle any network failures.
try {
/** @var BatchCreateUsersResponse $response */
$response = $userServiceClient->batchCreateUsers($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
$formattedRequestsParent = UserServiceClient::networkName('[NETWORK_CODE]');
$requestsUserDisplayName = '[DISPLAY_NAME]';
$requestsUserEmail = '[EMAIL]';
$formattedRequestsUserRole = UserServiceClient::roleName('[NETWORK_CODE]', '[ROLE]');
batch_create_users_sample(
$formattedParent,
$formattedRequestsParent,
$requestsUserDisplayName,
$requestsUserEmail,
$formattedRequestsUserRole
);
}
batchDeactivateUsers
Deactivates a list of User objects.
The async variant is UserServiceClient::batchDeactivateUsersAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchDeactivateUsersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\BatchDeactivateUsersResponse |
|
use Google\Ads\AdManager\V1\BatchDeactivateUsersRequest;
use Google\Ads\AdManager\V1\BatchDeactivateUsersResponse;
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\ApiCore\ApiException;
/**
* @param string $formattedParent Format: `networks/{network_code}`
* Please see {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $namesElement The resource names of the `User` objects to deactivate.
*/
function batch_deactivate_users_sample(string $formattedParent, string $namesElement): void
{
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$names = [$namesElement];
$request = (new BatchDeactivateUsersRequest())
->setParent($formattedParent)
->setNames($names);
// Call the API and handle any network failures.
try {
/** @var BatchDeactivateUsersResponse $response */
$response = $userServiceClient->batchDeactivateUsers($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
$namesElement = '[NAMES]';
batch_deactivate_users_sample($formattedParent, $namesElement);
}
batchUpdateUsers
Batch updates User objects.
The async variant is UserServiceClient::batchUpdateUsersAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchUpdateUsersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\BatchUpdateUsersResponse |
|
use Google\Ads\AdManager\V1\BatchUpdateUsersRequest;
use Google\Ads\AdManager\V1\BatchUpdateUsersResponse;
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\UpdateUserRequest;
use Google\Ads\AdManager\V1\User;
use Google\ApiCore\ApiException;
/**
* @param string $formattedParent The parent resource where `Users` will be updated.
* Format: `networks/{network_code}`
* The parent field in the UpdateUserRequest must match this
* field. Please see
* {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $requestsUserDisplayName The name of the User. It has a maximum length of 128 characters.
* @param string $requestsUserEmail The email or login of the User. In order to create a new user,
* you must already have a Google Account.
* @param string $formattedRequestsUserRole The unique Role ID of the User. Roles that are created by Google
* will have negative IDs. Please see
* {@see UserServiceClient::roleName()} for help formatting this field.
*/
function batch_update_users_sample(
string $formattedParent,
string $requestsUserDisplayName,
string $requestsUserEmail,
string $formattedRequestsUserRole
): void {
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$requestsUser = (new User())
->setDisplayName($requestsUserDisplayName)
->setEmail($requestsUserEmail)
->setRole($formattedRequestsUserRole);
$updateUserRequest = (new UpdateUserRequest())
->setUser($requestsUser);
$requests = [$updateUserRequest];
$request = (new BatchUpdateUsersRequest())
->setParent($formattedParent)
->setRequests($requests);
// Call the API and handle any network failures.
try {
/** @var BatchUpdateUsersResponse $response */
$response = $userServiceClient->batchUpdateUsers($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
$requestsUserDisplayName = '[DISPLAY_NAME]';
$requestsUserEmail = '[EMAIL]';
$formattedRequestsUserRole = UserServiceClient::roleName('[NETWORK_CODE]', '[ROLE]');
batch_update_users_sample(
$formattedParent,
$requestsUserDisplayName,
$requestsUserEmail,
$formattedRequestsUserRole
);
}
createUser
Creates a User object.
The async variant is UserServiceClient::createUserAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\CreateUserRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\User |
|
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\CreateUserRequest;
use Google\Ads\AdManager\V1\User;
use Google\ApiCore\ApiException;
/**
* @param string $formattedParent The parent resource where this `User` will be created.
* Format: `networks/{network_code}`
* Please see {@see UserServiceClient::networkName()} for help formatting this field.
* @param string $userDisplayName The name of the User. It has a maximum length of 128 characters.
* @param string $userEmail The email or login of the User. In order to create a new user,
* you must already have a Google Account.
* @param string $formattedUserRole The unique Role ID of the User. Roles that are created by Google
* will have negative IDs. Please see
* {@see UserServiceClient::roleName()} for help formatting this field.
*/
function create_user_sample(
string $formattedParent,
string $userDisplayName,
string $userEmail,
string $formattedUserRole
): void {
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$user = (new User())
->setDisplayName($userDisplayName)
->setEmail($userEmail)
->setRole($formattedUserRole);
$request = (new CreateUserRequest())
->setParent($formattedParent)
->setUser($user);
// Call the API and handle any network failures.
try {
/** @var User $response */
$response = $userServiceClient->createUser($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
$userDisplayName = '[DISPLAY_NAME]';
$userEmail = '[EMAIL]';
$formattedUserRole = UserServiceClient::roleName('[NETWORK_CODE]', '[ROLE]');
create_user_sample($formattedParent, $userDisplayName, $userEmail, $formattedUserRole);
}
getUser
Retrieves a User object.
To get the current user, the resource name
networks/{networkCode}/users/me can be used.
The async variant is UserServiceClient::getUserAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\GetUserRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\User |
|
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\GetUserRequest;
use Google\Ads\AdManager\V1\User;
use Google\ApiCore\ApiException;
/**
* @param string $formattedName The resource name of the User.
* Format: `networks/{network_code}/users/{user_id}`
* Please see {@see UserServiceClient::userName()} for help formatting this field.
*/
function get_user_sample(string $formattedName): void
{
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$request = (new GetUserRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var User $response */
$response = $userServiceClient->getUser($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = UserServiceClient::userName('[NETWORK_CODE]', '[USER]');
get_user_sample($formattedName);
}
listUsers
Lists User objects.
The async variant is UserServiceClient::listUsersAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\ListUsersRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\ApiCore\PagedListResponse |
|
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\ListUsersRequest;
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
/**
* @param string $formattedParent The parent, which owns this collection of Users.
* Format: `networks/{network_code}`
* Please see {@see UserServiceClient::networkName()} for help formatting this field.
*/
function list_users_sample(string $formattedParent): void
{
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$request = (new ListUsersRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $userServiceClient->listUsers($request);
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = UserServiceClient::networkName('[NETWORK_CODE]');
list_users_sample($formattedParent);
}
updateUser
Updates a User object.
The async variant is UserServiceClient::updateUserAsync() .
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\UpdateUserRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
Google\ApiCore\RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
| Returns | |
|---|---|
| Type | Description |
Google\Ads\AdManager\V1\User |
|
use Google\Ads\AdManager\V1\Client\UserServiceClient;
use Google\Ads\AdManager\V1\UpdateUserRequest;
use Google\Ads\AdManager\V1\User;
use Google\ApiCore\ApiException;
/**
* @param string $userDisplayName The name of the User. It has a maximum length of 128 characters.
* @param string $userEmail The email or login of the User. In order to create a new user,
* you must already have a Google Account.
* @param string $formattedUserRole The unique Role ID of the User. Roles that are created by Google
* will have negative IDs. Please see
* {@see UserServiceClient::roleName()} for help formatting this field.
*/
function update_user_sample(
string $userDisplayName,
string $userEmail,
string $formattedUserRole
): void {
// Create a client.
$userServiceClient = new UserServiceClient();
// Prepare the request message.
$user = (new User())
->setDisplayName($userDisplayName)
->setEmail($userEmail)
->setRole($formattedUserRole);
$request = (new UpdateUserRequest())
->setUser($user);
// Call the API and handle any network failures.
try {
/** @var User $response */
$response = $userServiceClient->updateUser($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$userDisplayName = '[DISPLAY_NAME]';
$userEmail = '[EMAIL]';
$formattedUserRole = UserServiceClient::roleName('[NETWORK_CODE]', '[ROLE]');
update_user_sample($userDisplayName, $userEmail, $formattedUserRole);
}
batchActivateUsersAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchActivateUsersRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchActivateUsersResponse> |
|
batchCreateUsersAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchCreateUsersRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchCreateUsersResponse> |
|
batchDeactivateUsersAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchDeactivateUsersRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchDeactivateUsersResponse> |
|
batchUpdateUsersAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\BatchUpdateUsersRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\BatchUpdateUsersResponse> |
|
createUserAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\CreateUserRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\User> |
|
getUserAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\GetUserRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\User> |
|
listUsersAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\ListUsersRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
|
updateUserAsync
| Parameters | |
|---|---|
| Name | Description |
request |
Google\Ads\AdManager\V1\UpdateUserRequest
|
optionalArgs |
array
|
| Returns | |
|---|---|
| Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Ads\AdManager\V1\User> |
|
static::networkName
Formats a string containing the fully-qualified path to represent a network resource.
| Parameter | |
|---|---|
| Name | Description |
networkCode |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted network resource. |
static::roleName
Formats a string containing the fully-qualified path to represent a role resource.
| Parameters | |
|---|---|
| Name | Description |
networkCode |
string
|
role |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted role resource. |
static::userName
Formats a string containing the fully-qualified path to represent a user resource.
| Parameters | |
|---|---|
| Name | Description |
networkCode |
string
|
user |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
The formatted user resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- network: networks/{network_code}
- role: networks/{network_code}/roles/{role}
- user: networks/{network_code}/users/{user}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
| Parameters | |
|---|---|
| Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
| Returns | |
|---|---|
| Type | Description |
array |
An associative array from name component IDs to component values. |