Show / Hide Table of Contents

Class AdRuleServiceClient

AdRuleService client wrapper, for convenient use.

Inheritance
object
AdRuleServiceClient
AdRuleServiceClientImpl
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 AdRuleServiceClient
Remarks

Provides methods for handling AdRule objects.

Properties

DefaultEndpoint

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

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

The default AdRuleService scopes are:

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

GrpcClient

The underlying gRPC AdRuleService client

Declaration
public virtual AdRuleService.AdRuleServiceClient GrpcClient { get; }
Property Value
Type Description
AdRuleService.AdRuleServiceClient

ServiceMetadata

The service metadata associated with this client type.

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

Methods

BatchActivateAdRules(BatchActivateAdRulesRequest, CallSettings)

Activates a list of AdRule objects.

Declaration
public virtual BatchActivateAdRulesResponse BatchActivateAdRules(BatchActivateAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateAdRulesRequest 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
BatchActivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
BatchActivateAdRulesRequest request = new BatchActivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchActivateAdRulesResponse response = adRuleServiceClient.BatchActivateAdRules(request);

BatchActivateAdRules(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Activates a list of AdRule objects.

Declaration
public virtual BatchActivateAdRulesResponse BatchActivateAdRules(NetworkName parent, IEnumerable<AdRuleName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchActivateAdRulesResponse response = adRuleServiceClient.BatchActivateAdRules(parent, names);

BatchActivateAdRules(string, IEnumerable<string>, CallSettings)

Activates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchActivateAdRulesResponse response = adRuleServiceClient.BatchActivateAdRules(parent, names);

BatchActivateAdRulesAsync(BatchActivateAdRulesRequest, CallSettings)

Activates a list of AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateAdRulesRequest request = new BatchActivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(request);

BatchActivateAdRulesAsync(BatchActivateAdRulesRequest, CancellationToken)

Activates a list of AdRule objects.

Declaration
public virtual Task<BatchActivateAdRulesResponse> BatchActivateAdRulesAsync(BatchActivateAdRulesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchActivateAdRulesRequest 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<BatchActivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateAdRulesRequest request = new BatchActivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(request);

BatchActivateAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Activates a list of AdRule objects.

Declaration
public virtual Task<BatchActivateAdRulesResponse> BatchActivateAdRulesAsync(NetworkName parent, IEnumerable<AdRuleName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(parent, names);

BatchActivateAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CancellationToken)

Activates a list of AdRule objects.

Declaration
public virtual Task<BatchActivateAdRulesResponse> BatchActivateAdRulesAsync(NetworkName parent, IEnumerable<AdRuleName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(parent, names);

BatchActivateAdRulesAsync(string, IEnumerable<string>, CallSettings)

Activates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(parent, names);

BatchActivateAdRulesAsync(string, IEnumerable<string>, CancellationToken)

Activates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchActivateAdRulesResponse response = await adRuleServiceClient.BatchActivateAdRulesAsync(parent, names);

BatchCreateAdRules(BatchCreateAdRulesRequest, CallSettings)

Batch creates AdRule objects.

Declaration
public virtual BatchCreateAdRulesResponse BatchCreateAdRules(BatchCreateAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchCreateAdRulesRequest 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
BatchCreateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
BatchCreateAdRulesRequest request = new BatchCreateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateAdRuleRequest(),
    },
};
// Make the request
BatchCreateAdRulesResponse response = adRuleServiceClient.BatchCreateAdRules(request);

BatchCreateAdRules(NetworkName, IEnumerable<CreateAdRuleRequest>, CallSettings)

Batch creates AdRule objects.

Declaration
public virtual BatchCreateAdRulesResponse BatchCreateAdRules(NetworkName parent, IEnumerable<CreateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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
BatchCreateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = adRuleServiceClient.BatchCreateAdRules(parent, requests);

BatchCreateAdRules(string, IEnumerable<CreateAdRuleRequest>, CallSettings)

Batch creates AdRule objects.

Declaration
public virtual BatchCreateAdRulesResponse BatchCreateAdRules(string parent, IEnumerable<CreateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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
BatchCreateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = adRuleServiceClient.BatchCreateAdRules(parent, requests);

BatchCreateAdRulesAsync(BatchCreateAdRulesRequest, CallSettings)

Batch creates AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateAdRulesRequest request = new BatchCreateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateAdRuleRequest(),
    },
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(request);

BatchCreateAdRulesAsync(BatchCreateAdRulesRequest, CancellationToken)

Batch creates AdRule objects.

Declaration
public virtual Task<BatchCreateAdRulesResponse> BatchCreateAdRulesAsync(BatchCreateAdRulesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchCreateAdRulesRequest 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<BatchCreateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchCreateAdRulesRequest request = new BatchCreateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new CreateAdRuleRequest(),
    },
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(request);

BatchCreateAdRulesAsync(NetworkName, IEnumerable<CreateAdRuleRequest>, CallSettings)

Batch creates AdRule objects.

Declaration
public virtual Task<BatchCreateAdRulesResponse> BatchCreateAdRulesAsync(NetworkName parent, IEnumerable<CreateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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<BatchCreateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(parent, requests);

BatchCreateAdRulesAsync(NetworkName, IEnumerable<CreateAdRuleRequest>, CancellationToken)

Batch creates AdRule objects.

Declaration
public virtual Task<BatchCreateAdRulesResponse> BatchCreateAdRulesAsync(NetworkName parent, IEnumerable<CreateAdRuleRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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<BatchCreateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(parent, requests);

BatchCreateAdRulesAsync(string, IEnumerable<CreateAdRuleRequest>, CallSettings)

Batch creates AdRule objects.

Declaration
public virtual Task<BatchCreateAdRulesResponse> BatchCreateAdRulesAsync(string parent, IEnumerable<CreateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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<BatchCreateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(parent, requests);

BatchCreateAdRulesAsync(string, IEnumerable<CreateAdRuleRequest>, CancellationToken)

Batch creates AdRule objects.

Declaration
public virtual Task<BatchCreateAdRulesResponse> BatchCreateAdRulesAsync(string parent, IEnumerable<CreateAdRuleRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

IEnumerable<CreateAdRuleRequest> requests

Required. The AdRule 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<BatchCreateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<CreateAdRuleRequest> requests = new CreateAdRuleRequest[]
{
    new CreateAdRuleRequest(),
};
// Make the request
BatchCreateAdRulesResponse response = await adRuleServiceClient.BatchCreateAdRulesAsync(parent, requests);

BatchDeactivateAdRules(BatchDeactivateAdRulesRequest, CallSettings)

Deactivates a list of AdRule objects.

Declaration
public virtual BatchDeactivateAdRulesResponse BatchDeactivateAdRules(BatchDeactivateAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateAdRulesRequest 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
BatchDeactivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateAdRulesRequest request = new BatchDeactivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchDeactivateAdRulesResponse response = adRuleServiceClient.BatchDeactivateAdRules(request);

BatchDeactivateAdRules(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Deactivates a list of AdRule objects.

Declaration
public virtual BatchDeactivateAdRulesResponse BatchDeactivateAdRules(NetworkName parent, IEnumerable<AdRuleName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchDeactivateAdRulesResponse response = adRuleServiceClient.BatchDeactivateAdRules(parent, names);

BatchDeactivateAdRules(string, IEnumerable<string>, CallSettings)

Deactivates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchDeactivateAdRulesResponse response = adRuleServiceClient.BatchDeactivateAdRules(parent, names);

BatchDeactivateAdRulesAsync(BatchDeactivateAdRulesRequest, CallSettings)

Deactivates a list of AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateAdRulesRequest request = new BatchDeactivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(request);

BatchDeactivateAdRulesAsync(BatchDeactivateAdRulesRequest, CancellationToken)

Deactivates a list of AdRule objects.

Declaration
public virtual Task<BatchDeactivateAdRulesResponse> BatchDeactivateAdRulesAsync(BatchDeactivateAdRulesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchDeactivateAdRulesRequest 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<BatchDeactivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateAdRulesRequest request = new BatchDeactivateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(request);

BatchDeactivateAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Deactivates a list of AdRule objects.

Declaration
public virtual Task<BatchDeactivateAdRulesResponse> BatchDeactivateAdRulesAsync(NetworkName parent, IEnumerable<AdRuleName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(parent, names);

BatchDeactivateAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CancellationToken)

Deactivates a list of AdRule objects.

Declaration
public virtual Task<BatchDeactivateAdRulesResponse> BatchDeactivateAdRulesAsync(NetworkName parent, IEnumerable<AdRuleName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(parent, names);

BatchDeactivateAdRulesAsync(string, IEnumerable<string>, CallSettings)

Deactivates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(parent, names);

BatchDeactivateAdRulesAsync(string, IEnumerable<string>, CancellationToken)

Deactivates a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
BatchDeactivateAdRulesResponse response = await adRuleServiceClient.BatchDeactivateAdRulesAsync(parent, names);

BatchDeleteAdRules(BatchDeleteAdRulesRequest, CallSettings)

Deletes a list of AdRule objects.

Declaration
public virtual void BatchDeleteAdRules(BatchDeleteAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeleteAdRulesRequest request

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

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
BatchDeleteAdRulesRequest request = new BatchDeleteAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
adRuleServiceClient.BatchDeleteAdRules(request);

BatchDeleteAdRules(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Deletes a list of AdRule objects.

Declaration
public virtual void BatchDeleteAdRules(NetworkName parent, IEnumerable<AdRuleName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
adRuleServiceClient.BatchDeleteAdRules(parent, names);

BatchDeleteAdRules(string, IEnumerable<string>, CallSettings)

Deletes a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
adRuleServiceClient.BatchDeleteAdRules(parent, names);

BatchDeleteAdRulesAsync(BatchDeleteAdRulesRequest, CallSettings)

Deletes a list of AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeleteAdRulesRequest request = new BatchDeleteAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(request);

BatchDeleteAdRulesAsync(BatchDeleteAdRulesRequest, CancellationToken)

Deletes a list of AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeleteAdRulesRequest request = new BatchDeleteAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRuleNames =
    {
        AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
    },
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(request);

BatchDeleteAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CallSettings)

Deletes a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(parent, names);

BatchDeleteAdRulesAsync(NetworkName, IEnumerable<AdRuleName>, CancellationToken)

Deletes a list of AdRule objects.

Declaration
public virtual Task BatchDeleteAdRulesAsync(NetworkName parent, IEnumerable<AdRuleName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<AdRuleName> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<AdRuleName> names = new AdRuleName[]
{
    AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(parent, names);

BatchDeleteAdRulesAsync(string, IEnumerable<string>, CallSettings)

Deletes a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(parent, names);

BatchDeleteAdRulesAsync(string, IEnumerable<string>, CancellationToken)

Deletes a list of AdRule objects.

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

Required. Format: networks/{network_code}

IEnumerable<string> names

Required. Resource names for the AdRule. Format: networks/{network_code}/adRules/{ad_rule}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/adRules/[AD_RULE]",
};
// Make the request
await adRuleServiceClient.BatchDeleteAdRulesAsync(parent, names);

BatchUpdateAdRules(BatchUpdateAdRulesRequest, CallSettings)

Batch updates AdRule objects.

Declaration
public virtual BatchUpdateAdRulesResponse BatchUpdateAdRules(BatchUpdateAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchUpdateAdRulesRequest 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
BatchUpdateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
BatchUpdateAdRulesRequest request = new BatchUpdateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateAdRuleRequest(),
    },
};
// Make the request
BatchUpdateAdRulesResponse response = adRuleServiceClient.BatchUpdateAdRules(request);

BatchUpdateAdRules(NetworkName, IEnumerable<UpdateAdRuleRequest>, CallSettings)

Batch updates AdRule objects.

Declaration
public virtual BatchUpdateAdRulesResponse BatchUpdateAdRules(NetworkName parent, IEnumerable<UpdateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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
BatchUpdateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = adRuleServiceClient.BatchUpdateAdRules(parent, requests);

BatchUpdateAdRules(string, IEnumerable<UpdateAdRuleRequest>, CallSettings)

Batch updates AdRule objects.

Declaration
public virtual BatchUpdateAdRulesResponse BatchUpdateAdRules(string parent, IEnumerable<UpdateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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
BatchUpdateAdRulesResponse

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = adRuleServiceClient.BatchUpdateAdRules(parent, requests);

BatchUpdateAdRulesAsync(BatchUpdateAdRulesRequest, CallSettings)

Batch updates AdRule objects.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateAdRulesRequest request = new BatchUpdateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateAdRuleRequest(),
    },
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(request);

BatchUpdateAdRulesAsync(BatchUpdateAdRulesRequest, CancellationToken)

Batch updates AdRule objects.

Declaration
public virtual Task<BatchUpdateAdRulesResponse> BatchUpdateAdRulesAsync(BatchUpdateAdRulesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
BatchUpdateAdRulesRequest 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<BatchUpdateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
BatchUpdateAdRulesRequest request = new BatchUpdateAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Requests =
    {
        new UpdateAdRuleRequest(),
    },
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(request);

BatchUpdateAdRulesAsync(NetworkName, IEnumerable<UpdateAdRuleRequest>, CallSettings)

Batch updates AdRule objects.

Declaration
public virtual Task<BatchUpdateAdRulesResponse> BatchUpdateAdRulesAsync(NetworkName parent, IEnumerable<UpdateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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<BatchUpdateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(parent, requests);

BatchUpdateAdRulesAsync(NetworkName, IEnumerable<UpdateAdRuleRequest>, CancellationToken)

Batch updates AdRule objects.

Declaration
public virtual Task<BatchUpdateAdRulesResponse> BatchUpdateAdRulesAsync(NetworkName parent, IEnumerable<UpdateAdRuleRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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<BatchUpdateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(parent, requests);

BatchUpdateAdRulesAsync(string, IEnumerable<UpdateAdRuleRequest>, CallSettings)

Batch updates AdRule objects.

Declaration
public virtual Task<BatchUpdateAdRulesResponse> BatchUpdateAdRulesAsync(string parent, IEnumerable<UpdateAdRuleRequest> requests, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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<BatchUpdateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(parent, requests);

BatchUpdateAdRulesAsync(string, IEnumerable<UpdateAdRuleRequest>, CancellationToken)

Batch updates AdRule objects.

Declaration
public virtual Task<BatchUpdateAdRulesResponse> BatchUpdateAdRulesAsync(string parent, IEnumerable<UpdateAdRuleRequest> requests, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

IEnumerable<UpdateAdRuleRequest> requests

Required. The AdRule 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<BatchUpdateAdRulesResponse>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<UpdateAdRuleRequest> requests = new UpdateAdRuleRequest[]
{
    new UpdateAdRuleRequest(),
};
// Make the request
BatchUpdateAdRulesResponse response = await adRuleServiceClient.BatchUpdateAdRulesAsync(parent, requests);

Create()

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

Declaration
public static AdRuleServiceClient Create()
Returns
Type Description
AdRuleServiceClient

The created AdRuleServiceClient.

CreateAdRule(CreateAdRuleRequest, CallSettings)

Creates a AdRule object.

Declaration
public virtual AdRule CreateAdRule(CreateAdRuleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateAdRuleRequest 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
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
CreateAdRuleRequest request = new CreateAdRuleRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRule = new AdRule(),
};
// Make the request
AdRule response = adRuleServiceClient.CreateAdRule(request);

CreateAdRule(NetworkName, AdRule, CallSettings)

Creates a AdRule object.

Declaration
public virtual AdRule CreateAdRule(NetworkName parent, AdRule adRule, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

AdRule adRule

Required. The AdRule to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdRule adRule = new AdRule();
// Make the request
AdRule response = adRuleServiceClient.CreateAdRule(parent, adRule);

CreateAdRule(string, AdRule, CallSettings)

Creates a AdRule object.

Declaration
public virtual AdRule CreateAdRule(string parent, AdRule adRule, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

AdRule adRule

Required. The AdRule to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdRule adRule = new AdRule();
// Make the request
AdRule response = adRuleServiceClient.CreateAdRule(parent, adRule);

CreateAdRuleAsync(CreateAdRuleRequest, CallSettings)

Creates a AdRule object.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdRuleRequest request = new CreateAdRuleRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRule = new AdRule(),
};
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(request);

CreateAdRuleAsync(CreateAdRuleRequest, CancellationToken)

Creates a AdRule object.

Declaration
public virtual Task<AdRule> CreateAdRuleAsync(CreateAdRuleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateAdRuleRequest 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<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdRuleRequest request = new CreateAdRuleRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AdRule = new AdRule(),
};
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(request);

CreateAdRuleAsync(NetworkName, AdRule, CallSettings)

Creates a AdRule object.

Declaration
public virtual Task<AdRule> CreateAdRuleAsync(NetworkName parent, AdRule adRule, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

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

AdRule adRule

Required. The AdRule to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdRule adRule = new AdRule();
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(parent, adRule);

CreateAdRuleAsync(NetworkName, AdRule, CancellationToken)

Creates a AdRule object.

Declaration
public virtual Task<AdRule> CreateAdRuleAsync(NetworkName parent, AdRule adRule, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

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

AdRule adRule

Required. The AdRule to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
AdRule adRule = new AdRule();
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(parent, adRule);

CreateAdRuleAsync(string, AdRule, CallSettings)

Creates a AdRule object.

Declaration
public virtual Task<AdRule> CreateAdRuleAsync(string parent, AdRule adRule, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

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

AdRule adRule

Required. The AdRule to create.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdRule adRule = new AdRule();
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(parent, adRule);

CreateAdRuleAsync(string, AdRule, CancellationToken)

Creates a AdRule object.

Declaration
public virtual Task<AdRule> CreateAdRuleAsync(string parent, AdRule adRule, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

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

AdRule adRule

Required. The AdRule to create.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
AdRule adRule = new AdRule();
// Make the request
AdRule response = await adRuleServiceClient.CreateAdRuleAsync(parent, adRule);

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<AdRuleServiceClient>

The task representing the created AdRuleServiceClient.

GetAdRule(AdRuleName, CallSettings)

Retrieves an AdRule object.

Declaration
public virtual AdRule GetAdRule(AdRuleName name, CallSettings callSettings = null)
Parameters
Type Name Description
AdRuleName name

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
AdRuleName name = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]");
// Make the request
AdRule response = adRuleServiceClient.GetAdRule(name);

GetAdRule(GetAdRuleRequest, CallSettings)

Retrieves an AdRule object.

Declaration
public virtual AdRule GetAdRule(GetAdRuleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetAdRuleRequest 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
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
GetAdRuleRequest request = new GetAdRuleRequest
{
    AdRuleName = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
AdRule response = adRuleServiceClient.GetAdRule(request);

GetAdRule(string, CallSettings)

Retrieves an AdRule object.

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

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adRules/[AD_RULE]";
// Make the request
AdRule response = adRuleServiceClient.GetAdRule(name);

GetAdRuleAsync(AdRuleName, CallSettings)

Retrieves an AdRule object.

Declaration
public virtual Task<AdRule> GetAdRuleAsync(AdRuleName name, CallSettings callSettings = null)
Parameters
Type Name Description
AdRuleName name

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
AdRuleName name = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]");
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(name);

GetAdRuleAsync(AdRuleName, CancellationToken)

Retrieves an AdRule object.

Declaration
public virtual Task<AdRule> GetAdRuleAsync(AdRuleName name, CancellationToken cancellationToken)
Parameters
Type Name Description
AdRuleName name

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
AdRuleName name = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]");
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(name);

GetAdRuleAsync(GetAdRuleRequest, CallSettings)

Retrieves an AdRule object.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdRuleRequest request = new GetAdRuleRequest
{
    AdRuleName = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(request);

GetAdRuleAsync(GetAdRuleRequest, CancellationToken)

Retrieves an AdRule object.

Declaration
public virtual Task<AdRule> GetAdRuleAsync(GetAdRuleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetAdRuleRequest 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<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdRuleRequest request = new GetAdRuleRequest
{
    AdRuleName = AdRuleName.FromNetworkCodeAdRule("[NETWORK_CODE]", "[AD_RULE]"),
};
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(request);

GetAdRuleAsync(string, CallSettings)

Retrieves an AdRule object.

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

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adRules/[AD_RULE]";
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(name);

GetAdRuleAsync(string, CancellationToken)

Retrieves an AdRule object.

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

Required. The resource name of the AdRule. Format: networks/{network_code}/adRules/{ad_rule_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/adRules/[AD_RULE]";
// Make the request
AdRule response = await adRuleServiceClient.GetAdRuleAsync(name);

ListAdRules(ListAdRulesRequest, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedEnumerable<ListAdRulesResponse, AdRule> ListAdRules(ListAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListAdRulesRequest 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<ListAdRulesResponse, AdRule>

A pageable sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
ListAdRulesRequest request = new ListAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRules(request);

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

ListAdRules(NetworkName, string, int?, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedEnumerable<ListAdRulesResponse, AdRule> ListAdRules(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 AdRules. 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<ListAdRulesResponse, AdRule>

A pageable sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRules(parent);

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

ListAdRules(string, string, int?, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedEnumerable<ListAdRulesResponse, AdRule> ListAdRules(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 AdRules. 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<ListAdRulesResponse, AdRule>

A pageable sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRules(parent);

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

ListAdRulesAsync(ListAdRulesRequest, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedAsyncEnumerable<ListAdRulesResponse, AdRule> ListAdRulesAsync(ListAdRulesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListAdRulesRequest 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<ListAdRulesResponse, AdRule>

A pageable asynchronous sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdRulesRequest request = new ListAdRulesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRulesAsync(request);

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

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

ListAdRulesAsync(NetworkName, string, int?, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedAsyncEnumerable<ListAdRulesResponse, AdRule> ListAdRulesAsync(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 AdRules. 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<ListAdRulesResponse, AdRule>

A pageable asynchronous sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRulesAsync(parent);

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

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

ListAdRulesAsync(string, string, int?, CallSettings)

Lists AdRule objects.

Declaration
public virtual PagedAsyncEnumerable<ListAdRulesResponse, AdRule> ListAdRulesAsync(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 AdRules. 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<ListAdRulesResponse, AdRule>

A pageable asynchronous sequence of AdRule resources.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListAdRulesResponse, AdRule> response = adRuleServiceClient.ListAdRulesAsync(parent);

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

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

UpdateAdRule(AdRule, FieldMask, CallSettings)

Updates a AdRule object.

Declaration
public virtual AdRule UpdateAdRule(AdRule adRule, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
AdRule adRule

Required. The AdRule to update.

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

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
AdRule adRule = new AdRule();
FieldMask updateMask = new FieldMask();
// Make the request
AdRule response = adRuleServiceClient.UpdateAdRule(adRule, updateMask);

UpdateAdRule(UpdateAdRuleRequest, CallSettings)

Updates a AdRule object.

Declaration
public virtual AdRule UpdateAdRule(UpdateAdRuleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateAdRuleRequest 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
AdRule

The RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = AdRuleServiceClient.Create();
// Initialize request argument(s)
UpdateAdRuleRequest request = new UpdateAdRuleRequest
{
    AdRule = new AdRule(),
    UpdateMask = new FieldMask(),
};
// Make the request
AdRule response = adRuleServiceClient.UpdateAdRule(request);

UpdateAdRuleAsync(AdRule, FieldMask, CallSettings)

Updates a AdRule object.

Declaration
public virtual Task<AdRule> UpdateAdRuleAsync(AdRule adRule, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
AdRule adRule

Required. The AdRule to update.

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

FieldMask updateMask

Optional. The list of fields to update.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
AdRule adRule = new AdRule();
FieldMask updateMask = new FieldMask();
// Make the request
AdRule response = await adRuleServiceClient.UpdateAdRuleAsync(adRule, updateMask);

UpdateAdRuleAsync(AdRule, FieldMask, CancellationToken)

Updates a AdRule object.

Declaration
public virtual Task<AdRule> UpdateAdRuleAsync(AdRule adRule, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
AdRule adRule

Required. The AdRule to update.

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

FieldMask updateMask

Optional. The list of fields to update.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
AdRule adRule = new AdRule();
FieldMask updateMask = new FieldMask();
// Make the request
AdRule response = await adRuleServiceClient.UpdateAdRuleAsync(adRule, updateMask);

UpdateAdRuleAsync(UpdateAdRuleRequest, CallSettings)

Updates a AdRule object.

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

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdRuleRequest request = new UpdateAdRuleRequest
{
    AdRule = new AdRule(),
    UpdateMask = new FieldMask(),
};
// Make the request
AdRule response = await adRuleServiceClient.UpdateAdRuleAsync(request);

UpdateAdRuleAsync(UpdateAdRuleRequest, CancellationToken)

Updates a AdRule object.

Declaration
public virtual Task<AdRule> UpdateAdRuleAsync(UpdateAdRuleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateAdRuleRequest 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<AdRule>

A Task containing the RPC response.

Sample code
// Create client
AdRuleServiceClient adRuleServiceClient = await AdRuleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAdRuleRequest request = new UpdateAdRuleRequest
{
    AdRule = new AdRule(),
    UpdateMask = new FieldMask(),
};
// Make the request
AdRule response = await adRuleServiceClient.UpdateAdRuleAsync(request);
In this article
Back to top Generated by DocFX