Class NetworkServiceClient
NetworkService client wrapper, for convenient use.
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public abstract class NetworkServiceClient
Remarks
Provides methods for handling Network objects.
Properties
DefaultEndpoint
The default endpoint for the NetworkService 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 NetworkService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default NetworkService scopes are:
- https://www.googleapis.com/auth/admanager
- https://www.googleapis.com/auth/admanager.readonly
GrpcClient
The underlying gRPC NetworkService client
Declaration
public virtual NetworkService.NetworkServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| NetworkService.NetworkServiceClient |
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 NetworkServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use NetworkServiceClientBuilder.
Declaration
public static NetworkServiceClient Create()
Returns
| Type | Description |
|---|---|
| NetworkServiceClient | The created NetworkServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a NetworkServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use NetworkServiceClientBuilder.
Declaration
public static Task<NetworkServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<NetworkServiceClient> | The task representing the created NetworkServiceClient. |
GetDefaultThirdPartyDataDeclaration(DefaultThirdPartyDataDeclarationName, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual DefaultThirdPartyDataDeclaration GetDefaultThirdPartyDataDeclaration(DefaultThirdPartyDataDeclarationName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultThirdPartyDataDeclarationName | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| DefaultThirdPartyDataDeclaration | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
DefaultThirdPartyDataDeclarationName name = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
DefaultThirdPartyDataDeclaration response = networkServiceClient.GetDefaultThirdPartyDataDeclaration(name);
GetDefaultThirdPartyDataDeclaration(GetDefaultThirdPartyDataDeclarationRequest, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual DefaultThirdPartyDataDeclaration GetDefaultThirdPartyDataDeclaration(GetDefaultThirdPartyDataDeclarationRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetDefaultThirdPartyDataDeclarationRequest | 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 |
|---|---|
| DefaultThirdPartyDataDeclaration | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
GetDefaultThirdPartyDataDeclarationRequest request = new GetDefaultThirdPartyDataDeclarationRequest
{
DefaultThirdPartyDataDeclarationName = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
DefaultThirdPartyDataDeclaration response = networkServiceClient.GetDefaultThirdPartyDataDeclaration(request);
GetDefaultThirdPartyDataDeclaration(string, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual DefaultThirdPartyDataDeclaration GetDefaultThirdPartyDataDeclaration(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| DefaultThirdPartyDataDeclaration | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/defaultThirdPartyDataDeclaration";
// Make the request
DefaultThirdPartyDataDeclaration response = networkServiceClient.GetDefaultThirdPartyDataDeclaration(name);
GetDefaultThirdPartyDataDeclarationAsync(DefaultThirdPartyDataDeclarationName, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(DefaultThirdPartyDataDeclarationName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultThirdPartyDataDeclarationName | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
DefaultThirdPartyDataDeclarationName name = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(name);
GetDefaultThirdPartyDataDeclarationAsync(DefaultThirdPartyDataDeclarationName, CancellationToken)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(DefaultThirdPartyDataDeclarationName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultThirdPartyDataDeclarationName | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
DefaultThirdPartyDataDeclarationName name = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(name);
GetDefaultThirdPartyDataDeclarationAsync(GetDefaultThirdPartyDataDeclarationRequest, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(GetDefaultThirdPartyDataDeclarationRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetDefaultThirdPartyDataDeclarationRequest | 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<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
GetDefaultThirdPartyDataDeclarationRequest request = new GetDefaultThirdPartyDataDeclarationRequest
{
DefaultThirdPartyDataDeclarationName = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(request);
GetDefaultThirdPartyDataDeclarationAsync(GetDefaultThirdPartyDataDeclarationRequest, CancellationToken)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(GetDefaultThirdPartyDataDeclarationRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetDefaultThirdPartyDataDeclarationRequest | 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<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
GetDefaultThirdPartyDataDeclarationRequest request = new GetDefaultThirdPartyDataDeclarationRequest
{
DefaultThirdPartyDataDeclarationName = DefaultThirdPartyDataDeclarationName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(request);
GetDefaultThirdPartyDataDeclarationAsync(string, CallSettings)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/defaultThirdPartyDataDeclaration";
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(name);
GetDefaultThirdPartyDataDeclarationAsync(string, CancellationToken)
Returns the [DefaultThirdPartyDataDeclaration] for this network.
Declaration
public virtual Task<DefaultThirdPartyDataDeclaration> GetDefaultThirdPartyDataDeclarationAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of DefaultThirdPartyDataDeclaration. Format: networks/{network_code}/defaultThirdPartyDataDeclaration |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<DefaultThirdPartyDataDeclaration> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]/defaultThirdPartyDataDeclaration";
// Make the request
DefaultThirdPartyDataDeclaration response = await networkServiceClient.GetDefaultThirdPartyDataDeclarationAsync(name);
GetNetwork(GetNetworkRequest, CallSettings)
Retrieves a Network object.
Declaration
public virtual Network GetNetwork(GetNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNetworkRequest | 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 |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
GetNetworkRequest request = new GetNetworkRequest
{
NetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
Network response = networkServiceClient.GetNetwork(request);
GetNetwork(NetworkName, CallSettings)
Retrieves a Network object.
Declaration
public virtual Network GetNetwork(NetworkName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | name | Required. Resource name of Network. Format: networks/{network_code} |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
NetworkName name = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
Network response = networkServiceClient.GetNetwork(name);
GetNetwork(string, CallSettings)
Retrieves a Network object.
Declaration
public virtual Network GetNetwork(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of Network. Format: networks/{network_code} |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]";
// Make the request
Network response = networkServiceClient.GetNetwork(name);
GetNetworkAsync(GetNetworkRequest, CallSettings)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(GetNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
GetNetworkRequest request = new GetNetworkRequest
{
NetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(request);
GetNetworkAsync(GetNetworkRequest, CancellationToken)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(GetNetworkRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
GetNetworkRequest request = new GetNetworkRequest
{
NetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
};
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(request);
GetNetworkAsync(NetworkName, CallSettings)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(NetworkName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | name | Required. Resource name of Network. Format: networks/{network_code} |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName name = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(name);
GetNetworkAsync(NetworkName, CancellationToken)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(NetworkName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkName | name | Required. Resource name of Network. Format: networks/{network_code} |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName name = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(name);
GetNetworkAsync(string, CallSettings)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of Network. Format: networks/{network_code} |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]";
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(name);
GetNetworkAsync(string, CancellationToken)
Retrieves a Network object.
Declaration
public virtual Task<Network> GetNetworkAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. Resource name of Network. Format: networks/{network_code} |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "networks/[NETWORK_CODE]";
// Make the request
Network response = await networkServiceClient.GetNetworkAsync(name);
ListNetworks(ListNetworksRequest, CallSettings)
Retrieves all the networks the current user has access to.
Declaration
public virtual PagedEnumerable<ListNetworksResponse, Network> ListNetworks(ListNetworksRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListNetworksRequest | 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<ListNetworksResponse, Network> | A pageable sequence of Network resources. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
ListNetworksRequest request = new ListNetworksRequest { Skip = 0, };
// Make the request
PagedEnumerable<ListNetworksResponse, Network> response = networkServiceClient.ListNetworks(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Network 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 (ListNetworksResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Network 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<Network> 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 (Network 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;
ListNetworksAsync(ListNetworksRequest, CallSettings)
Retrieves all the networks the current user has access to.
Declaration
public virtual PagedAsyncEnumerable<ListNetworksResponse, Network> ListNetworksAsync(ListNetworksRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListNetworksRequest | 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<ListNetworksResponse, Network> | A pageable asynchronous sequence of Network resources. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
ListNetworksRequest request = new ListNetworksRequest { Skip = 0, };
// Make the request
PagedAsyncEnumerable<ListNetworksResponse, Network> response = networkServiceClient.ListNetworksAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Network 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 (ListNetworksResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Network 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<Network> 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 (Network 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;
ProvisionTestNetwork(ProvisionTestNetworkRequest, CallSettings)
Provisions a test network associated with the current user. Only one test network can be provisioned per user.
Before the test network can be used, you must complete setup in the Ad Manager UI. If the test network's owner is a service account, you must add a non-service account user by calling UserService.CreateUser.
Test networks are limited in the following ways:
- Test networks have a maximum of 10,000 objects per entity type.
- Test networks cannot serve ads.
- Reports on serving data have zero rows.
- Forecast service results contain mock data.
- Test networks do not have Ad Manager 360 or premium features enabled.
Declaration
public virtual Network ProvisionTestNetwork(ProvisionTestNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProvisionTestNetworkRequest | 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 |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
ProvisionTestNetworkRequest request = new ProvisionTestNetworkRequest { };
// Make the request
Network response = networkServiceClient.ProvisionTestNetwork(request);
ProvisionTestNetworkAsync(ProvisionTestNetworkRequest, CallSettings)
Provisions a test network associated with the current user. Only one test network can be provisioned per user.
Before the test network can be used, you must complete setup in the Ad Manager UI. If the test network's owner is a service account, you must add a non-service account user by calling UserService.CreateUser.
Test networks are limited in the following ways:
- Test networks have a maximum of 10,000 objects per entity type.
- Test networks cannot serve ads.
- Reports on serving data have zero rows.
- Forecast service results contain mock data.
- Test networks do not have Ad Manager 360 or premium features enabled.
Declaration
public virtual Task<Network> ProvisionTestNetworkAsync(ProvisionTestNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProvisionTestNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
ProvisionTestNetworkRequest request = new ProvisionTestNetworkRequest { };
// Make the request
Network response = await networkServiceClient.ProvisionTestNetworkAsync(request);
ProvisionTestNetworkAsync(ProvisionTestNetworkRequest, CancellationToken)
Provisions a test network associated with the current user. Only one test network can be provisioned per user.
Before the test network can be used, you must complete setup in the Ad Manager UI. If the test network's owner is a service account, you must add a non-service account user by calling UserService.CreateUser.
Test networks are limited in the following ways:
- Test networks have a maximum of 10,000 objects per entity type.
- Test networks cannot serve ads.
- Reports on serving data have zero rows.
- Forecast service results contain mock data.
- Test networks do not have Ad Manager 360 or premium features enabled.
Declaration
public virtual Task<Network> ProvisionTestNetworkAsync(ProvisionTestNetworkRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ProvisionTestNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
ProvisionTestNetworkRequest request = new ProvisionTestNetworkRequest { };
// Make the request
Network response = await networkServiceClient.ProvisionTestNetworkAsync(request);
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.
UpdateNetwork(Network, FieldMask, CallSettings)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Network UpdateNetwork(Network network, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Network | network | Required. The The |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
Network network = new Network();
FieldMask updateMask = new FieldMask();
// Make the request
Network response = networkServiceClient.UpdateNetwork(network, updateMask);
UpdateNetwork(UpdateNetworkRequest, CallSettings)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Network UpdateNetwork(UpdateNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateNetworkRequest | 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 |
|---|---|
| Network | The RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = NetworkServiceClient.Create();
// Initialize request argument(s)
UpdateNetworkRequest request = new UpdateNetworkRequest
{
Network = new Network(),
UpdateMask = new FieldMask(),
};
// Make the request
Network response = networkServiceClient.UpdateNetwork(request);
UpdateNetworkAsync(Network, FieldMask, CallSettings)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Task<Network> UpdateNetworkAsync(Network network, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Network | network | Required. The The |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
Network network = new Network();
FieldMask updateMask = new FieldMask();
// Make the request
Network response = await networkServiceClient.UpdateNetworkAsync(network, updateMask);
UpdateNetworkAsync(Network, FieldMask, CancellationToken)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Task<Network> UpdateNetworkAsync(Network network, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Network | network | Required. The The |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
Network network = new Network();
FieldMask updateMask = new FieldMask();
// Make the request
Network response = await networkServiceClient.UpdateNetworkAsync(network, updateMask);
UpdateNetworkAsync(UpdateNetworkRequest, CallSettings)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Task<Network> UpdateNetworkAsync(UpdateNetworkRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateNetworkRequest request = new UpdateNetworkRequest
{
Network = new Network(),
UpdateMask = new FieldMask(),
};
// Make the request
Network response = await networkServiceClient.UpdateNetworkAsync(request);
UpdateNetworkAsync(UpdateNetworkRequest, CancellationToken)
Updates a Network object. Currently, only the network display name can be
updated.
Declaration
public virtual Task<Network> UpdateNetworkAsync(UpdateNetworkRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateNetworkRequest | 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<Network> | A Task containing the RPC response. |
Sample code
// Create client
NetworkServiceClient networkServiceClient = await NetworkServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateNetworkRequest request = new UpdateNetworkRequest
{
Network = new Network(),
UpdateMask = new FieldMask(),
};
// Make the request
Network response = await networkServiceClient.UpdateNetworkAsync(request);