public abstract class PreviewFeaturesClient
Reference documentation and code samples for the Compute Engine v1 API class PreviewFeaturesClient.
PreviewFeatures client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Compute.V1Assembly
Google.Cloud.Compute.V1.dll
Remarks
The PreviewFeatures API.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the PreviewFeatures service, which is a host of "compute.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default PreviewFeatures scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default PreviewFeatures scopes are:
GrpcClient
public virtual PreviewFeatures.PreviewFeaturesClient GrpcClient { get; }
The underlying gRPC PreviewFeatures client
Property Value | |
---|---|
Type | Description |
PreviewFeaturesPreviewFeaturesClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
UpdateOperationsClient
public virtual OperationsClient UpdateOperationsClient { get; }
The long-running operations client for Update
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static PreviewFeaturesClient Create()
Synchronously creates a PreviewFeaturesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PreviewFeaturesClientBuilder.
Returns | |
---|---|
Type | Description |
PreviewFeaturesClient |
The created PreviewFeaturesClient. |
CreateAsync(CancellationToken)
public static Task<PreviewFeaturesClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a PreviewFeaturesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PreviewFeaturesClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskPreviewFeaturesClient |
The task representing the created PreviewFeaturesClient. |
Get(GetPreviewFeatureRequest, CallSettings)
public virtual PreviewFeature Get(GetPreviewFeatureRequest request, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
GetPreviewFeatureRequest 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 |
PreviewFeature |
The RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
GetPreviewFeatureRequest request = new GetPreviewFeatureRequest
{
Project = "",
PreviewFeature = "",
};
// Make the request
PreviewFeature response = previewFeaturesClient.Get(request);
Get(string, string, CallSettings)
public virtual PreviewFeature Get(string project, string previewFeature, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PreviewFeature |
The RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
// Make the request
PreviewFeature response = previewFeaturesClient.Get(project, previewFeature);
GetAsync(GetPreviewFeatureRequest, CallSettings)
public virtual Task<PreviewFeature> GetAsync(GetPreviewFeatureRequest request, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
GetPreviewFeatureRequest 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 |
TaskPreviewFeature |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
GetPreviewFeatureRequest request = new GetPreviewFeatureRequest
{
Project = "",
PreviewFeature = "",
};
// Make the request
PreviewFeature response = await previewFeaturesClient.GetAsync(request);
GetAsync(GetPreviewFeatureRequest, CancellationToken)
public virtual Task<PreviewFeature> GetAsync(GetPreviewFeatureRequest request, CancellationToken cancellationToken)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
GetPreviewFeatureRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPreviewFeature |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
GetPreviewFeatureRequest request = new GetPreviewFeatureRequest
{
Project = "",
PreviewFeature = "",
};
// Make the request
PreviewFeature response = await previewFeaturesClient.GetAsync(request);
GetAsync(string, string, CallSettings)
public virtual Task<PreviewFeature> GetAsync(string project, string previewFeature, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPreviewFeature |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
// Make the request
PreviewFeature response = await previewFeaturesClient.GetAsync(project, previewFeature);
GetAsync(string, string, CancellationToken)
public virtual Task<PreviewFeature> GetAsync(string project, string previewFeature, CancellationToken cancellationToken)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPreviewFeature |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
// Make the request
PreviewFeature response = await previewFeaturesClient.GetAsync(project, previewFeature);
List(ListPreviewFeaturesRequest, CallSettings)
public virtual PagedEnumerable<PreviewFeatureList, PreviewFeature> List(ListPreviewFeaturesRequest request, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
ListPreviewFeaturesRequest 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 |
PagedEnumerablePreviewFeatureListPreviewFeature |
A pageable sequence of PreviewFeature resources. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
ListPreviewFeaturesRequest request = new ListPreviewFeaturesRequest
{
OrderBy = "",
Project = "",
Filter = "",
ReturnPartialSuccess = false,
};
// Make the request
PagedEnumerable<PreviewFeatureList, PreviewFeature> response = previewFeaturesClient.List(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (PreviewFeature 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 (PreviewFeatureList page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (PreviewFeature 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<PreviewFeature> 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 (PreviewFeature 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;
List(string, string, int?, CallSettings)
public virtual PagedEnumerable<PreviewFeatureList, PreviewFeature> List(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerablePreviewFeatureListPreviewFeature |
A pageable sequence of PreviewFeature resources. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
PagedEnumerable<PreviewFeatureList, PreviewFeature> response = previewFeaturesClient.List(project);
// Iterate over all response items, lazily performing RPCs as required
foreach (PreviewFeature 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 (PreviewFeatureList page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (PreviewFeature 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<PreviewFeature> 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 (PreviewFeature 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;
ListAsync(ListPreviewFeaturesRequest, CallSettings)
public virtual PagedAsyncEnumerable<PreviewFeatureList, PreviewFeature> ListAsync(ListPreviewFeaturesRequest request, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
ListPreviewFeaturesRequest 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 |
PagedAsyncEnumerablePreviewFeatureListPreviewFeature |
A pageable asynchronous sequence of PreviewFeature resources. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
ListPreviewFeaturesRequest request = new ListPreviewFeaturesRequest
{
OrderBy = "",
Project = "",
Filter = "",
ReturnPartialSuccess = false,
};
// Make the request
PagedAsyncEnumerable<PreviewFeatureList, PreviewFeature> response = previewFeaturesClient.ListAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PreviewFeature item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((PreviewFeatureList page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (PreviewFeature 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<PreviewFeature> 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 (PreviewFeature 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;
ListAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<PreviewFeatureList, PreviewFeature> ListAsync(string project, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Returns the details of the given PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerablePreviewFeatureListPreviewFeature |
A pageable asynchronous sequence of PreviewFeature resources. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
PagedAsyncEnumerable<PreviewFeatureList, PreviewFeature> response = previewFeaturesClient.ListAsync(project);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((PreviewFeature item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((PreviewFeatureList page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (PreviewFeature 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<PreviewFeature> 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 (PreviewFeature 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;
PollOnceUpdate(string, CallSettings)
public virtual Operation<Operation, Operation> PollOnceUpdate(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of Update
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationOperationOperation |
The result of polling the operation. |
PollOnceUpdateAsync(string, CallSettings)
public virtual Task<Operation<Operation, Operation>> PollOnceUpdateAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of Update
.
Parameters | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationOperationOperation |
A task representing the result of polling the operation. |
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task |
A task representing the asynchronous shutdown operation. |
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.
Update(UpdatePreviewFeatureRequest, CallSettings)
public virtual Operation<Operation, Operation> Update(UpdatePreviewFeatureRequest request, CallSettings callSettings = null)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
UpdatePreviewFeatureRequest 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 |
OperationOperationOperation |
The RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
UpdatePreviewFeatureRequest request = new UpdatePreviewFeatureRequest
{
PreviewFeatureResource = new PreviewFeature(),
RequestId = "",
Project = "",
PreviewFeature = "",
};
// Make the request
lro::Operation<Operation, Operation> response = previewFeaturesClient.Update(request);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = previewFeaturesClient.PollOnceUpdate(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
Update(string, string, PreviewFeature, CallSettings)
public virtual Operation<Operation, Operation> Update(string project, string previewFeature, PreviewFeature previewFeatureResource, CallSettings callSettings = null)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
previewFeatureResource |
PreviewFeature The body resource for this request |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationOperationOperation |
The RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = PreviewFeaturesClient.Create();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
PreviewFeature previewFeatureResource = new PreviewFeature();
// Make the request
lro::Operation<Operation, Operation> response = previewFeaturesClient.Update(project, previewFeature, previewFeatureResource);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = previewFeaturesClient.PollOnceUpdate(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
UpdateAsync(UpdatePreviewFeatureRequest, CallSettings)
public virtual Task<Operation<Operation, Operation>> UpdateAsync(UpdatePreviewFeatureRequest request, CallSettings callSettings = null)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
UpdatePreviewFeatureRequest 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 |
TaskOperationOperationOperation |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
UpdatePreviewFeatureRequest request = new UpdatePreviewFeatureRequest
{
PreviewFeatureResource = new PreviewFeature(),
RequestId = "",
Project = "",
PreviewFeature = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await previewFeaturesClient.UpdateAsync(request);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await previewFeaturesClient.PollOnceUpdateAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
UpdateAsync(UpdatePreviewFeatureRequest, CancellationToken)
public virtual Task<Operation<Operation, Operation>> UpdateAsync(UpdatePreviewFeatureRequest request, CancellationToken cancellationToken)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
request |
UpdatePreviewFeatureRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationOperationOperation |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
UpdatePreviewFeatureRequest request = new UpdatePreviewFeatureRequest
{
PreviewFeatureResource = new PreviewFeature(),
RequestId = "",
Project = "",
PreviewFeature = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await previewFeaturesClient.UpdateAsync(request);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await previewFeaturesClient.PollOnceUpdateAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
UpdateAsync(string, string, PreviewFeature, CallSettings)
public virtual Task<Operation<Operation, Operation>> UpdateAsync(string project, string previewFeature, PreviewFeature previewFeatureResource, CallSettings callSettings = null)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
previewFeatureResource |
PreviewFeature The body resource for this request |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationOperationOperation |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
PreviewFeature previewFeatureResource = new PreviewFeature();
// Make the request
lro::Operation<Operation, Operation> response = await previewFeaturesClient.UpdateAsync(project, previewFeature, previewFeatureResource);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await previewFeaturesClient.PollOnceUpdateAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}
UpdateAsync(string, string, PreviewFeature, CancellationToken)
public virtual Task<Operation<Operation, Operation>> UpdateAsync(string project, string previewFeature, PreviewFeature previewFeatureResource, CancellationToken cancellationToken)
Patches the given PreviewFeature. This method is used to enable or disable a PreviewFeature.
Parameters | |
---|---|
Name | Description |
project |
string Project ID for this request. |
previewFeature |
string Name of the PreviewFeature for this request. |
previewFeatureResource |
PreviewFeature The body resource for this request |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationOperationOperation |
A Task containing the RPC response. |
// Create client
PreviewFeaturesClient previewFeaturesClient = await PreviewFeaturesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string previewFeature = "";
PreviewFeature previewFeatureResource = new PreviewFeature();
// Make the request
lro::Operation<Operation, Operation> response = await previewFeaturesClient.UpdateAsync(project, previewFeature, previewFeatureResource);
// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await previewFeaturesClient.PollOnceUpdateAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Operation retrievedResult = retrievedResponse.Result;
}