Class DataSubscriptionServiceClient
DataSubscriptionService client wrapper, for convenient use.
Namespace: Google.DevicesAndServices.Health.V4
Assembly: Google.DevicesAndServices.Health.V4.dll
Syntax
public abstract class DataSubscriptionServiceClient
Remarks
Data Subscription Service that allows clients (e.g., Fitbit 3P applications, internal Fitbit Services) to manage their subscriber endpoints. This service provides CRUD APIs for subscribers, and also offers functionalities for subscriber verification and statistics.
Properties
CreateSubscriberOperationsClient
The long-running operations client for CreateSubscriber.
Declaration
public virtual OperationsClient CreateSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
DefaultEndpoint
The default endpoint for the DataSubscriptionService service, which is a host of "health.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default DataSubscriptionService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default DataSubscriptionService scopes are:
- https://www.googleapis.com/auth/cloud-platform
DeleteSubscriberOperationsClient
The long-running operations client for DeleteSubscriber.
Declaration
public virtual OperationsClient DeleteSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
GrpcClient
The underlying gRPC DataSubscriptionService client
Declaration
public virtual DataSubscriptionService.DataSubscriptionServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| DataSubscriptionService.DataSubscriptionServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
UpdateSubscriberOperationsClient
The long-running operations client for UpdateSubscriber.
Declaration
public virtual OperationsClient UpdateSubscriberOperationsClient { get; }
Property Value
| Type | Description |
|---|---|
| OperationsClient |
Methods
Create()
Synchronously creates a DataSubscriptionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DataSubscriptionServiceClientBuilder.
Declaration
public static DataSubscriptionServiceClient Create()
Returns
| Type | Description |
|---|---|
| DataSubscriptionServiceClient | The created DataSubscriptionServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a DataSubscriptionServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DataSubscriptionServiceClientBuilder.
Declaration
public static Task<DataSubscriptionServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<DataSubscriptionServiceClient> | The task representing the created DataSubscriptionServiceClient. |
CreateSubscriber(ProjectName, CreateSubscriberPayload, string, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Operation<Subscriber, CreateSubscriberMetadata> CreateSubscriber(ProjectName parent, CreateSubscriberPayload subscriber, string subscriberId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectName | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, CreateSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = dataSubscriptionServiceClient.CreateSubscriber(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceCreateSubscriber(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriber(CreateSubscriberRequest, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Operation<Subscriber, CreateSubscriberMetadata> CreateSubscriber(CreateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriberRequest | request | 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 |
|---|---|
| Operation<Subscriber, CreateSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
CreateSubscriberRequest request = new CreateSubscriberRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Subscriber = new CreateSubscriberPayload(),
SubscriberId = "",
};
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = dataSubscriptionServiceClient.CreateSubscriber(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceCreateSubscriber(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriber(string, CreateSubscriberPayload, string, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Operation<Subscriber, CreateSubscriberMetadata> CreateSubscriber(string parent, CreateSubscriberPayload subscriber, string subscriberId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, CreateSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = dataSubscriptionServiceClient.CreateSubscriber(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceCreateSubscriber(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(ProjectName, CreateSubscriberPayload, string, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(ProjectName parent, CreateSubscriberPayload subscriber, string subscriberId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectName | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(ProjectName, CreateSubscriberPayload, string, CancellationToken)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(ProjectName parent, CreateSubscriberPayload subscriber, string subscriberId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectName | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(CreateSubscriberRequest, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(CreateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriberRequest | request | 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 |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubscriberRequest request = new CreateSubscriberRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Subscriber = new CreateSubscriberPayload(),
SubscriberId = "",
};
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(CreateSubscriberRequest, CancellationToken)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(CreateSubscriberRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubscriberRequest request = new CreateSubscriberRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Subscriber = new CreateSubscriberPayload(),
SubscriberId = "",
};
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(string, CreateSubscriberPayload, string, CallSettings)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(string parent, CreateSubscriberPayload subscriber, string subscriberId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscriberAsync(string, CreateSubscriberPayload, string, CancellationToken)
Registers a new subscriber endpoint to receive notifications. A subscriber represents an application or service that wishes to receive data change notifications for users who have granted consent.
Endpoint Verification:
For a subscriber to be successfully created, the provided endpoint_uri
must be a valid HTTPS endpoint and must pass an automated verification
check. The backend will send two HTTP POST requests to the endpoint_uri:
- Verification with Authorization:
- Headers: Includes
Content-Type: application/jsonandAuthorization(with the exact value fromCreateSubscriberPayload.endpoint_authorization.secret). - Body:
{"type": "verification"} - Expected Response: HTTP
201 Created.
- Verification without Authorization:
- Headers: Includes
Content-Type: application/json. TheAuthorizationheader is OMITTED. - Body:
{"type": "verification"} - Expected Response: HTTP
401 Unauthorizedor403 Forbidden.
Both tests must pass for the subscriber creation to succeed. If
verification fails, the operation will not be completed and an error will
be returned. This process ensures the endpoint is reachable and correctly
validates the Authorization header.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> CreateSubscriberAsync(string parent, CreateSubscriberPayload subscriber, string subscriberId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent resource where this subscriber will be created. Format: projects/{project} Example: projects/my-project-123 |
| CreateSubscriberPayload | subscriber | Required. The subscriber to create. |
| string | subscriberId | Optional. The ID to use for the subscriber, which will become the final component of the subscriber's resource name. This value should be 4-36 characters, and valid characters are /a-z/. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
CreateSubscriberPayload subscriber = new CreateSubscriberPayload();
string subscriberId = "";
// Make the request
Operation<Subscriber, CreateSubscriberMetadata> response = await dataSubscriptionServiceClient.CreateSubscriberAsync(parent, subscriber, subscriberId);
// Poll until the returned long-running operation is complete
Operation<Subscriber, CreateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, CreateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceCreateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
CreateSubscription(CreateSubscriptionRequest, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Subscription CreateSubscription(CreateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriptionRequest | request | 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 |
|---|---|
| Subscription | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
CreateSubscriptionRequest request = new CreateSubscriptionRequest
{
ParentAsSubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
SubscriptionId = "",
Subscription = new CreateSubscriptionPayload(),
};
// Make the request
Subscription response = dataSubscriptionServiceClient.CreateSubscription(request);
CreateSubscription(SubscriberName, CreateSubscriptionPayload, string, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Subscription CreateSubscription(SubscriberName parent, CreateSubscriptionPayload subscription, string subscriptionId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Subscription | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
SubscriberName parent = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = dataSubscriptionServiceClient.CreateSubscription(parent, subscription, subscriptionId);
CreateSubscription(string, CreateSubscriptionPayload, string, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Subscription CreateSubscription(string parent, CreateSubscriptionPayload subscription, string subscriptionId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Subscription | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = dataSubscriptionServiceClient.CreateSubscription(parent, subscription, subscriptionId);
CreateSubscriptionAsync(CreateSubscriptionRequest, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(CreateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriptionRequest | request | 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 |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubscriptionRequest request = new CreateSubscriptionRequest
{
ParentAsSubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
SubscriptionId = "",
Subscription = new CreateSubscriptionPayload(),
};
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(request);
CreateSubscriptionAsync(CreateSubscriptionRequest, CancellationToken)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(CreateSubscriptionRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSubscriptionRequest request = new CreateSubscriptionRequest
{
ParentAsSubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
SubscriptionId = "",
Subscription = new CreateSubscriptionPayload(),
};
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(request);
CreateSubscriptionAsync(SubscriberName, CreateSubscriptionPayload, string, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(SubscriberName parent, CreateSubscriptionPayload subscription, string subscriptionId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriberName parent = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(parent, subscription, subscriptionId);
CreateSubscriptionAsync(SubscriberName, CreateSubscriptionPayload, string, CancellationToken)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(SubscriberName parent, CreateSubscriptionPayload subscription, string subscriptionId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriberName parent = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(parent, subscription, subscriptionId);
CreateSubscriptionAsync(string, CreateSubscriptionPayload, string, CallSettings)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(string parent, CreateSubscriptionPayload subscription, string subscriptionId, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(parent, subscription, subscriptionId);
CreateSubscriptionAsync(string, CreateSubscriptionPayload, string, CancellationToken)
Creates a subscription for a specific user to a specific subscriber.
This method requires the subscriber to have a SubscriptionCreatePolicy
set to MANUAL for the given data types.
Declaration
public virtual Task<Subscription> CreateSubscriptionAsync(string parent, CreateSubscriptionPayload subscription, string subscriptionId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| CreateSubscriptionPayload | subscription | Required. The subscription to create. |
| string | subscriptionId | Optional. The {subscription_id} is user-settable (4-36 chars, matching /a-z/) or system-generated otherwise. If provided, the ID must be unique within the parent subscriber. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
CreateSubscriptionPayload subscription = new CreateSubscriptionPayload();
string subscriptionId = "";
// Make the request
Subscription response = await dataSubscriptionServiceClient.CreateSubscriptionAsync(parent, subscription, subscriptionId);
DeleteSubscriber(DeleteSubscriberRequest, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Operation<Empty, DeleteSubscriberMetadata> DeleteSubscriber(DeleteSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriberRequest | request | 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 |
|---|---|
| Operation<Empty, DeleteSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
DeleteSubscriberRequest request = new DeleteSubscriberRequest
{
SubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
Force = false,
};
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = dataSubscriptionServiceClient.DeleteSubscriber(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceDeleteSubscriber(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;
}
DeleteSubscriber(SubscriberName, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Operation<Empty, DeleteSubscriberMetadata> DeleteSubscriber(SubscriberName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Empty, DeleteSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
SubscriberName name = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = dataSubscriptionServiceClient.DeleteSubscriber(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceDeleteSubscriber(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;
}
DeleteSubscriber(string, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Operation<Empty, DeleteSubscriberMetadata> DeleteSubscriber(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Empty, DeleteSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = dataSubscriptionServiceClient.DeleteSubscriber(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceDeleteSubscriber(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;
}
DeleteSubscriberAsync(DeleteSubscriberRequest, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(DeleteSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriberRequest | request | 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 |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSubscriberRequest request = new DeleteSubscriberRequest
{
SubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
Force = false,
};
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscriberAsync(DeleteSubscriberRequest, CancellationToken)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(DeleteSubscriberRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSubscriberRequest request = new DeleteSubscriberRequest
{
SubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
Force = false,
};
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscriberAsync(SubscriberName, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(SubscriberName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriberName name = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscriberAsync(SubscriberName, CancellationToken)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(SubscriberName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriberName name = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscriberAsync(string, CallSettings)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscriberAsync(string, CancellationToken)
Deletes a subscriber registration. This will stop all notifications to the subscriber's endpoint.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> DeleteSubscriberAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the subscriber to delete. Format: projects/{project}/subscribers/{subscriber} Example: projects/my-project/subscribers/my-subscriber-123 The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) or system-generated if not provided during creation. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
// Make the request
Operation<Empty, DeleteSubscriberMetadata> response = await dataSubscriptionServiceClient.DeleteSubscriberAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteSubscriberMetadata> 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, DeleteSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceDeleteSubscriberAsync(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;
}
DeleteSubscription(DeleteSubscriptionRequest, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual void DeleteSubscription(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
DeleteSubscriptionRequest request = new DeleteSubscriptionRequest
{
SubscriptionName = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]"),
};
// Make the request
dataSubscriptionServiceClient.DeleteSubscription(request);
DeleteSubscription(SubscriptionName, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual void DeleteSubscription(SubscriptionName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriptionName | name | Required. The resource name of the subscription to delete.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
SubscriptionName name = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]");
// Make the request
dataSubscriptionServiceClient.DeleteSubscription(name);
DeleteSubscription(string, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual void DeleteSubscription(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the subscription to delete.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]/subscriptions/[SUBSCRIPTION]";
// Make the request
dataSubscriptionServiceClient.DeleteSubscription(name);
DeleteSubscriptionAsync(DeleteSubscriptionRequest, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriptionRequest | request | 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 |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSubscriptionRequest request = new DeleteSubscriptionRequest
{
SubscriptionName = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]"),
};
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(request);
DeleteSubscriptionAsync(DeleteSubscriptionRequest, CancellationToken)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSubscriptionRequest request = new DeleteSubscriptionRequest
{
SubscriptionName = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]"),
};
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(request);
DeleteSubscriptionAsync(SubscriptionName, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(SubscriptionName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriptionName | name | Required. The resource name of the subscription to delete.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriptionName name = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]");
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(name);
DeleteSubscriptionAsync(SubscriptionName, CancellationToken)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(SubscriptionName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriptionName | name | Required. The resource name of the subscription to delete.
Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriptionName name = SubscriptionName.FromProjectSubscriberSubscription("[PROJECT]", "[SUBSCRIBER]", "[SUBSCRIPTION]");
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(name);
DeleteSubscriptionAsync(string, CallSettings)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the subscription to delete.
Format:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]/subscriptions/[SUBSCRIPTION]";
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(name);
DeleteSubscriptionAsync(string, CancellationToken)
Deletes a specific user subscription, stopping notifications for this user to this subscriber.
Declaration
public virtual Task DeleteSubscriptionAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The resource name of the subscription to delete.
Format:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscribers/[SUBSCRIBER]/subscriptions/[SUBSCRIPTION]";
// Make the request
await dataSubscriptionServiceClient.DeleteSubscriptionAsync(name);
ListSubscribers(ProjectName, string, int?, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedEnumerable<ListSubscribersResponse, Subscriber> ListSubscribers(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectName | parent | Required. The parent, which owns this collection of subscribers. Format: projects/{project} |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedEnumerable<ListSubscribersResponse, Subscriber> | A pageable sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscriber 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 (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscribers(ListSubscribersRequest, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedEnumerable<ListSubscribersResponse, Subscriber> ListSubscribers(ListSubscribersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscribersRequest | request | 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 |
|---|---|
| PagedEnumerable<ListSubscribersResponse, Subscriber> | A pageable sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
ListSubscribersRequest request = new ListSubscribersRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribers(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscriber 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 (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscribers(string, string, int?, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedEnumerable<ListSubscribersResponse, Subscriber> ListSubscribers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of subscribers. Format: projects/{project} |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedEnumerable<ListSubscribersResponse, Subscriber> | A pageable sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscriber 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 (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscribersAsync(ProjectName, string, int?, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> ListSubscribersAsync(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectName | parent | Required. The parent, which owns this collection of subscribers. Format: projects/{project} |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> | A pageable asynchronous sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscriber item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscribersAsync(ListSubscribersRequest, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> ListSubscribersAsync(ListSubscribersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscribersRequest | request | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> | A pageable asynchronous sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
ListSubscribersRequest request = new ListSubscribersRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribersAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscriber item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscribersAsync(string, string, int?, CallSettings)
Lists all subscribers registered within the owned Google Cloud Project.
Declaration
public virtual PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> ListSubscribersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of subscribers. Format: projects/{project} |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> | A pageable asynchronous sequence of Subscriber resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListSubscribersResponse, Subscriber> response = dataSubscriptionServiceClient.ListSubscribersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscriber item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscribersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscriber 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<Subscriber> 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 (Subscriber 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;
ListSubscriptions(ListSubscriptionsRequest, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(ListSubscriptionsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscriptionsRequest | request | 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 |
|---|---|
| PagedEnumerable<ListSubscriptionsResponse, Subscription> | A pageable sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
ListSubscriptionsRequest request = new ListSubscriptionsRequest
{
ParentAsSubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptions(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscription 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 (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
ListSubscriptions(SubscriberName, string, int?, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(SubscriberName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedEnumerable<ListSubscriptionsResponse, Subscription> | A pageable sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
SubscriberName parent = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
// Make the request
PagedEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscription 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 (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
ListSubscriptions(string, string, int?, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedEnumerable<ListSubscriptionsResponse, Subscription> | A pageable sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
// Make the request
PagedEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Subscription 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 (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
ListSubscriptionsAsync(ListSubscriptionsRequest, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(ListSubscriptionsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubscriptionsRequest | request | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> | A pageable asynchronous sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
ListSubscriptionsRequest request = new ListSubscriptionsRequest
{
ParentAsSubscriberName = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptionsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscription item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
ListSubscriptionsAsync(SubscriberName, string, int?, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(SubscriberName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriberName | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> | A pageable asynchronous sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
SubscriberName parent = SubscriberName.FromProjectSubscriber("[PROJECT]", "[SUBSCRIBER]");
// Make the request
PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscription item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
ListSubscriptionsAsync(string, string, int?, CallSettings)
Lists all active subscriptions for a given subscriber. This can be filtered, for example, by user or data type.
Declaration
public virtual PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent subscriber. Format: projects/{project}/subscribers/{subscriber} The {subscriber} ID is user-settable (4-36 characters, matching /a-z/) if provided during creation, or system-generated otherwise. |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | 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 |
|---|---|
| PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> | A pageable asynchronous sequence of Subscription resources. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/subscribers/[SUBSCRIBER]";
// Make the request
PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> response = dataSubscriptionServiceClient.ListSubscriptionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (Subscription item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListSubscriptionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Subscription 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<Subscription> 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 (Subscription 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;
PollOnceCreateSubscriber(string, CallSettings)
Poll an operation once, using an operationName from a previous invocation of CreateSubscriber.
Declaration
public virtual Operation<Subscriber, CreateSubscriberMetadata> PollOnceCreateSubscriber(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, CreateSubscriberMetadata> | The result of polling the operation. |
PollOnceCreateSubscriberAsync(string, CallSettings)
Asynchronously poll an operation once, using an operationName from a previous invocation of
CreateSubscriber.
Declaration
public virtual Task<Operation<Subscriber, CreateSubscriberMetadata>> PollOnceCreateSubscriberAsync(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, CreateSubscriberMetadata>> | A task representing the result of polling the operation. |
PollOnceDeleteSubscriber(string, CallSettings)
Poll an operation once, using an operationName from a previous invocation of DeleteSubscriber.
Declaration
public virtual Operation<Empty, DeleteSubscriberMetadata> PollOnceDeleteSubscriber(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Empty, DeleteSubscriberMetadata> | The result of polling the operation. |
PollOnceDeleteSubscriberAsync(string, CallSettings)
Asynchronously poll an operation once, using an operationName from a previous invocation of
DeleteSubscriber.
Declaration
public virtual Task<Operation<Empty, DeleteSubscriberMetadata>> PollOnceDeleteSubscriberAsync(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Empty, DeleteSubscriberMetadata>> | A task representing the result of polling the operation. |
PollOnceUpdateSubscriber(string, CallSettings)
Poll an operation once, using an operationName from a previous invocation of UpdateSubscriber.
Declaration
public virtual Operation<Subscriber, UpdateSubscriberMetadata> PollOnceUpdateSubscriber(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, UpdateSubscriberMetadata> | The result of polling the operation. |
PollOnceUpdateSubscriberAsync(string, CallSettings)
Asynchronously poll an operation once, using an operationName from a previous invocation of
UpdateSubscriber.
Declaration
public virtual Task<Operation<Subscriber, UpdateSubscriberMetadata>> PollOnceUpdateSubscriberAsync(string operationName, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | operationName | The name of a previously invoked operation. Must not be |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A task representing the result of polling the operation. |
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous shutdown operation. |
Remarks
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.
UpdateSubscriber(Subscriber, FieldMask, CallSettings)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Operation<Subscriber, UpdateSubscriberMetadata> UpdateSubscriber(Subscriber subscriber, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscriber | subscriber | Required. The subscriber resource to update. Its 'name' field is mapped to the URI, and the value of the 'name' field should be of the form: "projects/{project}/subscribers/{subscriber_id}". The remaining fields of the Subscriber object represent the new values for the corresponding fields in the existing subscriber resource. |
| FieldMask | updateMask | Optional. A field mask that specifies which fields of the Subscriber message are to be updated. This allows for partial updates. Supported fields:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Operation<Subscriber, UpdateSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
Subscriber subscriber = new Subscriber();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = dataSubscriptionServiceClient.UpdateSubscriber(subscriber, updateMask);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceUpdateSubscriber(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscriber(UpdateSubscriberRequest, CallSettings)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Operation<Subscriber, UpdateSubscriberMetadata> UpdateSubscriber(UpdateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriberRequest | request | 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 |
|---|---|
| Operation<Subscriber, UpdateSubscriberMetadata> | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
UpdateSubscriberRequest request = new UpdateSubscriberRequest
{
Subscriber = new Subscriber(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = dataSubscriptionServiceClient.UpdateSubscriber(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = dataSubscriptionServiceClient.PollOnceUpdateSubscriber(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscriberAsync(Subscriber, FieldMask, CallSettings)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Task<Operation<Subscriber, UpdateSubscriberMetadata>> UpdateSubscriberAsync(Subscriber subscriber, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscriber | subscriber | Required. The subscriber resource to update. Its 'name' field is mapped to the URI, and the value of the 'name' field should be of the form: "projects/{project}/subscribers/{subscriber_id}". The remaining fields of the Subscriber object represent the new values for the corresponding fields in the existing subscriber resource. |
| FieldMask | updateMask | Optional. A field mask that specifies which fields of the Subscriber message are to be updated. This allows for partial updates. Supported fields:
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
Subscriber subscriber = new Subscriber();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = await dataSubscriptionServiceClient.UpdateSubscriberAsync(subscriber, updateMask);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceUpdateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscriberAsync(Subscriber, FieldMask, CancellationToken)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Task<Operation<Subscriber, UpdateSubscriberMetadata>> UpdateSubscriberAsync(Subscriber subscriber, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscriber | subscriber | Required. The subscriber resource to update. Its 'name' field is mapped to the URI, and the value of the 'name' field should be of the form: "projects/{project}/subscribers/{subscriber_id}". The remaining fields of the Subscriber object represent the new values for the corresponding fields in the existing subscriber resource. |
| FieldMask | updateMask | Optional. A field mask that specifies which fields of the Subscriber message are to be updated. This allows for partial updates. Supported fields:
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
Subscriber subscriber = new Subscriber();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = await dataSubscriptionServiceClient.UpdateSubscriberAsync(subscriber, updateMask);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceUpdateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscriberAsync(UpdateSubscriberRequest, CallSettings)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Task<Operation<Subscriber, UpdateSubscriberMetadata>> UpdateSubscriberAsync(UpdateSubscriberRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriberRequest | request | 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 |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSubscriberRequest request = new UpdateSubscriberRequest
{
Subscriber = new Subscriber(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = await dataSubscriptionServiceClient.UpdateSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceUpdateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscriberAsync(UpdateSubscriberRequest, CancellationToken)
Updates the configuration of an existing subscriber, such as the endpoint URI or the data types it's interested in.
Endpoint Verification:
If the endpoint_uri or endpoint_authorization field is included in the
update_mask, the backend will re-verify the endpoint. The verification
process is the same as described in CreateSubscriber:
- Verification with Authorization: POST to the new or existing
endpoint_uriwith the new or existingAuthorizationsecret. Expects HTTP201 Created. - Verification without Authorization: POST to the
endpoint_uriwithout theAuthorizationheader. Expects HTTP401 Unauthorizedor403 Forbidden.
Both tests must pass using the potentially updated values for the subscriber update to succeed. If verification fails, the update will not be applied, and an error will be returned.
Declaration
public virtual Task<Operation<Subscriber, UpdateSubscriberMetadata>> UpdateSubscriberAsync(UpdateSubscriberRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriberRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Operation<Subscriber, UpdateSubscriberMetadata>> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSubscriberRequest request = new UpdateSubscriberRequest
{
Subscriber = new Subscriber(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Subscriber, UpdateSubscriberMetadata> response = await dataSubscriptionServiceClient.UpdateSubscriberAsync(request);
// Poll until the returned long-running operation is complete
Operation<Subscriber, UpdateSubscriberMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Subscriber 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<Subscriber, UpdateSubscriberMetadata> retrievedResponse = await dataSubscriptionServiceClient.PollOnceUpdateSubscriberAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Subscriber retrievedResult = retrievedResponse.Result;
}
UpdateSubscription(Subscription, FieldMask, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public virtual Subscription UpdateSubscription(Subscription subscription, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscription | subscription | Required. The subscription to update.
The subscription's |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Subscription | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
Subscription subscription = new Subscription();
FieldMask updateMask = new FieldMask();
// Make the request
Subscription response = dataSubscriptionServiceClient.UpdateSubscription(subscription, updateMask);
UpdateSubscription(UpdateSubscriptionRequest, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public virtual Subscription UpdateSubscription(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriptionRequest | request | 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 |
|---|---|
| Subscription | The RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = DataSubscriptionServiceClient.Create();
// Initialize request argument(s)
UpdateSubscriptionRequest request = new UpdateSubscriptionRequest
{
Subscription = new Subscription(),
UpdateMask = new FieldMask(),
};
// Make the request
Subscription response = dataSubscriptionServiceClient.UpdateSubscription(request);
UpdateSubscriptionAsync(Subscription, FieldMask, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public virtual Task<Subscription> UpdateSubscriptionAsync(Subscription subscription, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscription | subscription | Required. The subscription to update.
The subscription's |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
Subscription subscription = new Subscription();
FieldMask updateMask = new FieldMask();
// Make the request
Subscription response = await dataSubscriptionServiceClient.UpdateSubscriptionAsync(subscription, updateMask);
UpdateSubscriptionAsync(Subscription, FieldMask, CancellationToken)
Updates the data types for an existing user subscription.
Declaration
public virtual Task<Subscription> UpdateSubscriptionAsync(Subscription subscription, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Subscription | subscription | Required. The subscription to update.
The subscription's |
| FieldMask | updateMask | Optional. The list of fields to update. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
Subscription subscription = new Subscription();
FieldMask updateMask = new FieldMask();
// Make the request
Subscription response = await dataSubscriptionServiceClient.UpdateSubscriptionAsync(subscription, updateMask);
UpdateSubscriptionAsync(UpdateSubscriptionRequest, CallSettings)
Updates the data types for an existing user subscription.
Declaration
public virtual Task<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriptionRequest | request | 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 |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSubscriptionRequest request = new UpdateSubscriptionRequest
{
Subscription = new Subscription(),
UpdateMask = new FieldMask(),
};
// Make the request
Subscription response = await dataSubscriptionServiceClient.UpdateSubscriptionAsync(request);
UpdateSubscriptionAsync(UpdateSubscriptionRequest, CancellationToken)
Updates the data types for an existing user subscription.
Declaration
public virtual Task<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateSubscriptionRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Subscription> | A Task containing the RPC response. |
Sample code
// Create client
DataSubscriptionServiceClient dataSubscriptionServiceClient = await DataSubscriptionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSubscriptionRequest request = new UpdateSubscriptionRequest
{
Subscription = new Subscription(),
UpdateMask = new FieldMask(),
};
// Make the request
Subscription response = await dataSubscriptionServiceClient.UpdateSubscriptionAsync(request);