/// <summary>
 /// Annotates a previously created Assessment to provide additional information
 /// on whether the event turned out to be authentic or fradulent.
 /// </summary>
 /// <param name="name">
 /// Required. The resource name of the Assessment, in the format
 /// "projects/{project_number}/assessments/{assessment_id}".
 /// </param>
 /// <param name="annotation">
 /// The annotation that will be assigned to the Event.
 /// </param>
 /// <param name="cancellationToken">
 /// A <see cref="st::CancellationToken"/> to use for this RPC.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual stt::Task <AnnotateAssessmentResponse> AnnotateAssessmentAsync(
     string name,
     AnnotateAssessmentRequest.Types.Annotation annotation,
     st::CancellationToken cancellationToken) => AnnotateAssessmentAsync(
     name,
     annotation,
     gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Annotates a previously created Assessment to provide additional information
 /// on whether the event turned out to be authentic or fradulent.
 /// </summary>
 /// <param name="name">
 /// Required. The resource name of the Assessment, in the format
 /// "projects/{project_number}/assessments/{assessment_id}".
 /// </param>
 /// <param name="annotation">
 /// The annotation that will be assigned to the Event.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// The RPC response.
 /// </returns>
 public virtual AnnotateAssessmentResponse AnnotateAssessment(
     string name,
     AnnotateAssessmentRequest.Types.Annotation annotation,
     gaxgrpc::CallSettings callSettings = null) => AnnotateAssessment(
     new AnnotateAssessmentRequest
 {
     Name       = gax::GaxPreconditions.CheckNotNullOrEmpty(name, nameof(name)),
     Annotation = annotation,
 },
     callSettings);
 /// <summary>
 /// Annotates a previously created Assessment to provide additional information
 /// on whether the event turned out to be authentic or fradulent.
 /// </summary>
 /// <param name="name">
 /// Required. The resource name of the Assessment, in the format
 /// "projects/{project_number}/assessments/{assessment_id}".
 /// </param>
 /// <param name="annotation">
 /// The annotation that will be assigned to the Event.
 /// </param>
 /// <param name="callSettings">
 /// If not null, applies overrides to this RPC call.
 /// </param>
 /// <returns>
 /// A Task containing the RPC response.
 /// </returns>
 public virtual stt::Task <AnnotateAssessmentResponse> AnnotateAssessmentAsync(
     AssessmentName name,
     AnnotateAssessmentRequest.Types.Annotation annotation,
     gaxgrpc::CallSettings callSettings = null) => AnnotateAssessmentAsync(
     new AnnotateAssessmentRequest
 {
     AssessmentName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)),
     Annotation     = annotation,
 },
     callSettings);
Beispiel #4
0
        /// <summary>Snippet for AnnotateAssessment</summary>
        public void AnnotateAssessmentResourceNames()
        {
            // Snippet: AnnotateAssessment(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CallSettings)
            // 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);
            // End snippet
        }
Beispiel #5
0
        /// <summary>Snippet for AnnotateAssessment</summary>
        public void AnnotateAssessment()
        {
            // Snippet: AnnotateAssessment(string, AnnotateAssessmentRequest.Types.Annotation, CallSettings)
            // 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);
            // End snippet
        }
Beispiel #6
0
        /// <summary>Snippet for AnnotateAssessmentAsync</summary>
        public async Task AnnotateAssessmentResourceNamesAsync()
        {
            // Snippet: AnnotateAssessmentAsync(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CallSettings)
            // Additional: AnnotateAssessmentAsync(AssessmentName, AnnotateAssessmentRequest.Types.Annotation, CancellationToken)
            // 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);

            // End snippet
        }
Beispiel #7
0
        /// <summary>Snippet for AnnotateAssessmentAsync</summary>
        public async Task AnnotateAssessmentAsync()
        {
            // Snippet: AnnotateAssessmentAsync(string, AnnotateAssessmentRequest.Types.Annotation, CallSettings)
            // Additional: AnnotateAssessmentAsync(string, AnnotateAssessmentRequest.Types.Annotation, CancellationToken)
            // 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);

            // End snippet
        }
        public async Task AnnotateAssessmentAsync()
        {
            Mock <RecaptchaEnterpriseServiceV1Beta1.RecaptchaEnterpriseServiceV1Beta1Client> mockGrpcClient = new Mock <RecaptchaEnterpriseServiceV1Beta1.RecaptchaEnterpriseServiceV1Beta1Client>(MockBehavior.Strict);
            AnnotateAssessmentRequest expectedRequest = new AnnotateAssessmentRequest
            {
                AssessmentName = new AssessmentName("[PROJECT]", "[ASSESSMENT]"),
                Annotation     = AnnotateAssessmentRequest.Types.Annotation.Unspecified,
            };
            AnnotateAssessmentResponse expectedResponse = new AnnotateAssessmentResponse();

            mockGrpcClient.Setup(x => x.AnnotateAssessmentAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <AnnotateAssessmentResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            RecaptchaEnterpriseServiceV1Beta1Client client = new RecaptchaEnterpriseServiceV1Beta1ClientImpl(mockGrpcClient.Object, null);
            AssessmentName name = new AssessmentName("[PROJECT]", "[ASSESSMENT]");

            AnnotateAssessmentRequest.Types.Annotation annotation = AnnotateAssessmentRequest.Types.Annotation.Unspecified;
            AnnotateAssessmentResponse response = await client.AnnotateAssessmentAsync(name, annotation);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }