Class RecaptchaEnterpriseServiceClient (1.3.0)

public abstract class RecaptchaEnterpriseServiceClient

RecaptchaEnterpriseService client wrapper, for convenient use.

Inheritance

Object > RecaptchaEnterpriseServiceClient

Namespace

Google.Cloud.RecaptchaEnterprise.V1

Assembly

Google.Cloud.RecaptchaEnterprise.V1.dll

Remarks

Service to determine the likelihood an event is legitimate.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the RecaptchaEnterpriseService service, which is a host of "recaptchaenterprise.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default RecaptchaEnterpriseService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default RecaptchaEnterpriseService scopes are:

GrpcClient

public virtual RecaptchaEnterpriseService.RecaptchaEnterpriseServiceClient GrpcClient { get; }

The underlying gRPC RecaptchaEnterpriseService client

Property Value
TypeDescription
RecaptchaEnterpriseService.RecaptchaEnterpriseServiceClient

Methods

AnnotateAssessment(AnnotateAssessmentRequest, CallSettings)

public virtual AnnotateAssessmentResponse AnnotateAssessment(AnnotateAssessmentRequest request, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
requestAnnotateAssessmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AnnotateAssessmentResponse

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
AnnotateAssessmentRequest request = new AnnotateAssessmentRequest
{
    AssessmentName = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]"),
    Annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified,
};
// Make the request
AnnotateAssessmentResponse response = recaptchaEnterpriseServiceClient.AnnotateAssessment(request);

AnnotateAssessment(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CallSettings)

public virtual AnnotateAssessmentResponse AnnotateAssessment(AssessmentName name, AnnotateAssessmentRequest.Types.Annotation annotation, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameAssessmentName

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AnnotateAssessmentResponse

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
AssessmentName name = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]");
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = recaptchaEnterpriseServiceClient.AnnotateAssessment(name, annotation);

AnnotateAssessment(String, AnnotateAssessmentRequest.Types.Annotation, CallSettings)

public virtual AnnotateAssessmentResponse AnnotateAssessment(string name, AnnotateAssessmentRequest.Types.Annotation annotation, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameString

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AnnotateAssessmentResponse

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/assessments/[ASSESSMENT]";
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = recaptchaEnterpriseServiceClient.AnnotateAssessment(name, annotation);

AnnotateAssessmentAsync(AnnotateAssessmentRequest, CallSettings)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(AnnotateAssessmentRequest request, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
requestAnnotateAssessmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
AnnotateAssessmentRequest request = new AnnotateAssessmentRequest
{
    AssessmentName = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]"),
    Annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified,
};
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(request);

AnnotateAssessmentAsync(AnnotateAssessmentRequest, CancellationToken)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(AnnotateAssessmentRequest request, CancellationToken cancellationToken)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
requestAnnotateAssessmentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
AnnotateAssessmentRequest request = new AnnotateAssessmentRequest
{
    AssessmentName = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]"),
    Annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified,
};
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(request);

AnnotateAssessmentAsync(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CallSettings)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(AssessmentName name, AnnotateAssessmentRequest.Types.Annotation annotation, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameAssessmentName

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
AssessmentName name = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]");
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(name, annotation);

AnnotateAssessmentAsync(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CancellationToken)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(AssessmentName name, AnnotateAssessmentRequest.Types.Annotation annotation, CancellationToken cancellationToken)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameAssessmentName

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
AssessmentName name = AssessmentName.FromProjectAssessment("[PROJECT]", "[ASSESSMENT]");
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(name, annotation);

AnnotateAssessmentAsync(String, AnnotateAssessmentRequest.Types.Annotation, CallSettings)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(string name, AnnotateAssessmentRequest.Types.Annotation annotation, CallSettings callSettings = null)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameString

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/assessments/[ASSESSMENT]";
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(name, annotation);

AnnotateAssessmentAsync(String, AnnotateAssessmentRequest.Types.Annotation, CancellationToken)

public virtual Task<AnnotateAssessmentResponse> AnnotateAssessmentAsync(string name, AnnotateAssessmentRequest.Types.Annotation annotation, CancellationToken cancellationToken)

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Parameters
NameDescription
nameString

Required. The resource name of the Assessment, in the format "projects/{project}/assessments/{assessment}".

annotationAnnotateAssessmentRequest.Types.Annotation

Required. The annotation that will be assigned to the Event.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AnnotateAssessmentResponse>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/assessments/[ASSESSMENT]";
AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
// Make the request
AnnotateAssessmentResponse response = await recaptchaEnterpriseServiceClient.AnnotateAssessmentAsync(name, annotation);

Create()

public static RecaptchaEnterpriseServiceClient Create()

Synchronously creates a RecaptchaEnterpriseServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RecaptchaEnterpriseServiceClientBuilder.

Returns
TypeDescription
RecaptchaEnterpriseServiceClient

The created RecaptchaEnterpriseServiceClient.

CreateAssessment(ProjectName, Assessment, CallSettings)

public virtual Assessment CreateAssessment(ProjectName parent, Assessment assessment, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentProjectName

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Assessment

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Assessment assessment = new Assessment();
// Make the request
Assessment response = recaptchaEnterpriseServiceClient.CreateAssessment(parent, assessment);

CreateAssessment(CreateAssessmentRequest, CallSettings)

public virtual Assessment CreateAssessment(CreateAssessmentRequest request, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
requestCreateAssessmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Assessment

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
CreateAssessmentRequest request = new CreateAssessmentRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Assessment = new Assessment(),
};
// Make the request
Assessment response = recaptchaEnterpriseServiceClient.CreateAssessment(request);

CreateAssessment(String, Assessment, CallSettings)

public virtual Assessment CreateAssessment(string parent, Assessment assessment, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentString

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Assessment

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Assessment assessment = new Assessment();
// Make the request
Assessment response = recaptchaEnterpriseServiceClient.CreateAssessment(parent, assessment);

CreateAssessmentAsync(ProjectName, Assessment, CallSettings)

public virtual Task<Assessment> CreateAssessmentAsync(ProjectName parent, Assessment assessment, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentProjectName

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Assessment assessment = new Assessment();
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(parent, assessment);

CreateAssessmentAsync(ProjectName, Assessment, CancellationToken)

public virtual Task<Assessment> CreateAssessmentAsync(ProjectName parent, Assessment assessment, CancellationToken cancellationToken)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentProjectName

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Assessment assessment = new Assessment();
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(parent, assessment);

CreateAssessmentAsync(CreateAssessmentRequest, CallSettings)

public virtual Task<Assessment> CreateAssessmentAsync(CreateAssessmentRequest request, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
requestCreateAssessmentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssessmentRequest request = new CreateAssessmentRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Assessment = new Assessment(),
};
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(request);

CreateAssessmentAsync(CreateAssessmentRequest, CancellationToken)

public virtual Task<Assessment> CreateAssessmentAsync(CreateAssessmentRequest request, CancellationToken cancellationToken)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
requestCreateAssessmentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssessmentRequest request = new CreateAssessmentRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Assessment = new Assessment(),
};
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(request);

CreateAssessmentAsync(String, Assessment, CallSettings)

public virtual Task<Assessment> CreateAssessmentAsync(string parent, Assessment assessment, CallSettings callSettings = null)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentString

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Assessment assessment = new Assessment();
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(parent, assessment);

CreateAssessmentAsync(String, Assessment, CancellationToken)

public virtual Task<Assessment> CreateAssessmentAsync(string parent, Assessment assessment, CancellationToken cancellationToken)

Creates an Assessment of the likelihood an event is legitimate.

Parameters
NameDescription
parentString

Required. The name of the project in which the assessment will be created, in the format "projects/{project}".

assessmentAssessment

Required. The assessment details.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Assessment>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Assessment assessment = new Assessment();
// Make the request
Assessment response = await recaptchaEnterpriseServiceClient.CreateAssessmentAsync(parent, assessment);

CreateAsync(CancellationToken)

public static Task<RecaptchaEnterpriseServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a RecaptchaEnterpriseServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RecaptchaEnterpriseServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<RecaptchaEnterpriseServiceClient>

The task representing the created RecaptchaEnterpriseServiceClient.

CreateKey(CreateKeyRequest, CallSettings)

public virtual Key CreateKey(CreateKeyRequest request, CallSettings callSettings = null)

Creates a new reCAPTCHA Enterprise key.

Parameters
NameDescription
requestCreateKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Key

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
CreateKeyRequest request = new CreateKeyRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Key = new Key(),
};
// Make the request
Key response = recaptchaEnterpriseServiceClient.CreateKey(request);

CreateKeyAsync(CreateKeyRequest, CallSettings)

public virtual Task<Key> CreateKeyAsync(CreateKeyRequest request, CallSettings callSettings = null)

Creates a new reCAPTCHA Enterprise key.

Parameters
NameDescription
requestCreateKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
CreateKeyRequest request = new CreateKeyRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Key = new Key(),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.CreateKeyAsync(request);

CreateKeyAsync(CreateKeyRequest, CancellationToken)

public virtual Task<Key> CreateKeyAsync(CreateKeyRequest request, CancellationToken cancellationToken)

Creates a new reCAPTCHA Enterprise key.

Parameters
NameDescription
requestCreateKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
CreateKeyRequest request = new CreateKeyRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Key = new Key(),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.CreateKeyAsync(request);

DeleteKey(DeleteKeyRequest, CallSettings)

public virtual void DeleteKey(DeleteKeyRequest request, CallSettings callSettings = null)

Deletes the specified key.

Parameters
NameDescription
requestDeleteKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
DeleteKeyRequest request = new DeleteKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
recaptchaEnterpriseServiceClient.DeleteKey(request);

DeleteKeyAsync(DeleteKeyRequest, CallSettings)

public virtual Task DeleteKeyAsync(DeleteKeyRequest request, CallSettings callSettings = null)

Deletes the specified key.

Parameters
NameDescription
requestDeleteKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteKeyRequest request = new DeleteKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
await recaptchaEnterpriseServiceClient.DeleteKeyAsync(request);

DeleteKeyAsync(DeleteKeyRequest, CancellationToken)

public virtual Task DeleteKeyAsync(DeleteKeyRequest request, CancellationToken cancellationToken)

Deletes the specified key.

Parameters
NameDescription
requestDeleteKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteKeyRequest request = new DeleteKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
await recaptchaEnterpriseServiceClient.DeleteKeyAsync(request);

GetKey(GetKeyRequest, CallSettings)

public virtual Key GetKey(GetKeyRequest request, CallSettings callSettings = null)

Returns the specified key.

Parameters
NameDescription
requestGetKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Key

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
GetKeyRequest request = new GetKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
Key response = recaptchaEnterpriseServiceClient.GetKey(request);

GetKeyAsync(GetKeyRequest, CallSettings)

public virtual Task<Key> GetKeyAsync(GetKeyRequest request, CallSettings callSettings = null)

Returns the specified key.

Parameters
NameDescription
requestGetKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
GetKeyRequest request = new GetKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.GetKeyAsync(request);

GetKeyAsync(GetKeyRequest, CancellationToken)

public virtual Task<Key> GetKeyAsync(GetKeyRequest request, CancellationToken cancellationToken)

Returns the specified key.

Parameters
NameDescription
requestGetKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
GetKeyRequest request = new GetKeyRequest
{
    KeyName = KeyName.FromProjectKey("[PROJECT]", "[KEY]"),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.GetKeyAsync(request);

ListKeys(ListKeysRequest, CallSettings)

public virtual PagedEnumerable<ListKeysResponse, Key> ListKeys(ListKeysRequest request, CallSettings callSettings = null)

Returns the list of all keys that belong to a project.

Parameters
NameDescription
requestListKeysRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListKeysResponse, Key>

A pageable sequence of Key resources.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
ListKeysRequest request = new ListKeysRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedEnumerable<ListKeysResponse, Key> response = recaptchaEnterpriseServiceClient.ListKeys(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Key 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 (ListKeysResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Key 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<Key> 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 (Key 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;

ListKeysAsync(ListKeysRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListKeysResponse, Key> ListKeysAsync(ListKeysRequest request, CallSettings callSettings = null)

Returns the list of all keys that belong to a project.

Parameters
NameDescription
requestListKeysRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListKeysResponse, Key>

A pageable asynchronous sequence of Key resources.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
ListKeysRequest request = new ListKeysRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
PagedAsyncEnumerable<ListKeysResponse, Key> response = recaptchaEnterpriseServiceClient.ListKeysAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Key item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListKeysResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Key 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<Key> 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 (Key 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;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
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.

UpdateKey(UpdateKeyRequest, CallSettings)

public virtual Key UpdateKey(UpdateKeyRequest request, CallSettings callSettings = null)

Updates the specified key.

Parameters
NameDescription
requestUpdateKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Key

The RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = RecaptchaEnterpriseServiceClient.Create();
// Initialize request argument(s)
UpdateKeyRequest request = new UpdateKeyRequest
{
    Key = new Key(),
    UpdateMask = new FieldMask(),
};
// Make the request
Key response = recaptchaEnterpriseServiceClient.UpdateKey(request);

UpdateKeyAsync(UpdateKeyRequest, CallSettings)

public virtual Task<Key> UpdateKeyAsync(UpdateKeyRequest request, CallSettings callSettings = null)

Updates the specified key.

Parameters
NameDescription
requestUpdateKeyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateKeyRequest request = new UpdateKeyRequest
{
    Key = new Key(),
    UpdateMask = new FieldMask(),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.UpdateKeyAsync(request);

UpdateKeyAsync(UpdateKeyRequest, CancellationToken)

public virtual Task<Key> UpdateKeyAsync(UpdateKeyRequest request, CancellationToken cancellationToken)

Updates the specified key.

Parameters
NameDescription
requestUpdateKeyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Key>

A Task containing the RPC response.

Example
// Create client
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient = await RecaptchaEnterpriseServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateKeyRequest request = new UpdateKeyRequest
{
    Key = new Key(),
    UpdateMask = new FieldMask(),
};
// Make the request
Key response = await recaptchaEnterpriseServiceClient.UpdateKeyAsync(request);