Show / Hide Table of Contents

Class CustomTargetingKeyServiceClient

CustomTargetingKeyService client wrapper, for convenient use.

Inheritance
object
CustomTargetingKeyServiceClient
CustomTargetingKeyServiceClientImpl
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 CustomTargetingKeyServiceClient
Remarks

Provides methods for handling CustomTargetingKey objects.

Properties

DefaultEndpoint

The default endpoint for the CustomTargetingKeyService 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 CustomTargetingKeyService scopes.

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

The default CustomTargetingKeyService scopes are:

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

GrpcClient

The underlying gRPC CustomTargetingKeyService client

Declaration
public virtual CustomTargetingKeyService.CustomTargetingKeyServiceClient GrpcClient { get; }
Property Value
Type Description
CustomTargetingKeyService.CustomTargetingKeyServiceClient

ServiceMetadata

The service metadata associated with this client type.

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

Methods

BatchActivateCustomTargetingKeys(BatchActivateCustomTargetingKeysRequest, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual BatchActivateCustomTargetingKeysResponse BatchActivateCustomTargetingKeys(BatchActivateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateCustomTargetingKeysRequest 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
BatchActivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
BatchActivateCustomTargetingKeysRequest request = new BatchActivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchActivateCustomTargetingKeys(request);

BatchActivateCustomTargetingKeys(NetworkName, IEnumerable<CustomTargetingKeyName>, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual BatchActivateCustomTargetingKeysResponse BatchActivateCustomTargetingKeys(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchActivateCustomTargetingKeys(parent, names);

BatchActivateCustomTargetingKeys(string, IEnumerable<string>, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual BatchActivateCustomTargetingKeysResponse BatchActivateCustomTargetingKeys(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 CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchActivateCustomTargetingKeys(parent, names);

BatchActivateCustomTargetingKeysAsync(BatchActivateCustomTargetingKeysRequest, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(BatchActivateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateCustomTargetingKeysRequest 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<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateCustomTargetingKeysRequest request = new BatchActivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(request);

BatchActivateCustomTargetingKeysAsync(BatchActivateCustomTargetingKeysRequest, CancellationToken)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(BatchActivateCustomTargetingKeysRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchActivateCustomTargetingKeysRequest 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<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateCustomTargetingKeysRequest request = new BatchActivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(request);

BatchActivateCustomTargetingKeysAsync(NetworkName, IEnumerable<CustomTargetingKeyName>, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(parent, names);

BatchActivateCustomTargetingKeysAsync(NetworkName, IEnumerable<CustomTargetingKeyName>, CancellationToken)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(parent, names);

BatchActivateCustomTargetingKeysAsync(string, IEnumerable<string>, CallSettings)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(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 CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(parent, names);

BatchActivateCustomTargetingKeysAsync(string, IEnumerable<string>, CancellationToken)

API to batch activate CustomTargetingKey objects.

Declaration
public virtual Task<BatchActivateCustomTargetingKeysResponse> BatchActivateCustomTargetingKeysAsync(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 CustomTargetingKeys to activate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchActivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchActivateCustomTargetingKeysAsync(parent, names);

BatchCreateCustomTargetingKeys(BatchCreateCustomTargetingKeysRequest, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual BatchCreateCustomTargetingKeysResponse BatchCreateCustomTargetingKeys(BatchCreateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateCustomTargetingKeysRequest 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
BatchCreateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
BatchCreateCustomTargetingKeysRequest request = new BatchCreateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchCreateCustomTargetingKeys(request);

BatchCreateCustomTargetingKeys(NetworkName, IEnumerable<CreateCustomTargetingKeyRequest>, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual BatchCreateCustomTargetingKeysResponse BatchCreateCustomTargetingKeys(NetworkName parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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
BatchCreateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchCreateCustomTargetingKeys(parent, requests);

BatchCreateCustomTargetingKeys(string, IEnumerable<CreateCustomTargetingKeyRequest>, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual BatchCreateCustomTargetingKeysResponse BatchCreateCustomTargetingKeys(string parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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
BatchCreateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchCreateCustomTargetingKeys(parent, requests);

BatchCreateCustomTargetingKeysAsync(BatchCreateCustomTargetingKeysRequest, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(BatchCreateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateCustomTargetingKeysRequest 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateCustomTargetingKeysRequest request = new BatchCreateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(request);

BatchCreateCustomTargetingKeysAsync(BatchCreateCustomTargetingKeysRequest, CancellationToken)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(BatchCreateCustomTargetingKeysRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchCreateCustomTargetingKeysRequest 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateCustomTargetingKeysRequest request = new BatchCreateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(request);

BatchCreateCustomTargetingKeysAsync(NetworkName, IEnumerable<CreateCustomTargetingKeyRequest>, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(parent, requests);

BatchCreateCustomTargetingKeysAsync(NetworkName, IEnumerable<CreateCustomTargetingKeyRequest>, CancellationToken)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(parent, requests);

BatchCreateCustomTargetingKeysAsync(string, IEnumerable<CreateCustomTargetingKeyRequest>, CallSettings)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(string parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(parent, requests);

BatchCreateCustomTargetingKeysAsync(string, IEnumerable<CreateCustomTargetingKeyRequest>, CancellationToken)

API to batch create CustomTargetingKey objects.

Declaration
public virtual Task<BatchCreateCustomTargetingKeysResponse> BatchCreateCustomTargetingKeysAsync(string parent, IEnumerable<CreateCustomTargetingKeyRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchCreateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateCustomTargetingKeyRequest> requests = new CreateCustomTargetingKeyRequest[]
{
    new CreateCustomTargetingKeyRequest(),
};
// Make the request
BatchCreateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchCreateCustomTargetingKeysAsync(parent, requests);

BatchDeactivateCustomTargetingKeys(BatchDeactivateCustomTargetingKeysRequest, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual BatchDeactivateCustomTargetingKeysResponse BatchDeactivateCustomTargetingKeys(BatchDeactivateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateCustomTargetingKeysRequest 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
BatchDeactivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateCustomTargetingKeysRequest request = new BatchDeactivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeys(request);

BatchDeactivateCustomTargetingKeys(NetworkName, IEnumerable<CustomTargetingKeyName>, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual BatchDeactivateCustomTargetingKeysResponse BatchDeactivateCustomTargetingKeys(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeys(parent, names);

BatchDeactivateCustomTargetingKeys(string, IEnumerable<string>, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual BatchDeactivateCustomTargetingKeysResponse BatchDeactivateCustomTargetingKeys(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 CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeys(parent, names);

BatchDeactivateCustomTargetingKeysAsync(BatchDeactivateCustomTargetingKeysRequest, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(BatchDeactivateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateCustomTargetingKeysRequest 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<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateCustomTargetingKeysRequest request = new BatchDeactivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(request);

BatchDeactivateCustomTargetingKeysAsync(BatchDeactivateCustomTargetingKeysRequest, CancellationToken)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(BatchDeactivateCustomTargetingKeysRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchDeactivateCustomTargetingKeysRequest 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<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateCustomTargetingKeysRequest request = new BatchDeactivateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKeyNames =
    {
        CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
    },
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(request);

BatchDeactivateCustomTargetingKeysAsync(NetworkName, IEnumerable<CustomTargetingKeyName>, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(parent, names);

BatchDeactivateCustomTargetingKeysAsync(NetworkName, IEnumerable<CustomTargetingKeyName>, CancellationToken)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<CustomTargetingKeyName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CustomTargetingKeyName> names

Required. The resource names of the CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CustomTargetingKeyName> names = new CustomTargetingKeyName[]
{
    CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(parent, names);

BatchDeactivateCustomTargetingKeysAsync(string, IEnumerable<string>, CallSettings)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(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 CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(parent, names);

BatchDeactivateCustomTargetingKeysAsync(string, IEnumerable<string>, CancellationToken)

Deactivates a list of CustomTargetingKey objects.

Declaration
public virtual Task<BatchDeactivateCustomTargetingKeysResponse> BatchDeactivateCustomTargetingKeysAsync(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 CustomTargetingKeys to deactivate. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]",
};
// Make the request
BatchDeactivateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchDeactivateCustomTargetingKeysAsync(parent, names);

BatchUpdateCustomTargetingKeys(BatchUpdateCustomTargetingKeysRequest, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual BatchUpdateCustomTargetingKeysResponse BatchUpdateCustomTargetingKeys(BatchUpdateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateCustomTargetingKeysRequest 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
BatchUpdateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
BatchUpdateCustomTargetingKeysRequest request = new BatchUpdateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeys(request);

BatchUpdateCustomTargetingKeys(NetworkName, IEnumerable<UpdateCustomTargetingKeyRequest>, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual BatchUpdateCustomTargetingKeysResponse BatchUpdateCustomTargetingKeys(NetworkName parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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
BatchUpdateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeys(parent, requests);

BatchUpdateCustomTargetingKeys(string, IEnumerable<UpdateCustomTargetingKeyRequest>, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual BatchUpdateCustomTargetingKeysResponse BatchUpdateCustomTargetingKeys(string parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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
BatchUpdateCustomTargetingKeysResponse

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeys(parent, requests);

BatchUpdateCustomTargetingKeysAsync(BatchUpdateCustomTargetingKeysRequest, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(BatchUpdateCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateCustomTargetingKeysRequest 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateCustomTargetingKeysRequest request = new BatchUpdateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(request);

BatchUpdateCustomTargetingKeysAsync(BatchUpdateCustomTargetingKeysRequest, CancellationToken)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(BatchUpdateCustomTargetingKeysRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchUpdateCustomTargetingKeysRequest 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateCustomTargetingKeysRequest request = new BatchUpdateCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateCustomTargetingKeyRequest(),
    },
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(request);

BatchUpdateCustomTargetingKeysAsync(NetworkName, IEnumerable<UpdateCustomTargetingKeyRequest>, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(parent, requests);

BatchUpdateCustomTargetingKeysAsync(NetworkName, IEnumerable<UpdateCustomTargetingKeyRequest>, CancellationToken)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(NetworkName parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(parent, requests);

BatchUpdateCustomTargetingKeysAsync(string, IEnumerable<UpdateCustomTargetingKeyRequest>, CallSettings)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(string parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(parent, requests);

BatchUpdateCustomTargetingKeysAsync(string, IEnumerable<UpdateCustomTargetingKeyRequest>, CancellationToken)

API to batch update CustomTargetingKey objects.

Declaration
public virtual Task<BatchUpdateCustomTargetingKeysResponse> BatchUpdateCustomTargetingKeysAsync(string parent, IEnumerable<UpdateCustomTargetingKeyRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateCustomTargetingKeyRequest> requests

Required. The CustomTargetingKey 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<BatchUpdateCustomTargetingKeysResponse>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateCustomTargetingKeyRequest> requests = new UpdateCustomTargetingKeyRequest[]
{
    new UpdateCustomTargetingKeyRequest(),
};
// Make the request
BatchUpdateCustomTargetingKeysResponse response = await customTargetingKeyServiceClient.BatchUpdateCustomTargetingKeysAsync(parent, requests);

Create()

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

Declaration
public static CustomTargetingKeyServiceClient Create()
Returns
Type Description
CustomTargetingKeyServiceClient

The created CustomTargetingKeyServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<CustomTargetingKeyServiceClient>

The task representing the created CustomTargetingKeyServiceClient.

CreateCustomTargetingKey(CreateCustomTargetingKeyRequest, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey CreateCustomTargetingKey(CreateCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateCustomTargetingKeyRequest 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
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
CreateCustomTargetingKeyRequest request = new CreateCustomTargetingKeyRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKey = new CustomTargetingKey(),
};
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.CreateCustomTargetingKey(request);

CreateCustomTargetingKey(NetworkName, CustomTargetingKey, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey CreateCustomTargetingKey(NetworkName parent, CustomTargetingKey customTargetingKey, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.CreateCustomTargetingKey(parent, customTargetingKey);

CreateCustomTargetingKey(string, CustomTargetingKey, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey CreateCustomTargetingKey(string parent, CustomTargetingKey customTargetingKey, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.CreateCustomTargetingKey(parent, customTargetingKey);

CreateCustomTargetingKeyAsync(CreateCustomTargetingKeyRequest, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(CreateCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCustomTargetingKeyRequest request = new CreateCustomTargetingKeyRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKey = new CustomTargetingKey(),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(request);

CreateCustomTargetingKeyAsync(CreateCustomTargetingKeyRequest, CancellationToken)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(CreateCustomTargetingKeyRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCustomTargetingKeyRequest request = new CreateCustomTargetingKeyRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CustomTargetingKey = new CustomTargetingKey(),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(request);

CreateCustomTargetingKeyAsync(NetworkName, CustomTargetingKey, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(NetworkName parent, CustomTargetingKey customTargetingKey, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(parent, customTargetingKey);

CreateCustomTargetingKeyAsync(NetworkName, CustomTargetingKey, CancellationToken)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(NetworkName parent, CustomTargetingKey customTargetingKey, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(parent, customTargetingKey);

CreateCustomTargetingKeyAsync(string, CustomTargetingKey, CallSettings)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(string parent, CustomTargetingKey customTargetingKey, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(parent, customTargetingKey);

CreateCustomTargetingKeyAsync(string, CustomTargetingKey, CancellationToken)

API to create a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> CreateCustomTargetingKeyAsync(string parent, CustomTargetingKey customTargetingKey, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.CreateCustomTargetingKeyAsync(parent, customTargetingKey);

GetCustomTargetingKey(CustomTargetingKeyName, CallSettings)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey GetCustomTargetingKey(CustomTargetingKeyName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomTargetingKeyName name

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
CustomTargetingKeyName name = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]");
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.GetCustomTargetingKey(name);

GetCustomTargetingKey(GetCustomTargetingKeyRequest, CallSettings)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey GetCustomTargetingKey(GetCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetCustomTargetingKeyRequest 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
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
GetCustomTargetingKeyRequest request = new GetCustomTargetingKeyRequest
{
    CustomTargetingKeyName = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.GetCustomTargetingKey(request);

GetCustomTargetingKey(string, CallSettings)

API to retrieve a CustomTargetingKey object.

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

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]";
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.GetCustomTargetingKey(name);

GetCustomTargetingKeyAsync(CustomTargetingKeyName, CallSettings)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> GetCustomTargetingKeyAsync(CustomTargetingKeyName name, CallSettings callSettings = null)
Parameters
Type Name Description
CustomTargetingKeyName name

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CustomTargetingKeyName name = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]");
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(name);

GetCustomTargetingKeyAsync(CustomTargetingKeyName, CancellationToken)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> GetCustomTargetingKeyAsync(CustomTargetingKeyName name, CancellationToken cancellationToken)
Parameters
Type Name Description
CustomTargetingKeyName name

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CustomTargetingKeyName name = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]");
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(name);

GetCustomTargetingKeyAsync(GetCustomTargetingKeyRequest, CallSettings)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> GetCustomTargetingKeyAsync(GetCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
GetCustomTargetingKeyRequest request = new GetCustomTargetingKeyRequest
{
    CustomTargetingKeyName = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(request);

GetCustomTargetingKeyAsync(GetCustomTargetingKeyRequest, CancellationToken)

API to retrieve a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> GetCustomTargetingKeyAsync(GetCustomTargetingKeyRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
GetCustomTargetingKeyRequest request = new GetCustomTargetingKeyRequest
{
    CustomTargetingKeyName = CustomTargetingKeyName.FromNetworkCodeCustomTargetingKey("[NETWORK_CODE]", "[CUSTOM_TARGETING_KEY]"),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(request);

GetCustomTargetingKeyAsync(string, CallSettings)

API to retrieve a CustomTargetingKey object.

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

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]";
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(name);

GetCustomTargetingKeyAsync(string, CancellationToken)

API to retrieve a CustomTargetingKey object.

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

Required. The resource name of the CustomTargetingKey. Format: networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/customTargetingKeys/[CUSTOM_TARGETING_KEY]";
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.GetCustomTargetingKeyAsync(name);

ListCustomTargetingKeys(ListCustomTargetingKeysRequest, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeys(ListCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCustomTargetingKeysRequest 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
ListCustomTargetingKeysRequest request = new ListCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeys(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (CustomTargetingKey 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 (ListCustomTargetingKeysResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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;

ListCustomTargetingKeys(NetworkName, string, int?, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeys(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 CustomTargetingKeys. 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeys(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (CustomTargetingKey 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 (ListCustomTargetingKeysResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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;

ListCustomTargetingKeys(string, string, int?, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeys(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 CustomTargetingKeys. 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeys(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (CustomTargetingKey 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 (ListCustomTargetingKeysResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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;

ListCustomTargetingKeysAsync(ListCustomTargetingKeysRequest, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeysAsync(ListCustomTargetingKeysRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCustomTargetingKeysRequest 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable asynchronous sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
ListCustomTargetingKeysRequest request = new ListCustomTargetingKeysRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeysAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CustomTargetingKey item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListCustomTargetingKeysResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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;

ListCustomTargetingKeysAsync(NetworkName, string, int?, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeysAsync(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 CustomTargetingKeys. 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable asynchronous sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeysAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CustomTargetingKey item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListCustomTargetingKeysResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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;

ListCustomTargetingKeysAsync(string, string, int?, CallSettings)

API to retrieve a list of CustomTargetingKey objects.

Declaration
public virtual PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> ListCustomTargetingKeysAsync(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 CustomTargetingKeys. 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<ListCustomTargetingKeysResponse, CustomTargetingKey>

A pageable asynchronous sequence of CustomTargetingKey resources.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListCustomTargetingKeysResponse, CustomTargetingKey> response = customTargetingKeyServiceClient.ListCustomTargetingKeysAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((CustomTargetingKey item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListCustomTargetingKeysResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (CustomTargetingKey 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<CustomTargetingKey> 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 (CustomTargetingKey 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.

UpdateCustomTargetingKey(CustomTargetingKey, FieldMask, CallSettings)

API to update a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey UpdateCustomTargetingKey(CustomTargetingKey customTargetingKey, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to update.

The CustomTargetingKey's name is used to identify the CustomTargetingKey to update.

FieldMask updateMask

Required. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
FieldMask updateMask = new FieldMask();
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.UpdateCustomTargetingKey(customTargetingKey, updateMask);

UpdateCustomTargetingKey(UpdateCustomTargetingKeyRequest, CallSettings)

API to update a CustomTargetingKey object.

Declaration
public virtual CustomTargetingKey UpdateCustomTargetingKey(UpdateCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateCustomTargetingKeyRequest 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
CustomTargetingKey

The RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = CustomTargetingKeyServiceClient.Create();
// Initialize request argument(s)
UpdateCustomTargetingKeyRequest request = new UpdateCustomTargetingKeyRequest
{
    CustomTargetingKey = new CustomTargetingKey(),
    UpdateMask = new FieldMask(),
};
// Make the request
CustomTargetingKey response = customTargetingKeyServiceClient.UpdateCustomTargetingKey(request);

UpdateCustomTargetingKeyAsync(CustomTargetingKey, FieldMask, CallSettings)

API to update a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> UpdateCustomTargetingKeyAsync(CustomTargetingKey customTargetingKey, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to update.

The CustomTargetingKey's name is used to identify the CustomTargetingKey to update.

FieldMask updateMask

Required. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
FieldMask updateMask = new FieldMask();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.UpdateCustomTargetingKeyAsync(customTargetingKey, updateMask);

UpdateCustomTargetingKeyAsync(CustomTargetingKey, FieldMask, CancellationToken)

API to update a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> UpdateCustomTargetingKeyAsync(CustomTargetingKey customTargetingKey, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
CustomTargetingKey customTargetingKey

Required. The CustomTargetingKey to update.

The CustomTargetingKey's name is used to identify the CustomTargetingKey to update.

FieldMask updateMask

Required. The list of fields to update.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
CustomTargetingKey customTargetingKey = new CustomTargetingKey();
FieldMask updateMask = new FieldMask();
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.UpdateCustomTargetingKeyAsync(customTargetingKey, updateMask);

UpdateCustomTargetingKeyAsync(UpdateCustomTargetingKeyRequest, CallSettings)

API to update a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> UpdateCustomTargetingKeyAsync(UpdateCustomTargetingKeyRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCustomTargetingKeyRequest request = new UpdateCustomTargetingKeyRequest
{
    CustomTargetingKey = new CustomTargetingKey(),
    UpdateMask = new FieldMask(),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.UpdateCustomTargetingKeyAsync(request);

UpdateCustomTargetingKeyAsync(UpdateCustomTargetingKeyRequest, CancellationToken)

API to update a CustomTargetingKey object.

Declaration
public virtual Task<CustomTargetingKey> UpdateCustomTargetingKeyAsync(UpdateCustomTargetingKeyRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateCustomTargetingKeyRequest 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<CustomTargetingKey>

A Task containing the RPC response.

Sample code
// Create client
CustomTargetingKeyServiceClient customTargetingKeyServiceClient = await CustomTargetingKeyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCustomTargetingKeyRequest request = new UpdateCustomTargetingKeyRequest
{
    CustomTargetingKey = new CustomTargetingKey(),
    UpdateMask = new FieldMask(),
};
// Make the request
CustomTargetingKey response = await customTargetingKeyServiceClient.UpdateCustomTargetingKeyAsync(request);
In this article
Back to top Generated by DocFX