# Dataflow v1beta3 API - Class TemplatesServiceClient (2.0.0-beta10)

2.0.0-beta10 (latest) 2.0.0-beta09 1.0.0-beta03

    public abstract class TemplatesServiceClient

Reference documentation and code samples for the Dataflow v1beta3 API class TemplatesServiceClient.

TemplatesService client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> TemplatesServiceClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[TemplatesServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClientImpl)

## Namespace

[Google.Cloud.Dataflow.V1Beta3](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3)

## Assembly

Google.Cloud.Dataflow.V1Beta3.dll

## Remarks

Provides a method to create Cloud Dataflow jobs from templates.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the TemplatesService service, which is a host of "dataflow.googleapis.com" and a
port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default TemplatesService scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default TemplatesService scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/compute>

### GrpcClient

    public virtual TemplatesService.TemplatesServiceClient GrpcClient { get; }

The underlying gRPC TemplatesService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesService.TemplatesServiceClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static TemplatesServiceClient Create()

Synchronously creates a [TemplatesServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [TemplatesServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient` | The created [TemplatesServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient). |

### CreateAsync(CancellationToken)

    public static Task<TemplatesServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [TemplatesServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [TemplatesServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient` | The task representing the created [TemplatesServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient). |

### CreateJobFromTemplate(CreateJobFromTemplateRequest, CallSettings)

    public virtual Job CreateJobFromTemplate(CreateJobFromTemplateRequest request, CallSettings callSettings = null)

Creates a Cloud Dataflow job from a template. Do not enter confidential
information when you supply string values using the API.

To create a job, we recommend using `projects.locations.templates.create`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.create` is not recommended, because your job will
always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.CreateJobFromTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.Job` | The RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
    // Initialize request argument(s)
    CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        Parameters = { { "", "" }, },
        JobName = "",
        Environment = new RuntimeEnvironment(),
        Location = "",
    };
    // Make the request
    Job response = templatesServiceClient.CreateJobFromTemplate(request);

### CreateJobFromTemplateAsync(CreateJobFromTemplateRequest, CallSettings)

    public virtual Task<Job> CreateJobFromTemplateAsync(CreateJobFromTemplateRequest request, CallSettings callSettings = null)

Creates a Cloud Dataflow job from a template. Do not enter confidential
information when you supply string values using the API.

To create a job, we recommend using `projects.locations.templates.create`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.create` is not recommended, because your job will
always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.CreateJobFromTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.Job` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        Parameters = { { "", "" }, },
        JobName = "",
        Environment = new RuntimeEnvironment(),
        Location = "",
    };
    // Make the request
    Job response = await templatesServiceClient.CreateJobFromTemplateAsync(request);

### CreateJobFromTemplateAsync(CreateJobFromTemplateRequest, CancellationToken)

    public virtual Task<Job> CreateJobFromTemplateAsync(CreateJobFromTemplateRequest request, CancellationToken cancellationToken)

Creates a Cloud Dataflow job from a template. Do not enter confidential
information when you supply string values using the API.

To create a job, we recommend using `projects.locations.templates.create`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.create` is not recommended, because your job will
always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.CreateJobFromTemplateRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.Job` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    CreateJobFromTemplateRequest request = new CreateJobFromTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        Parameters = { { "", "" }, },
        JobName = "",
        Environment = new RuntimeEnvironment(),
        Location = "",
    };
    // Make the request
    Job response = await templatesServiceClient.CreateJobFromTemplateAsync(request);

### GetTemplate(GetTemplateRequest, CallSettings)

    public virtual GetTemplateResponse GetTemplate(GetTemplateRequest request, CallSettings callSettings = null)

Get the template associated with a template.

To get the template, we recommend using `projects.locations.templates.get`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.get` is not recommended, because only
templates that are running in `us-central1` are retrieved.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateResponse` | The RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
    // Initialize request argument(s)
    GetTemplateRequest request = new GetTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
        Location = "",
    };
    // Make the request
    GetTemplateResponse response = templatesServiceClient.GetTemplate(request);

### GetTemplateAsync(GetTemplateRequest, CallSettings)

    public virtual Task<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, CallSettings callSettings = null)

Get the template associated with a template.

To get the template, we recommend using `projects.locations.templates.get`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.get` is not recommended, because only
templates that are running in `us-central1` are retrieved.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetTemplateRequest request = new GetTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
        Location = "",
    };
    // Make the request
    GetTemplateResponse response = await templatesServiceClient.GetTemplateAsync(request);

### GetTemplateAsync(GetTemplateRequest, CancellationToken)

    public virtual Task<GetTemplateResponse> GetTemplateAsync(GetTemplateRequest request, CancellationToken cancellationToken)

Get the template associated with a template.

To get the template, we recommend using `projects.locations.templates.get`
with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.get` is not recommended, because only
templates that are running in `us-central1` are retrieved.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.GetTemplateResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetTemplateRequest request = new GetTemplateRequest
    {
        ProjectId = "",
        GcsPath = "",
        View = GetTemplateRequest.Types.TemplateView.MetadataOnly,
        Location = "",
    };
    // Make the request
    GetTemplateResponse response = await templatesServiceClient.GetTemplateAsync(request);

### LaunchTemplate(LaunchTemplateRequest, CallSettings)

    public virtual LaunchTemplateResponse LaunchTemplate(LaunchTemplateRequest request, CallSettings callSettings = null)

Launches a template.

To launch a template, we recommend using
`projects.locations.templates.launch` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.launch` is not recommended, because jobs launched
from the template will always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateResponse` | The RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = TemplatesServiceClient.Create();
    // Initialize request argument(s)
    LaunchTemplateRequest request = new LaunchTemplateRequest
    {
        ProjectId = "",
        ValidateOnly = false,
        GcsPath = "",
        LaunchParameters = new LaunchTemplateParameters(),
        Location = "",
    };
    // Make the request
    LaunchTemplateResponse response = templatesServiceClient.LaunchTemplate(request);

### LaunchTemplateAsync(LaunchTemplateRequest, CallSettings)

    public virtual Task<LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, CallSettings callSettings = null)

Launches a template.

To launch a template, we recommend using
`projects.locations.templates.launch` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.launch` is not recommended, because jobs launched
from the template will always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    LaunchTemplateRequest request = new LaunchTemplateRequest
    {
        ProjectId = "",
        ValidateOnly = false,
        GcsPath = "",
        LaunchParameters = new LaunchTemplateParameters(),
        Location = "",
    };
    // Make the request
    LaunchTemplateResponse response = await templatesServiceClient.LaunchTemplateAsync(request);

### LaunchTemplateAsync(LaunchTemplateRequest, CancellationToken)

    public virtual Task<LaunchTemplateResponse> LaunchTemplateAsync(LaunchTemplateRequest request, CancellationToken cancellationToken)

Launches a template.

To launch a template, we recommend using
`projects.locations.templates.launch` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
`projects.templates.launch` is not recommended, because jobs launched
from the template will always start in `us-central1`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.LaunchTemplateResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    TemplatesServiceClient templatesServiceClient = await TemplatesServiceClient.CreateAsync();
    // Initialize request argument(s)
    LaunchTemplateRequest request = new LaunchTemplateRequest
    {
        ProjectId = "",
        ValidateOnly = false,
        GcsPath = "",
        LaunchParameters = new LaunchTemplateParameters(),
        Location = "",
    };
    // Make the request
    LaunchTemplateResponse response = await templatesServiceClient.LaunchTemplateAsync(request);

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient#Google_Cloud_Dataflow_V1Beta3_TemplatesServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient#Google_Cloud_Dataflow_V1Beta3_TemplatesServiceClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient#Google_Cloud_Dataflow_V1Beta3_TemplatesServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataflow.V1Beta3/latest/Google.Cloud.Dataflow.V1Beta3.TemplatesServiceClient#Google_Cloud_Dataflow_V1Beta3_TemplatesServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.