public sealed class BigQueryRoutine
A routine within a BigQuery dataset.
Namespace
Google.Cloud.BigQuery.V2Assembly
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 | |
---|---|
Name | Description |
client | BigQueryClient The client to use for operations on the routine. Must not be null. |
resource | Routine The REST-ful resource representing the routine. Must not be null. |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
RoutineReference |
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 | |
---|---|
Type | Description |
Routine |
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 | |
---|---|
Name | Description |
options | DeleteRoutineOptions 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(CancellationToken))
Asynchronously deletes this routine. This method just creates a RoutineReference and delegates to DeleteRoutineAsync(RoutineReference, DeleteRoutineOptions, CancellationToken).
Parameters | |
---|---|
Name | Description |
options | DeleteRoutineOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
resource | Routine The resource to update with. If null, the Resource property is used. |
options | UpdateRoutineOptions The options for the operation. May be null, in which case defaults will be supplied. |
Returns | |
---|---|
Type | Description |
BigQueryRoutine | The updated routine. |
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(CancellationToken))
Asynchronously updates this routine to match the specified resource.
Parameters | |
---|---|
Name | Description |
resource | Routine The resource to update with. If null, the Resource property is used. |
options | UpdateRoutineOptions The options for the operation. May be null, in which case defaults will be supplied. |
cancellationToken | CancellationToken The token to monitor for cancellation requests. |
Returns | |
---|---|
Type | Description |
Task<BigQueryRoutine> | A task representing the asynchronous operation. When complete, the result is the updated routine. |
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.