Show / Hide Table of Contents

Class ApplicationServiceClient

ApplicationService client wrapper, for convenient use.

Inheritance
object
ApplicationServiceClient
ApplicationServiceClientImpl
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 ApplicationServiceClient
Remarks

Provides methods for handling Application objects.

Properties

DefaultEndpoint

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

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

The default ApplicationService scopes are:

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

GrpcClient

The underlying gRPC ApplicationService client

Declaration
public virtual ApplicationService.ApplicationServiceClient GrpcClient { get; }
Property Value
Type Description
ApplicationService.ApplicationServiceClient

ServiceMetadata

The service metadata associated with this client type.

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

Methods

Create()

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

Declaration
public static ApplicationServiceClient Create()
Returns
Type Description
ApplicationServiceClient

The created ApplicationServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ApplicationServiceClient>

The task representing the created ApplicationServiceClient.

GetApplication(ApplicationName, CallSettings)

API to retrieve a Application object.

Declaration
public virtual Application GetApplication(ApplicationName name, CallSettings callSettings = null)
Parameters
Type Name Description
ApplicationName name

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Application

The RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
ApplicationName name = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]");
// Make the request
Application response = applicationServiceClient.GetApplication(name);

GetApplication(GetApplicationRequest, CallSettings)

API to retrieve a Application object.

Declaration
public virtual Application GetApplication(GetApplicationRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetApplicationRequest 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
Application

The RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
GetApplicationRequest request = new GetApplicationRequest
{
    ApplicationName = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]"),
};
// Make the request
Application response = applicationServiceClient.GetApplication(request);

GetApplication(string, CallSettings)

API to retrieve a Application object.

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

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Application

The RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/applications/[APPLICATION]";
// Make the request
Application response = applicationServiceClient.GetApplication(name);

GetApplicationAsync(ApplicationName, CallSettings)

API to retrieve a Application object.

Declaration
public virtual Task<Application> GetApplicationAsync(ApplicationName name, CallSettings callSettings = null)
Parameters
Type Name Description
ApplicationName name

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Application>

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
ApplicationName name = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]");
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(name);

GetApplicationAsync(ApplicationName, CancellationToken)

API to retrieve a Application object.

Declaration
public virtual Task<Application> GetApplicationAsync(ApplicationName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ApplicationName name

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Application>

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
ApplicationName name = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]");
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(name);

GetApplicationAsync(GetApplicationRequest, CallSettings)

API to retrieve a Application object.

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

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
GetApplicationRequest request = new GetApplicationRequest
{
    ApplicationName = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]"),
};
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(request);

GetApplicationAsync(GetApplicationRequest, CancellationToken)

API to retrieve a Application object.

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

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
GetApplicationRequest request = new GetApplicationRequest
{
    ApplicationName = ApplicationName.FromNetworkCodeApplication("[NETWORK_CODE]", "[APPLICATION]"),
};
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(request);

GetApplicationAsync(string, CallSettings)

API to retrieve a Application object.

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

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Application>

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/applications/[APPLICATION]";
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(name);

GetApplicationAsync(string, CancellationToken)

API to retrieve a Application object.

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

Required. The resource name of the Application. Format: networks/{network_code}/applications/{application_id}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Application>

A Task containing the RPC response.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/applications/[APPLICATION]";
// Make the request
Application response = await applicationServiceClient.GetApplicationAsync(name);

ListApplications(ListApplicationsRequest, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedEnumerable<ListApplicationsResponse, Application> ListApplications(ListApplicationsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListApplicationsRequest 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<ListApplicationsResponse, Application>

A pageable sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
ListApplicationsRequest request = new ListApplicationsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplications(request);

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

ListApplications(NetworkName, string, int?, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedEnumerable<ListApplicationsResponse, Application> ListApplications(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 Applications. 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<ListApplicationsResponse, Application>

A pageable sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplications(parent);

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

ListApplications(string, string, int?, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedEnumerable<ListApplicationsResponse, Application> ListApplications(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 Applications. 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<ListApplicationsResponse, Application>

A pageable sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplications(parent);

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

ListApplicationsAsync(ListApplicationsRequest, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedAsyncEnumerable<ListApplicationsResponse, Application> ListApplicationsAsync(ListApplicationsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListApplicationsRequest 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<ListApplicationsResponse, Application>

A pageable asynchronous sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
ListApplicationsRequest request = new ListApplicationsRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Filter = "",
    OrderBy = "",
    Skip = 0,
};
// Make the request
PagedAsyncEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplicationsAsync(request);

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

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

ListApplicationsAsync(NetworkName, string, int?, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedAsyncEnumerable<ListApplicationsResponse, Application> ListApplicationsAsync(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 Applications. 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<ListApplicationsResponse, Application>

A pageable asynchronous sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
PagedAsyncEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplicationsAsync(parent);

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

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

ListApplicationsAsync(string, string, int?, CallSettings)

API to retrieve a list of Application objects.

Declaration
public virtual PagedAsyncEnumerable<ListApplicationsResponse, Application> ListApplicationsAsync(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 Applications. 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<ListApplicationsResponse, Application>

A pageable asynchronous sequence of Application resources.

Sample code
// Create client
ApplicationServiceClient applicationServiceClient = await ApplicationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
PagedAsyncEnumerable<ListApplicationsResponse, Application> response = applicationServiceClient.ListApplicationsAsync(parent);

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

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