Show / Hide Table of Contents

Class CreativeServiceClient

CreativeService client wrapper, for convenient use.

Inheritance
object
CreativeServiceClient
CreativeServiceClientImpl
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 CreativeServiceClient
Remarks

Provides methods for handling Creative objects.

Properties

DefaultEndpoint

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

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

The default CreativeService scopes are:

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

GrpcClient

The underlying gRPC CreativeService client

Declaration
public virtual CreativeService.CreativeServiceClient GrpcClient { get; }
Property Value
Type Description
CreativeService.CreativeServiceClient

ServiceMetadata

The service metadata associated with this client type.

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

Methods

BatchActivateCreatives(BatchActivateCreativesRequest, CallSettings)

Batch activates Creative objects.

Declaration
public virtual BatchActivateCreativesResponse BatchActivateCreatives(BatchActivateCreativesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchActivateCreativesRequest 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
BatchActivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
BatchActivateCreativesRequest request = new BatchActivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchActivateCreativesResponse response = creativeServiceClient.BatchActivateCreatives(request);

BatchActivateCreatives(NetworkName, IEnumerable<CreativeName>, CallSettings)

Batch activates Creative objects.

Declaration
public virtual BatchActivateCreativesResponse BatchActivateCreatives(NetworkName parent, IEnumerable<CreativeName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchActivateCreativesResponse response = creativeServiceClient.BatchActivateCreatives(parent, names);

BatchActivateCreatives(string, IEnumerable<string>, CallSettings)

Batch activates Creative objects.

Declaration
public virtual BatchActivateCreativesResponse BatchActivateCreatives(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 Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchActivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchActivateCreativesResponse response = creativeServiceClient.BatchActivateCreatives(parent, names);

BatchActivateCreativesAsync(BatchActivateCreativesRequest, CallSettings)

Batch activates Creative objects.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateCreativesRequest request = new BatchActivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(request);

BatchActivateCreativesAsync(BatchActivateCreativesRequest, CancellationToken)

Batch activates Creative objects.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
BatchActivateCreativesRequest request = new BatchActivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(request);

BatchActivateCreativesAsync(NetworkName, IEnumerable<CreativeName>, CallSettings)

Batch activates Creative objects.

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

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(parent, names);

BatchActivateCreativesAsync(NetworkName, IEnumerable<CreativeName>, CancellationToken)

Batch activates Creative objects.

Declaration
public virtual Task<BatchActivateCreativesResponse> BatchActivateCreativesAsync(NetworkName parent, IEnumerable<CreativeName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(parent, names);

BatchActivateCreativesAsync(string, IEnumerable<string>, CallSettings)

Batch activates Creative objects.

Declaration
public virtual Task<BatchActivateCreativesResponse> BatchActivateCreativesAsync(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 Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchActivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(parent, names);

BatchActivateCreativesAsync(string, IEnumerable<string>, CancellationToken)

Batch activates Creative objects.

Declaration
public virtual Task<BatchActivateCreativesResponse> BatchActivateCreativesAsync(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 Creatives to activate. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchActivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchActivateCreativesResponse response = await creativeServiceClient.BatchActivateCreativesAsync(parent, names);

BatchDeactivateCreatives(BatchDeactivateCreativesRequest, CallSettings)

Deactivates a list of Creative objects.

Declaration
public virtual BatchDeactivateCreativesResponse BatchDeactivateCreatives(BatchDeactivateCreativesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
BatchDeactivateCreativesRequest 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
BatchDeactivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
BatchDeactivateCreativesRequest request = new BatchDeactivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchDeactivateCreativesResponse response = creativeServiceClient.BatchDeactivateCreatives(request);

BatchDeactivateCreatives(NetworkName, IEnumerable<CreativeName>, CallSettings)

Deactivates a list of Creative objects.

Declaration
public virtual BatchDeactivateCreativesResponse BatchDeactivateCreatives(NetworkName parent, IEnumerable<CreativeName> names, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchDeactivateCreativesResponse response = creativeServiceClient.BatchDeactivateCreatives(parent, names);

BatchDeactivateCreatives(string, IEnumerable<string>, CallSettings)

Deactivates a list of Creative objects.

Declaration
public virtual BatchDeactivateCreativesResponse BatchDeactivateCreatives(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 Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
BatchDeactivateCreativesResponse

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchDeactivateCreativesResponse response = creativeServiceClient.BatchDeactivateCreatives(parent, names);

BatchDeactivateCreativesAsync(BatchDeactivateCreativesRequest, CallSettings)

Deactivates a list of Creative objects.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateCreativesRequest request = new BatchDeactivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(request);

BatchDeactivateCreativesAsync(BatchDeactivateCreativesRequest, CancellationToken)

Deactivates a list of Creative objects.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
BatchDeactivateCreativesRequest request = new BatchDeactivateCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    CreativeNames =
    {
        CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
    },
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(request);

BatchDeactivateCreativesAsync(NetworkName, IEnumerable<CreativeName>, CallSettings)

Deactivates a list of Creative objects.

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

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(parent, names);

BatchDeactivateCreativesAsync(NetworkName, IEnumerable<CreativeName>, CancellationToken)

Deactivates a list of Creative objects.

Declaration
public virtual Task<BatchDeactivateCreativesResponse> BatchDeactivateCreativesAsync(NetworkName parent, IEnumerable<CreativeName> names, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

IEnumerable<CreativeName> names

Required. The resource names of the Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
IEnumerable<CreativeName> names = new CreativeName[]
{
    CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(parent, names);

BatchDeactivateCreativesAsync(string, IEnumerable<string>, CallSettings)

Deactivates a list of Creative objects.

Declaration
public virtual Task<BatchDeactivateCreativesResponse> BatchDeactivateCreativesAsync(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 Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<BatchDeactivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(parent, names);

BatchDeactivateCreativesAsync(string, IEnumerable<string>, CancellationToken)

Deactivates a list of Creative objects.

Declaration
public virtual Task<BatchDeactivateCreativesResponse> BatchDeactivateCreativesAsync(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 Creatives to deactivate. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<BatchDeactivateCreativesResponse>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
IEnumerable<string> names = new string[]
{
    "networks/[NETWORK_CODE]/creatives/[CREATIVE]",
};
// Make the request
BatchDeactivateCreativesResponse response = await creativeServiceClient.BatchDeactivateCreativesAsync(parent, names);

Create()

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

Declaration
public static CreativeServiceClient Create()
Returns
Type Description
CreativeServiceClient

The created CreativeServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<CreativeServiceClient>

The task representing the created CreativeServiceClient.

GetCreative(CreativeName, CallSettings)

Retrieves a Creative object.

Declaration
public virtual Creative GetCreative(CreativeName name, CallSettings callSettings = null)
Parameters
Type Name Description
CreativeName name

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Creative

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
CreativeName name = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]");
// Make the request
Creative response = creativeServiceClient.GetCreative(name);

GetCreative(GetCreativeRequest, CallSettings)

Retrieves a Creative object.

Declaration
public virtual Creative GetCreative(GetCreativeRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetCreativeRequest 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
Creative

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
GetCreativeRequest request = new GetCreativeRequest
{
    CreativeName = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
Creative response = creativeServiceClient.GetCreative(request);

GetCreative(string, CallSettings)

Retrieves a Creative object.

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

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Creative

The RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/creatives/[CREATIVE]";
// Make the request
Creative response = creativeServiceClient.GetCreative(name);

GetCreativeAsync(CreativeName, CallSettings)

Retrieves a Creative object.

Declaration
public virtual Task<Creative> GetCreativeAsync(CreativeName name, CallSettings callSettings = null)
Parameters
Type Name Description
CreativeName name

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Creative>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
CreativeName name = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]");
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(name);

GetCreativeAsync(CreativeName, CancellationToken)

Retrieves a Creative object.

Declaration
public virtual Task<Creative> GetCreativeAsync(CreativeName name, CancellationToken cancellationToken)
Parameters
Type Name Description
CreativeName name

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Creative>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
CreativeName name = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]");
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(name);

GetCreativeAsync(GetCreativeRequest, CallSettings)

Retrieves a Creative object.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
GetCreativeRequest request = new GetCreativeRequest
{
    CreativeName = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(request);

GetCreativeAsync(GetCreativeRequest, CancellationToken)

Retrieves a Creative object.

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

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
GetCreativeRequest request = new GetCreativeRequest
{
    CreativeName = CreativeName.FromNetworkCodeCreative("[NETWORK_CODE]", "[CREATIVE]"),
};
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(request);

GetCreativeAsync(string, CallSettings)

Retrieves a Creative object.

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

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Creative>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/creatives/[CREATIVE]";
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(name);

GetCreativeAsync(string, CancellationToken)

Retrieves a Creative object.

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

Required. The resource name of the Creative. Format: networks/{network_code}/creatives/{creative_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Creative>

A Task containing the RPC response.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/creatives/[CREATIVE]";
// Make the request
Creative response = await creativeServiceClient.GetCreativeAsync(name);

ListCreatives(ListCreativesRequest, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedEnumerable<ListCreativesResponse, Creative> ListCreatives(ListCreativesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCreativesRequest 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<ListCreativesResponse, Creative>

A pageable sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
ListCreativesRequest request = new ListCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreatives(request);

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

ListCreatives(NetworkName, string, int?, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedEnumerable<ListCreativesResponse, Creative> ListCreatives(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 Creatives. 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<ListCreativesResponse, Creative>

A pageable sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreatives(parent);

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

ListCreatives(string, string, int?, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedEnumerable<ListCreativesResponse, Creative> ListCreatives(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 Creatives. 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<ListCreativesResponse, Creative>

A pageable sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = CreativeServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreatives(parent);

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

ListCreativesAsync(ListCreativesRequest, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedAsyncEnumerable<ListCreativesResponse, Creative> ListCreativesAsync(ListCreativesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListCreativesRequest 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<ListCreativesResponse, Creative>

A pageable asynchronous sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
ListCreativesRequest request = new ListCreativesRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreativesAsync(request);

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

ListCreativesAsync(NetworkName, string, int?, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedAsyncEnumerable<ListCreativesResponse, Creative> ListCreativesAsync(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 Creatives. 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<ListCreativesResponse, Creative>

A pageable asynchronous sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreativesAsync(parent);

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

ListCreativesAsync(string, string, int?, CallSettings)

Lists Creative objects.

Declaration
public virtual PagedAsyncEnumerable<ListCreativesResponse, Creative> ListCreativesAsync(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 Creatives. 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<ListCreativesResponse, Creative>

A pageable asynchronous sequence of Creative resources.

Sample code
// Create client
CreativeServiceClient creativeServiceClient = await CreativeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListCreativesResponse, Creative> response = creativeServiceClient.ListCreativesAsync(parent);

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

In this article
Back to top Generated by DocFX