Show / Hide Table of Contents

Class UserServiceClient

UserService client wrapper, for convenient use.

Inheritance
object
UserServiceClient
UserServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class UserServiceClient
Remarks

Provides methods for handling User objects.

Properties

DefaultEndpoint

The default endpoint for the UserService service, which is a host of "admanager.googleapis.com" and a port of 443.

Declaration
public static string DefaultEndpoint { get; }
Property Value
Type Description
string

DefaultScopes

The default UserService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default UserService scopes are:

  • https://www.googleapis.com/auth/admanager
  • https://www.googleapis.com/auth/admanager.readonly

GrpcClient

The underlying gRPC UserService client

Declaration
public virtual UserService.UserServiceClient GrpcClient { get; }
Property Value
Type Description
UserService.UserServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

BatchActivateUsers(BatchActivateUsersRequest, CallSettings)

Activates a list of User objects.

Declaration
public virtual BatchActivateUsersResponse BatchActivateUsers(BatchActivateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
BatchActivateUsersRequest request = new BatchActivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchActivateUsersResponse response = userServiceClient.BatchActivateUsers(request);

BatchActivateUsers(NetworkName, IEnumerable<string>, CallSettings)

Activates a list of User objects.

Declaration
public virtual BatchActivateUsersResponse BatchActivateUsers(NetworkName parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = userServiceClient.BatchActivateUsers(parent, names);

BatchActivateUsers(string, IEnumerable<string>, CallSettings)

Activates a list of User objects.

Declaration
public virtual BatchActivateUsersResponse BatchActivateUsers(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = userServiceClient.BatchActivateUsers(parent, names);

BatchActivateUsersAsync(BatchActivateUsersRequest, CallSettings)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(BatchActivateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateUsersRequest request = new BatchActivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(request);

BatchActivateUsersAsync(BatchActivateUsersRequest, CancellationToken)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(BatchActivateUsersRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchActivateUsersRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateUsersRequest request = new BatchActivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(request);

BatchActivateUsersAsync(NetworkName, IEnumerable<string>, CallSettings)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(NetworkName parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(parent, names);

BatchActivateUsersAsync(NetworkName, IEnumerable<string>, CancellationToken)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(NetworkName parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(parent, names);

BatchActivateUsersAsync(string, IEnumerable<string>, CallSettings)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(parent, names);

BatchActivateUsersAsync(string, IEnumerable<string>, CancellationToken)

Activates a list of User objects.

Declaration
public virtual Task<BatchActivateUsersResponse> BatchActivateUsersAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to activate.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchActivateUsersResponse response = await userServiceClient.BatchActivateUsersAsync(parent, names);

BatchCreateUsers(BatchCreateUsersRequest, CallSettings)

Creates User objects.

Declaration
public virtual BatchCreateUsersResponse BatchCreateUsers(BatchCreateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchCreateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
BatchCreateUsersRequest request = new BatchCreateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateUserRequest(),
    },
};
// Make the request
BatchCreateUsersResponse response = userServiceClient.BatchCreateUsers(request);

BatchCreateUsers(NetworkName, IEnumerable<CreateUserRequest>, CallSettings)

Creates User objects.

Declaration
public virtual BatchCreateUsersResponse BatchCreateUsers(NetworkName parent, IEnumerable<CreateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchCreateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = userServiceClient.BatchCreateUsers(parent, requests);

BatchCreateUsers(string, IEnumerable<CreateUserRequest>, CallSettings)

Creates User objects.

Declaration
public virtual BatchCreateUsersResponse BatchCreateUsers(string parent, IEnumerable<CreateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchCreateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = userServiceClient.BatchCreateUsers(parent, requests);

BatchCreateUsersAsync(BatchCreateUsersRequest, CallSettings)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(BatchCreateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateUsersRequest request = new BatchCreateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateUserRequest(),
    },
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(request);

BatchCreateUsersAsync(BatchCreateUsersRequest, CancellationToken)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(BatchCreateUsersRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchCreateUsersRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateUsersRequest request = new BatchCreateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateUserRequest(),
    },
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(request);

BatchCreateUsersAsync(NetworkName, IEnumerable<CreateUserRequest>, CallSettings)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(NetworkName parent, IEnumerable<CreateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(parent, requests);

BatchCreateUsersAsync(NetworkName, IEnumerable<CreateUserRequest>, CancellationToken)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(NetworkName parent, IEnumerable<CreateUserRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(parent, requests);

BatchCreateUsersAsync(string, IEnumerable<CreateUserRequest>, CallSettings)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(string parent, IEnumerable<CreateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(parent, requests);

BatchCreateUsersAsync(string, IEnumerable<CreateUserRequest>, CancellationToken)

Creates User objects.

Declaration
public virtual Task<BatchCreateUsersResponse> BatchCreateUsersAsync(string parent, IEnumerable<CreateUserRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be created. Format: networks/{network_code} The parent field in the CreateUserRequest must match this field.

IEnumerable<CreateUserRequest> requests

Required. The User objects to create. A maximum of 100 objects can be created in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchCreateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateUserRequest> requests = new CreateUserRequest[]
{
    new CreateUserRequest(),
};
// Make the request
BatchCreateUsersResponse response = await userServiceClient.BatchCreateUsersAsync(parent, requests);

BatchDeactivateUsers(BatchDeactivateUsersRequest, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual BatchDeactivateUsersResponse BatchDeactivateUsers(BatchDeactivateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateUsersRequest request = new BatchDeactivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchDeactivateUsersResponse response = userServiceClient.BatchDeactivateUsers(request);

BatchDeactivateUsers(NetworkName, IEnumerable<string>, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual BatchDeactivateUsersResponse BatchDeactivateUsers(NetworkName parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = userServiceClient.BatchDeactivateUsers(parent, names);

BatchDeactivateUsers(string, IEnumerable<string>, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual BatchDeactivateUsersResponse BatchDeactivateUsers(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = userServiceClient.BatchDeactivateUsers(parent, names);

BatchDeactivateUsersAsync(BatchDeactivateUsersRequest, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(BatchDeactivateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateUsersRequest request = new BatchDeactivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(request);

BatchDeactivateUsersAsync(BatchDeactivateUsersRequest, CancellationToken)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(BatchDeactivateUsersRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchDeactivateUsersRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateUsersRequest request = new BatchDeactivateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Names = { "", },
};
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(request);

BatchDeactivateUsersAsync(NetworkName, IEnumerable<string>, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(NetworkName parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(parent, names);

BatchDeactivateUsersAsync(NetworkName, IEnumerable<string>, CancellationToken)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(NetworkName parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(parent, names);

BatchDeactivateUsersAsync(string, IEnumerable<string>, CallSettings)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(string parent, IEnumerable<string> names, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(parent, names);

BatchDeactivateUsersAsync(string, IEnumerable<string>, CancellationToken)

Deactivates a list of User objects.

Declaration
public virtual Task<BatchDeactivateUsersResponse> BatchDeactivateUsersAsync(string parent, IEnumerable<string> names, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. The resource names of the User objects to deactivate.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[] { "", };
// Make the request
BatchDeactivateUsersResponse response = await userServiceClient.BatchDeactivateUsersAsync(parent, names);

BatchUpdateUsers(BatchUpdateUsersRequest, CallSettings)

Batch updates User objects.

Declaration
public virtual BatchUpdateUsersResponse BatchUpdateUsers(BatchUpdateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchUpdateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
BatchUpdateUsersRequest request = new BatchUpdateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateUserRequest(),
    },
};
// Make the request
BatchUpdateUsersResponse response = userServiceClient.BatchUpdateUsers(request);

BatchUpdateUsers(NetworkName, IEnumerable<UpdateUserRequest>, CallSettings)

Batch updates User objects.

Declaration
public virtual BatchUpdateUsersResponse BatchUpdateUsers(NetworkName parent, IEnumerable<UpdateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchUpdateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = userServiceClient.BatchUpdateUsers(parent, requests);

BatchUpdateUsers(string, IEnumerable<UpdateUserRequest>, CallSettings)

Batch updates User objects.

Declaration
public virtual BatchUpdateUsersResponse BatchUpdateUsers(string parent, IEnumerable<UpdateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchUpdateUsersResponse

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = userServiceClient.BatchUpdateUsers(parent, requests);

BatchUpdateUsersAsync(BatchUpdateUsersRequest, CallSettings)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(BatchUpdateUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateUsersRequest request = new BatchUpdateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateUserRequest(),
    },
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(request);

BatchUpdateUsersAsync(BatchUpdateUsersRequest, CancellationToken)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(BatchUpdateUsersRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchUpdateUsersRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateUsersRequest request = new BatchUpdateUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateUserRequest(),
    },
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(request);

BatchUpdateUsersAsync(NetworkName, IEnumerable<UpdateUserRequest>, CallSettings)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(NetworkName parent, IEnumerable<UpdateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(parent, requests);

BatchUpdateUsersAsync(NetworkName, IEnumerable<UpdateUserRequest>, CancellationToken)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(NetworkName parent, IEnumerable<UpdateUserRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(parent, requests);

BatchUpdateUsersAsync(string, IEnumerable<UpdateUserRequest>, CallSettings)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(string parent, IEnumerable<UpdateUserRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(parent, requests);

BatchUpdateUsersAsync(string, IEnumerable<UpdateUserRequest>, CancellationToken)

Batch updates User objects.

Declaration
public virtual Task<BatchUpdateUsersResponse> BatchUpdateUsersAsync(string parent, IEnumerable<UpdateUserRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where Users will be updated. Format: networks/{network_code} The parent field in the UpdateUserRequest must match this field.

IEnumerable<UpdateUserRequest> requests

Required. The User objects to update. A maximum of 100 objects can be updated in a batch.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchUpdateUsersResponse>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateUserRequest> requests = new UpdateUserRequest[]
{
    new UpdateUserRequest(),
};
// Make the request
BatchUpdateUsersResponse response = await userServiceClient.BatchUpdateUsersAsync(parent, requests);

Create()

Synchronously creates a UserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserServiceClientBuilder.

Declaration
public static UserServiceClient Create()
Returns
Type Description
UserServiceClient

The created UserServiceClient.

CreateAsync(CancellationToken)

Asynchronously creates a UserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserServiceClientBuilder.

Declaration
public static Task<UserServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<UserServiceClient>

The task representing the created UserServiceClient.

CreateUser(CreateUserRequest, CallSettings)

Creates a User object.

Declaration
public virtual User CreateUser(CreateUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    User = new User(),
};
// Make the request
User response = userServiceClient.CreateUser(request);

CreateUser(NetworkName, User, CallSettings)

Creates a User object.

Declaration
public virtual User CreateUser(NetworkName parent, User user, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
User user = new User();
// Make the request
User response = userServiceClient.CreateUser(parent, user);

CreateUser(string, User, CallSettings)

Creates a User object.

Declaration
public virtual User CreateUser(string parent, User user, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
User user = new User();
// Make the request
User response = userServiceClient.CreateUser(parent, user);

CreateUserAsync(CreateUserRequest, CallSettings)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(CreateUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    User = new User(),
};
// Make the request
User response = await userServiceClient.CreateUserAsync(request);

CreateUserAsync(CreateUserRequest, CancellationToken)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateUserRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    User = new User(),
};
// Make the request
User response = await userServiceClient.CreateUserAsync(request);

CreateUserAsync(NetworkName, User, CallSettings)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(NetworkName parent, User user, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);

CreateUserAsync(NetworkName, User, CancellationToken)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(NetworkName parent, User user, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);

CreateUserAsync(string, User, CallSettings)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);

CreateUserAsync(string, User, CancellationToken)

Creates a User object.

Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The parent resource where this User will be created. Format: networks/{network_code}

User user

Required. The User to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);

GetUser(GetUserRequest, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual User GetUser(GetUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
    UserName = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]"),
};
// Make the request
User response = userServiceClient.GetUser(request);

GetUser(UserName, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual User GetUser(UserName name, CallSettings callSettings = null)
Parameters
Type Name Description
UserName name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
UserName name = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]");
// Make the request
User response = userServiceClient.GetUser(name);

GetUser(string, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual User GetUser(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/users/[USER]";
// Make the request
User response = userServiceClient.GetUser(name);

GetUserAsync(GetUserRequest, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(GetUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
    UserName = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]"),
};
// Make the request
User response = await userServiceClient.GetUserAsync(request);

GetUserAsync(GetUserRequest, CancellationToken)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(GetUserRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetUserRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
    UserName = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]"),
};
// Make the request
User response = await userServiceClient.GetUserAsync(request);

GetUserAsync(UserName, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(UserName name, CallSettings callSettings = null)
Parameters
Type Name Description
UserName name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]");
// Make the request
User response = await userServiceClient.GetUserAsync(name);

GetUserAsync(UserName, CancellationToken)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(UserName name, CancellationToken cancellationToken)
Parameters
Type Name Description
UserName name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromNetworkCodeUser("[NETWORK_CODE]", "[USER]");
// Make the request
User response = await userServiceClient.GetUserAsync(name);

GetUserAsync(string, CallSettings)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/users/[USER]";
// Make the request
User response = await userServiceClient.GetUserAsync(name);

GetUserAsync(string, CancellationToken)

Retrieves a User object.

To get the current user, the resource name networks/{networkCode}/users/me can be used.

Declaration
public virtual Task<User> GetUserAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The resource name of the User. Format: networks/{network_code}/users/{user_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/users/[USER]";
// Make the request
User response = await userServiceClient.GetUserAsync(name);

ListUsers(ListUsersRequest, CallSettings)

Lists User objects.

Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(ListUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListUsersResponse, User>

A pageable sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
ListUsersRequest request = new ListUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUsers(NetworkName, string, int?, CallSettings)

Lists User objects.

Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent, which owns this collection of Users. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListUsersResponse, User>

A pageable sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUsers(string, string, int?, CallSettings)

Lists User objects.

Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent, which owns this collection of Users. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListUsersResponse, User>

A pageable sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUsersAsync(ListUsersRequest, CallSettings)

Lists User objects.

Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(ListUsersRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListUsersRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListUsersResponse, User>

A pageable asynchronous sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
ListUsersRequest request = new ListUsersRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUsersAsync(NetworkName, string, int?, CallSettings)

Lists User objects.

Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(NetworkName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. The parent, which owns this collection of Users. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListUsersResponse, User>

A pageable asynchronous sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListUsersAsync(string, string, int?, CallSettings)

Lists User objects.

Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The parent, which owns this collection of Users. Format: networks/{network_code}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListUsersResponse, User>

A pageable asynchronous sequence of User resources.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (User item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListUsersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (User item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateUser(UpdateUserRequest, CallSettings)

Updates a User object.

Declaration
public virtual User UpdateUser(UpdateUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
    User = new User(),
    UpdateMask = new FieldMask(),
};
// Make the request
User response = userServiceClient.UpdateUser(request);

UpdateUser(User, FieldMask, CallSettings)

Updates a User object.

Declaration
public virtual User UpdateUser(User user, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
User user

Required. The User to update.

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
User

The RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = userServiceClient.UpdateUser(user, updateMask);

UpdateUserAsync(UpdateUserRequest, CallSettings)

Updates a User object.

Declaration
public virtual Task<User> UpdateUserAsync(UpdateUserRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateUserRequest request

The request object containing all of the parameters for the API call.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
    User = new User(),
    UpdateMask = new FieldMask(),
};
// Make the request
User response = await userServiceClient.UpdateUserAsync(request);

UpdateUserAsync(UpdateUserRequest, CancellationToken)

Updates a User object.

Declaration
public virtual Task<User> UpdateUserAsync(UpdateUserRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateUserRequest request

The request object containing all of the parameters for the API call.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
    User = new User(),
    UpdateMask = new FieldMask(),
};
// Make the request
User response = await userServiceClient.UpdateUserAsync(request);

UpdateUserAsync(User, FieldMask, CallSettings)

Updates a User object.

Declaration
public virtual Task<User> UpdateUserAsync(User user, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
User user

Required. The User to update.

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = await userServiceClient.UpdateUserAsync(user, updateMask);

UpdateUserAsync(User, FieldMask, CancellationToken)

Updates a User object.

Declaration
public virtual Task<User> UpdateUserAsync(User user, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
User user

Required. The User to update.

FieldMask updateMask

Optional. The list of fields to update.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<User>

A Task containing the RPC response.

Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = await userServiceClient.UpdateUserAsync(user, updateMask);
In this article
Back to top Generated by DocFX