Google BigQuery v2 API - Class BigQueryRoutine (3.3.0)

public sealed class BigQueryRoutine

Reference documentation and code samples for the Google BigQuery v2 API class BigQueryRoutine.

A routine within a BigQuery dataset.

Inheritance

object > BigQueryRoutine

Namespace

GoogleGoogle.CloudGoogle.Cloud.BigQueryV2

Assembly

Google.Cloud.BigQuery.V2.dll

Remarks

This class wraps the underlying REST API resource and retains a reference to the original client, allowing for simpler routine-oriented operations.

Constructors

BigQueryRoutine(BigQueryClient, Routine)

public BigQueryRoutine(BigQueryClient client, Routine resource)

Constructs a new routine.

Parameters
NameDescription
clientBigQueryClient

The client to use for operations on the routine. Must not be null.

resourceRoutine

The REST-ful resource representing the routine. Must not be null.

Remarks

This is public to allow tests to construct instances for production code to consume; production code should not normally construct instances itself.

Properties

FullyQualifiedId

public string FullyQualifiedId { get; }

The fully-qualified identifier for the routine in a string form of project.dataset.routine.

Property Value
TypeDescription
string

Reference

public RoutineReference Reference { get; }

The fully-qualified identifier for the routine, as an object which can be used for other operations within this API.

Property Value
TypeDescription
RoutineReference
Remarks

The properties within the reference can be used to determine the project ID, dataset ID and routine ID components.

Resource

public Routine Resource { get; }

The underlying REST-ful resource for the routine.

Property Value
TypeDescription
Routine
Remarks

The data within the resource may be incomplete, depending on how it was obtained, because for both get and list operations, a read mask can be specified that determines which fields are populated on the returned resource.

Methods

Delete(DeleteRoutineOptions)

public void Delete(DeleteRoutineOptions options = null)

Deletes this routine. This method just creates a RoutineReference and delegates to DeleteRoutine(RoutineReference, DeleteRoutineOptions).

Parameter
NameDescription
optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteAsync(DeleteRoutineOptions, CancellationToken)

public Task DeleteAsync(DeleteRoutineOptions options = null, CancellationToken cancellationToken = default)

Asynchronously deletes this routine. This method just creates a RoutineReference and delegates to DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken).

Parameters
NameDescription
optionsDeleteRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.

Update(Routine, UpdateRoutineOptions)

public BigQueryRoutine Update(Routine resource = null, UpdateRoutineOptions options = null)

Updates this routine to match the specified resource.

Parameters
NameDescription
resourceRoutine

The resource to update with. If null, the Resource property is used.

optionsUpdateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
TypeDescription
BigQueryRoutine

The updated routine.

Remarks

This method delegates to UpdateRoutine(RoutineReference, Routine, UpdateRoutineOptions). A simple way of updating the routine is to modify Resource and then call this method with no arguments. This is convenient, but it's important to understand that modifying Resource in this way leaves this object in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag will be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion, we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method as the new, self-consistent representation of the routine.

UpdateAsync(Routine, UpdateRoutineOptions, CancellationToken)

public Task<BigQueryRoutine> UpdateAsync(Routine resource = null, UpdateRoutineOptions options = null, CancellationToken cancellationToken = default)

Asynchronously updates this routine to match the specified resource.

Parameters
NameDescription
resourceRoutine

The resource to update with. If null, the Resource property is used.

optionsUpdateRoutineOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
TaskBigQueryRoutine

A task representing the asynchronous operation. When complete, the result is the updated routine.

Remarks

This method delegates to UpdateRoutineAsync(RoutineReference, Routine, UpdateRoutineOptions, CancellationToken). A simple way of updating the routine is to modify Resource and then call this method with no arguments. This is convenient, but it's important to understand that modifying Resource in this way leaves this object in an unusual state - it represents "the table as it was when fetched, but then modified locally". For example, the etag will be the original etag, rather than the one associated with the updated routine. To avoid this causing confusion, we recommend only taking this approach if the object will not be used afterwards. Use the value returned by this method as the new, self-consistent representation of the routine.