Show / Hide Table of Contents

Class ForecastServiceClient

ForecastService client wrapper, for convenient use.

Inheritance
object
ForecastServiceClient
ForecastServiceClientImpl
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 ForecastServiceClient
Remarks

Provides methods for handling forecasting actions.

Properties

DefaultEndpoint

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

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

The default ForecastService scopes are:

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

GrpcClient

The underlying gRPC ForecastService client

Declaration
public virtual ForecastService.ForecastServiceClient GrpcClient { get; }
Property Value
Type Description
ForecastService.ForecastServiceClient

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 ForecastServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ForecastServiceClientBuilder.

Declaration
public static ForecastServiceClient Create()
Returns
Type Description
ForecastServiceClient

The created ForecastServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ForecastServiceClient>

The task representing the created ForecastServiceClient.

RunAvailabilityForecast(NetworkName, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual RunAvailabilityForecastResponse RunAvailabilityForecast(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunAvailabilityForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunAvailabilityForecastResponse response = forecastServiceClient.RunAvailabilityForecast(parent);

RunAvailabilityForecast(RunAvailabilityForecastRequest, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual RunAvailabilityForecastResponse RunAvailabilityForecast(RunAvailabilityForecastRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
RunAvailabilityForecastRequest 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
RunAvailabilityForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
RunAvailabilityForecastRequest request = new RunAvailabilityForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AvailabilityForecastOptions = new AvailabilityForecastOptions(),
    ExistingLineItemAsLineItemName = LineItemName.FromNetworkCodeLineItem("[NETWORK_CODE]", "[LINE_ITEM]"),
};
// Make the request
RunAvailabilityForecastResponse response = forecastServiceClient.RunAvailabilityForecast(request);

RunAvailabilityForecast(string, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual RunAvailabilityForecastResponse RunAvailabilityForecast(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunAvailabilityForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunAvailabilityForecastResponse response = forecastServiceClient.RunAvailabilityForecast(parent);

RunAvailabilityForecastAsync(NetworkName, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual Task<RunAvailabilityForecastResponse> RunAvailabilityForecastAsync(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunAvailabilityForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(parent);

RunAvailabilityForecastAsync(NetworkName, CancellationToken)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual Task<RunAvailabilityForecastResponse> RunAvailabilityForecastAsync(NetworkName parent, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunAvailabilityForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(parent);

RunAvailabilityForecastAsync(RunAvailabilityForecastRequest, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunAvailabilityForecastRequest request = new RunAvailabilityForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AvailabilityForecastOptions = new AvailabilityForecastOptions(),
    ExistingLineItemAsLineItemName = LineItemName.FromNetworkCodeLineItem("[NETWORK_CODE]", "[LINE_ITEM]"),
};
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(request);

RunAvailabilityForecastAsync(RunAvailabilityForecastRequest, CancellationToken)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunAvailabilityForecastRequest request = new RunAvailabilityForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    AvailabilityForecastOptions = new AvailabilityForecastOptions(),
    ExistingLineItemAsLineItemName = LineItemName.FromNetworkCodeLineItem("[NETWORK_CODE]", "[LINE_ITEM]"),
};
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(request);

RunAvailabilityForecastAsync(string, CallSettings)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual Task<RunAvailabilityForecastResponse> RunAvailabilityForecastAsync(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunAvailabilityForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(parent);

RunAvailabilityForecastAsync(string, CancellationToken)

Gets the availability forecast for a [ProposalLineItem][] or [LineItem][google.ads.admanager.v1.LineItem]. An availability forecast reports the maximum number of available units that the line item can book, and the total number of units matching the line item's targeting.

Declaration
public virtual Task<RunAvailabilityForecastResponse> RunAvailabilityForecastAsync(string parent, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunAvailabilityForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunAvailabilityForecastResponse response = await forecastServiceClient.RunAvailabilityForecastAsync(parent);

RunDeliveryForecast(NetworkName, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual RunDeliveryForecastResponse RunDeliveryForecast(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunDeliveryForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunDeliveryForecastResponse response = forecastServiceClient.RunDeliveryForecast(parent);

RunDeliveryForecast(RunDeliveryForecastRequest, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual RunDeliveryForecastResponse RunDeliveryForecast(RunDeliveryForecastRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
RunDeliveryForecastRequest 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
RunDeliveryForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
RunDeliveryForecastRequest request = new RunDeliveryForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    DeliveryForecastOptions = new DeliveryForecastOptions(),
    ExistingLineItems = new ExistingLineItemList(),
};
// Make the request
RunDeliveryForecastResponse response = forecastServiceClient.RunDeliveryForecast(request);

RunDeliveryForecast(string, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual RunDeliveryForecastResponse RunDeliveryForecast(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunDeliveryForecastResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunDeliveryForecastResponse response = forecastServiceClient.RunDeliveryForecast(parent);

RunDeliveryForecastAsync(NetworkName, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual Task<RunDeliveryForecastResponse> RunDeliveryForecastAsync(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunDeliveryForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(parent);

RunDeliveryForecastAsync(NetworkName, CancellationToken)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual Task<RunDeliveryForecastResponse> RunDeliveryForecastAsync(NetworkName parent, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunDeliveryForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(parent);

RunDeliveryForecastAsync(RunDeliveryForecastRequest, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunDeliveryForecastRequest request = new RunDeliveryForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    DeliveryForecastOptions = new DeliveryForecastOptions(),
    ExistingLineItems = new ExistingLineItemList(),
};
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(request);

RunDeliveryForecastAsync(RunDeliveryForecastRequest, CancellationToken)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunDeliveryForecastRequest request = new RunDeliveryForecastRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    DeliveryForecastOptions = new DeliveryForecastOptions(),
    ExistingLineItems = new ExistingLineItemList(),
};
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(request);

RunDeliveryForecastAsync(string, CallSettings)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual Task<RunDeliveryForecastResponse> RunDeliveryForecastAsync(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunDeliveryForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(parent);

RunDeliveryForecastAsync(string, CancellationToken)

Runs a delivery simulation forecast for existing or prospective line items. A delivery forecast reports the number of units that will be delivered to each line item given the line item goals. The simulation considers contentions from other line items, including the other prospective line items in the request.

Declaration
public virtual Task<RunDeliveryForecastResponse> RunDeliveryForecastAsync(string parent, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunDeliveryForecastResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunDeliveryForecastResponse response = await forecastServiceClient.RunDeliveryForecastAsync(parent);

RunTrafficData(NetworkName, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual RunTrafficDataResponse RunTrafficData(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunTrafficDataResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunTrafficDataResponse response = forecastServiceClient.RunTrafficData(parent);

RunTrafficData(RunTrafficDataRequest, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual RunTrafficDataResponse RunTrafficData(RunTrafficDataRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
RunTrafficDataRequest 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
RunTrafficDataResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
RunTrafficDataRequest request = new RunTrafficDataRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Targeting = new Targeting(),
    RequestedDateRange = new DateRange(),
};
// Make the request
RunTrafficDataResponse response = forecastServiceClient.RunTrafficData(request);

RunTrafficData(string, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual RunTrafficDataResponse RunTrafficData(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RunTrafficDataResponse

The RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = ForecastServiceClient.Create();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunTrafficDataResponse response = forecastServiceClient.RunTrafficData(parent);

RunTrafficDataAsync(NetworkName, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual Task<RunTrafficDataResponse> RunTrafficDataAsync(NetworkName parent, CallSettings callSettings = null)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunTrafficDataResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(parent);

RunTrafficDataAsync(NetworkName, CancellationToken)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual Task<RunTrafficDataResponse> RunTrafficDataAsync(NetworkName parent, CancellationToken cancellationToken)
Parameters
Type Name Description
NetworkName parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunTrafficDataResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
NetworkName parent = NetworkName.FromNetworkCode("[NETWORK_CODE]");
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(parent);

RunTrafficDataAsync(RunTrafficDataRequest, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunTrafficDataRequest request = new RunTrafficDataRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Targeting = new Targeting(),
    RequestedDateRange = new DateRange(),
};
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(request);

RunTrafficDataAsync(RunTrafficDataRequest, CancellationToken)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

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

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
RunTrafficDataRequest request = new RunTrafficDataRequest
{
    ParentAsNetworkName = NetworkName.FromNetworkCode("[NETWORK_CODE]"),
    Targeting = new Targeting(),
    RequestedDateRange = new DateRange(),
};
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(request);

RunTrafficDataAsync(string, CallSettings)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual Task<RunTrafficDataResponse> RunTrafficDataAsync(string parent, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<RunTrafficDataResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(parent);

RunTrafficDataAsync(string, CancellationToken)

Gets forecasted and historical traffic data for the segment of traffic specified by the provided request.

Declaration
public virtual Task<RunTrafficDataResponse> RunTrafficDataAsync(string parent, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. Format: networks/{network_code}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<RunTrafficDataResponse>

A Task containing the RPC response.

Sample code
// Create client
ForecastServiceClient forecastServiceClient = await ForecastServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "networks/[NETWORK_CODE]";
// Make the request
RunTrafficDataResponse response = await forecastServiceClient.RunTrafficDataAsync(parent);

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