public abstract class HubServiceClient
HubService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.NetworkConnectivity.V1Alpha1Assembly
Google.Cloud.NetworkConnectivity.V1Alpha1.dll
Remarks
Network Connectivity Center is a hub-and-spoke abstraction for network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model.
Properties
CreateHubOperationsClient
public virtual OperationsClient CreateHubOperationsClient { get; }
The long-running operations client for CreateHub
.
Type | Description |
OperationsClient |
CreateSpokeOperationsClient
public virtual OperationsClient CreateSpokeOperationsClient { get; }
The long-running operations client for CreateSpoke
.
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the HubService service, which is a host of "networkconnectivity.googleapis.com" and a port of 443.
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default HubService scopes.
Type | Description |
IReadOnlyList<String> |
The default HubService scopes are:
DeleteHubOperationsClient
public virtual OperationsClient DeleteHubOperationsClient { get; }
The long-running operations client for DeleteHub
.
Type | Description |
OperationsClient |
DeleteSpokeOperationsClient
public virtual OperationsClient DeleteSpokeOperationsClient { get; }
The long-running operations client for DeleteSpoke
.
Type | Description |
OperationsClient |
GrpcClient
public virtual HubService.HubServiceClient GrpcClient { get; }
The underlying gRPC HubService client
Type | Description |
HubService.HubServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Type | Description |
ServiceMetadata |
UpdateHubOperationsClient
public virtual OperationsClient UpdateHubOperationsClient { get; }
The long-running operations client for UpdateHub
.
Type | Description |
OperationsClient |
UpdateSpokeOperationsClient
public virtual OperationsClient UpdateSpokeOperationsClient { get; }
The long-running operations client for UpdateSpoke
.
Type | Description |
OperationsClient |
Methods
Create()
public static HubServiceClient Create()
Synchronously creates a HubServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use HubServiceClientBuilder.
Type | Description |
HubServiceClient | The created HubServiceClient. |
CreateAsync(CancellationToken)
public static Task<HubServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a HubServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use HubServiceClientBuilder.
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Type | Description |
Task<HubServiceClient> | The task representing the created HubServiceClient. |
CreateHub(LocationName, Hub, String, CallSettings)
public virtual Operation<Hub, OperationMetadata> CreateHub(LocationName parent, Hub hub, string hubId, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
parent | LocationName Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Hub, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = hubServiceClient.CreateHub(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHub(CreateHubRequest, CallSettings)
public virtual Operation<Hub, OperationMetadata> CreateHub(CreateHubRequest request, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
request | CreateHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Hub, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
CreateHubRequest request = new CreateHubRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
HubId = "",
Hub = new Hub(),
RequestId = "",
};
// Make the request
Operation<Hub, OperationMetadata> response = hubServiceClient.CreateHub(request);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHub(String, Hub, String, CallSettings)
public virtual Operation<Hub, OperationMetadata> CreateHub(string parent, Hub hub, string hubId, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
parent | String Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Hub, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = hubServiceClient.CreateHub(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(LocationName, Hub, String, CallSettings)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(LocationName parent, Hub hub, string hubId, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
parent | LocationName Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(LocationName, Hub, String, CancellationToken)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(LocationName parent, Hub hub, string hubId, CancellationToken cancellationToken)
Creates a new Hub in a given project and location.
Name | Description |
parent | LocationName Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(CreateHubRequest, CallSettings)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(CreateHubRequest request, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
request | CreateHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
CreateHubRequest request = new CreateHubRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
HubId = "",
Hub = new Hub(),
RequestId = "",
};
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(request);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(CreateHubRequest, CancellationToken)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(CreateHubRequest request, CancellationToken cancellationToken)
Creates a new Hub in a given project and location.
Name | Description |
request | CreateHubRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
CreateHubRequest request = new CreateHubRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
HubId = "",
Hub = new Hub(),
RequestId = "",
};
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(request);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(String, Hub, String, CallSettings)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(string parent, Hub hub, string hubId, CallSettings callSettings = null)
Creates a new Hub in a given project and location.
Name | Description |
parent | String Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateHubAsync(String, Hub, String, CancellationToken)
public virtual Task<Operation<Hub, OperationMetadata>> CreateHubAsync(string parent, Hub hub, string hubId, CancellationToken cancellationToken)
Creates a new Hub in a given project and location.
Name | Description |
parent | String Required. The parent resource's name of the Hub. |
hub | Hub Required. Initial values for a new Hub. |
hubId | String Optional. Unique id for the Hub to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Hub, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Hub hub = new Hub();
string hubId = "";
// Make the request
Operation<Hub, OperationMetadata> response = await hubServiceClient.CreateHubAsync(parent, hub, hubId);
// Poll until the returned long-running operation is complete
Operation<Hub, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Hub 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
Operation<Hub, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Hub retrievedResult = retrievedResponse.Result;
}
CreateSpoke(LocationName, Spoke, String, CallSettings)
public virtual Operation<Spoke, OperationMetadata> CreateSpoke(LocationName parent, Spoke spoke, string spokeId, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
parent | LocationName Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Spoke, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = hubServiceClient.CreateSpoke(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpoke(CreateSpokeRequest, CallSettings)
public virtual Operation<Spoke, OperationMetadata> CreateSpoke(CreateSpokeRequest request, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
request | CreateSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Spoke, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
CreateSpokeRequest request = new CreateSpokeRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SpokeId = "",
Spoke = new Spoke(),
RequestId = "",
};
// Make the request
Operation<Spoke, OperationMetadata> response = hubServiceClient.CreateSpoke(request);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpoke(String, Spoke, String, CallSettings)
public virtual Operation<Spoke, OperationMetadata> CreateSpoke(string parent, Spoke spoke, string spokeId, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
parent | String Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Spoke, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = hubServiceClient.CreateSpoke(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceCreateSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(LocationName, Spoke, String, CallSettings)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(LocationName parent, Spoke spoke, string spokeId, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
parent | LocationName Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(LocationName, Spoke, String, CancellationToken)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(LocationName parent, Spoke spoke, string spokeId, CancellationToken cancellationToken)
Creates a new Spoke in a given project and location.
Name | Description |
parent | LocationName Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(CreateSpokeRequest, CallSettings)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(CreateSpokeRequest request, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
request | CreateSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSpokeRequest request = new CreateSpokeRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SpokeId = "",
Spoke = new Spoke(),
RequestId = "",
};
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(request);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(CreateSpokeRequest, CancellationToken)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(CreateSpokeRequest request, CancellationToken cancellationToken)
Creates a new Spoke in a given project and location.
Name | Description |
request | CreateSpokeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSpokeRequest request = new CreateSpokeRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SpokeId = "",
Spoke = new Spoke(),
RequestId = "",
};
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(request);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(String, Spoke, String, CallSettings)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(string parent, Spoke spoke, string spokeId, CallSettings callSettings = null)
Creates a new Spoke in a given project and location.
Name | Description |
parent | String Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
CreateSpokeAsync(String, Spoke, String, CancellationToken)
public virtual Task<Operation<Spoke, OperationMetadata>> CreateSpokeAsync(string parent, Spoke spoke, string spokeId, CancellationToken cancellationToken)
Creates a new Spoke in a given project and location.
Name | Description |
parent | String Required. The parent's resource name of the Spoke. |
spoke | Spoke Required. Initial values for a new Hub. |
spokeId | String Optional. Unique id for the Spoke to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Spoke, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Spoke spoke = new Spoke();
string spokeId = "";
// Make the request
Operation<Spoke, OperationMetadata> response = await hubServiceClient.CreateSpokeAsync(parent, spoke, spokeId);
// Poll until the returned long-running operation is complete
Operation<Spoke, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Spoke 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
Operation<Spoke, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceCreateSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Spoke retrievedResult = retrievedResponse.Result;
}
DeleteHub(DeleteHubRequest, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteHub(DeleteHubRequest request, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
request | DeleteHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
DeleteHubRequest request = new DeleteHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteHub(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHub(HubName, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteHub(HubName name, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
name | HubName Required. The name of the Hub to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteHub(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHub(String, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteHub(string name, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
name | String Required. The name of the Hub to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteHub(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteHub(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(DeleteHubRequest, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(DeleteHubRequest request, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
request | DeleteHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteHubRequest request = new DeleteHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(DeleteHubRequest, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(DeleteHubRequest request, CancellationToken cancellationToken)
Deletes a single Hub.
Name | Description |
request | DeleteHubRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteHubRequest request = new DeleteHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(HubName, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(HubName name, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
name | HubName Required. The name of the Hub to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(HubName, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(HubName name, CancellationToken cancellationToken)
Deletes a single Hub.
Name | Description |
name | HubName Required. The name of the Hub to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(String, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(string name, CallSettings callSettings = null)
Deletes a single Hub.
Name | Description |
name | String Required. The name of the Hub to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteHubAsync(String, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteHubAsync(string name, CancellationToken cancellationToken)
Deletes a single Hub.
Name | Description |
name | String Required. The name of the Hub to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteHubAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteHubAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpoke(DeleteSpokeRequest, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteSpoke(DeleteSpokeRequest request, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
request | DeleteSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
DeleteSpokeRequest request = new DeleteSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteSpoke(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpoke(SpokeName, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteSpoke(SpokeName name, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
name | SpokeName Required. The name of the Spoke to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteSpoke(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpoke(String, CallSettings)
public virtual Operation<Empty, OperationMetadata> DeleteSpoke(string name, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
name | String Required. The name of the Spoke to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Operation<Empty, OperationMetadata> | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Operation<Empty, OperationMetadata> response = hubServiceClient.DeleteSpoke(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = hubServiceClient.PollOnceDeleteSpoke(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(DeleteSpokeRequest, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(DeleteSpokeRequest request, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
request | DeleteSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSpokeRequest request = new DeleteSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(DeleteSpokeRequest, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(DeleteSpokeRequest request, CancellationToken cancellationToken)
Deletes a single Spoke.
Name | Description |
request | DeleteSpokeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSpokeRequest request = new DeleteSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
RequestId = "",
};
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(SpokeName, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(SpokeName name, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
name | SpokeName Required. The name of the Spoke to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(SpokeName, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(SpokeName name, CancellationToken cancellationToken)
Deletes a single Spoke.
Name | Description |
name | SpokeName Required. The name of the Spoke to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(String, CallSettings)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(string name, CallSettings callSettings = null)
Deletes a single Spoke.
Name | Description |
name | String Required. The name of the Spoke to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteSpokeAsync(String, CancellationToken)
public virtual Task<Operation<Empty, OperationMetadata>> DeleteSpokeAsync(string name, CancellationToken cancellationToken)
Deletes a single Spoke.
Name | Description |
name | String Required. The name of the Spoke to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Operation<Empty, OperationMetadata>> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Operation<Empty, OperationMetadata> response = await hubServiceClient.DeleteSpokeAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty 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
Operation<Empty, OperationMetadata> retrievedResponse = await hubServiceClient.PollOnceDeleteSpokeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
GetHub(GetHubRequest, CallSettings)
public virtual Hub GetHub(GetHubRequest request, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
request | GetHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Hub | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
GetHubRequest request = new GetHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
};
// Make the request
Hub response = hubServiceClient.GetHub(request);
GetHub(HubName, CallSettings)
public virtual Hub GetHub(HubName name, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
name | HubName Required. Name of the Hub resource to get. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Hub | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Hub response = hubServiceClient.GetHub(name);
GetHub(String, CallSettings)
public virtual Hub GetHub(string name, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
name | String Required. Name of the Hub resource to get. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Hub | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Hub response = hubServiceClient.GetHub(name);
GetHubAsync(GetHubRequest, CallSettings)
public virtual Task<Hub> GetHubAsync(GetHubRequest request, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
request | GetHubRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
GetHubRequest request = new GetHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
};
// Make the request
Hub response = await hubServiceClient.GetHubAsync(request);
GetHubAsync(GetHubRequest, CancellationToken)
public virtual Task<Hub> GetHubAsync(GetHubRequest request, CancellationToken cancellationToken)
Gets details of a single Hub.
Name | Description |
request | GetHubRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
GetHubRequest request = new GetHubRequest
{
HubName = HubName.FromProjectHub("[PROJECT]", "[HUB]"),
};
// Make the request
Hub response = await hubServiceClient.GetHubAsync(request);
GetHubAsync(HubName, CallSettings)
public virtual Task<Hub> GetHubAsync(HubName name, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
name | HubName Required. Name of the Hub resource to get. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Hub response = await hubServiceClient.GetHubAsync(name);
GetHubAsync(HubName, CancellationToken)
public virtual Task<Hub> GetHubAsync(HubName name, CancellationToken cancellationToken)
Gets details of a single Hub.
Name | Description |
name | HubName Required. Name of the Hub resource to get. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
HubName name = HubName.FromProjectHub("[PROJECT]", "[HUB]");
// Make the request
Hub response = await hubServiceClient.GetHubAsync(name);
GetHubAsync(String, CallSettings)
public virtual Task<Hub> GetHubAsync(string name, CallSettings callSettings = null)
Gets details of a single Hub.
Name | Description |
name | String Required. Name of the Hub resource to get. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Hub response = await hubServiceClient.GetHubAsync(name);
GetHubAsync(String, CancellationToken)
public virtual Task<Hub> GetHubAsync(string name, CancellationToken cancellationToken)
Gets details of a single Hub.
Name | Description |
name | String Required. Name of the Hub resource to get. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Hub> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/global/hubs/[HUB]";
// Make the request
Hub response = await hubServiceClient.GetHubAsync(name);
GetSpoke(GetSpokeRequest, CallSettings)
public virtual Spoke GetSpoke(GetSpokeRequest request, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
request | GetSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Spoke | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
GetSpokeRequest request = new GetSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
};
// Make the request
Spoke response = hubServiceClient.GetSpoke(request);
GetSpoke(SpokeName, CallSettings)
public virtual Spoke GetSpoke(SpokeName name, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
name | SpokeName Required. The name of Spoke resource. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Spoke | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Spoke response = hubServiceClient.GetSpoke(name);
GetSpoke(String, CallSettings)
public virtual Spoke GetSpoke(string name, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
name | String Required. The name of Spoke resource. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Spoke | The RPC response. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Spoke response = hubServiceClient.GetSpoke(name);
GetSpokeAsync(GetSpokeRequest, CallSettings)
public virtual Task<Spoke> GetSpokeAsync(GetSpokeRequest request, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
request | GetSpokeRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpokeRequest request = new GetSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
};
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(request);
GetSpokeAsync(GetSpokeRequest, CancellationToken)
public virtual Task<Spoke> GetSpokeAsync(GetSpokeRequest request, CancellationToken cancellationToken)
Gets details of a single Spoke.
Name | Description |
request | GetSpokeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
GetSpokeRequest request = new GetSpokeRequest
{
SpokeName = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]"),
};
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(request);
GetSpokeAsync(SpokeName, CallSettings)
public virtual Task<Spoke> GetSpokeAsync(SpokeName name, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
name | SpokeName Required. The name of Spoke resource. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(name);
GetSpokeAsync(SpokeName, CancellationToken)
public virtual Task<Spoke> GetSpokeAsync(SpokeName name, CancellationToken cancellationToken)
Gets details of a single Spoke.
Name | Description |
name | SpokeName Required. The name of Spoke resource. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
SpokeName name = SpokeName.FromProjectLocationSpoke("[PROJECT]", "[LOCATION]", "[SPOKE]");
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(name);
GetSpokeAsync(String, CallSettings)
public virtual Task<Spoke> GetSpokeAsync(string name, CallSettings callSettings = null)
Gets details of a single Spoke.
Name | Description |
name | String Required. The name of Spoke resource. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(name);
GetSpokeAsync(String, CancellationToken)
public virtual Task<Spoke> GetSpokeAsync(string name, CancellationToken cancellationToken)
Gets details of a single Spoke.
Name | Description |
name | String Required. The name of Spoke resource. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Spoke> | A Task containing the RPC response. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/spokes/[SPOKE]";
// Make the request
Spoke response = await hubServiceClient.GetSpokeAsync(name);
ListHubs(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListHubsResponse, Hub> ListHubs(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
parent | LocationName Required. The parent resource's name. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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. |
Type | Description |
PagedEnumerable<ListHubsResponse, Hub> | A pageable sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListHubsResponse, Hub> response = hubServiceClient.ListHubs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Hub 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 (ListHubsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Hub 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<Hub> 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 (Hub 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;
ListHubs(ListHubsRequest, CallSettings)
public virtual PagedEnumerable<ListHubsResponse, Hub> ListHubs(ListHubsRequest request, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
request | ListHubsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedEnumerable<ListHubsResponse, Hub> | A pageable sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
ListHubsRequest request = new ListHubsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable<ListHubsResponse, Hub> response = hubServiceClient.ListHubs(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Hub 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 (ListHubsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Hub 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<Hub> 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 (Hub 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;
ListHubs(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListHubsResponse, Hub> ListHubs(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
parent | String Required. The parent resource's name. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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. |
Type | Description |
PagedEnumerable<ListHubsResponse, Hub> | A pageable sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = HubServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListHubsResponse, Hub> response = hubServiceClient.ListHubs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Hub 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 (ListHubsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Hub 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<Hub> 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 (Hub 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;
ListHubsAsync(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListHubsResponse, Hub> ListHubsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
parent | LocationName Required. The parent resource's name. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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. |
Type | Description |
PagedAsyncEnumerable<ListHubsResponse, Hub> | A pageable asynchronous sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListHubsResponse, Hub> response = hubServiceClient.ListHubsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Hub 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((ListHubsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Hub 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<Hub> 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 (Hub 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;
ListHubsAsync(ListHubsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListHubsResponse, Hub> ListHubsAsync(ListHubsRequest request, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
request | ListHubsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedAsyncEnumerable<ListHubsResponse, Hub> | A pageable asynchronous sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
ListHubsRequest request = new ListHubsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListHubsResponse, Hub> response = hubServiceClient.ListHubsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Hub 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((ListHubsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Hub 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<Hub> 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 (Hub 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;
ListHubsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListHubsResponse, Hub> ListHubsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Hubs in a given project and location.
Name | Description |
parent | String Required. The parent resource's name. |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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. |
Type | Description |
PagedAsyncEnumerable<ListHubsResponse, Hub> | A pageable asynchronous sequence of Hub resources. |
// Create client
HubServiceClient hubServiceClient = await HubServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEn