/// <summary>Snippet for ReportPhishing</summary>
 public void ReportPhishing()
 {
     // Snippet: ReportPhishing(string, string, CallSettings)
     // Create client
     PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client = PhishingProtectionServiceV1Beta1Client.Create();
     // Initialize request argument(s)
     string parent = "projects/[PROJECT]";
     string uri    = "";
     // Make the request
     ReportPhishingResponse response = phishingProtectionServiceV1Beta1Client.ReportPhishing(parent, uri);
     // End snippet
 }
 /// <summary>Snippet for ReportPhishing</summary>
 public void ReportPhishingResourceNames()
 {
     // Snippet: ReportPhishing(ProjectName, string, CallSettings)
     // Create client
     PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client = PhishingProtectionServiceV1Beta1Client.Create();
     // Initialize request argument(s)
     ProjectName parent = ProjectName.FromProject("[PROJECT]");
     string      uri    = "";
     // Make the request
     ReportPhishingResponse response = phishingProtectionServiceV1Beta1Client.ReportPhishing(parent, uri);
     // End snippet
 }
        /// <summary>Snippet for ReportPhishingAsync</summary>
        public async Task ReportPhishingAsync()
        {
            // Snippet: ReportPhishingAsync(string, string, CallSettings)
            // Additional: ReportPhishingAsync(string, string, CancellationToken)
            // Create client
            PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client = await PhishingProtectionServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]";
            string uri    = "";
            // Make the request
            ReportPhishingResponse response = await phishingProtectionServiceV1Beta1Client.ReportPhishingAsync(parent, uri);

            // End snippet
        }
 /// <summary>Snippet for ReportPhishing</summary>
 public void ReportPhishingRequestObject()
 {
     // Snippet: ReportPhishing(ReportPhishingRequest, CallSettings)
     // Create client
     PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client = PhishingProtectionServiceV1Beta1Client.Create();
     // Initialize request argument(s)
     ReportPhishingRequest request = new ReportPhishingRequest
     {
         ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
         Uri = "",
     };
     // Make the request
     ReportPhishingResponse response = phishingProtectionServiceV1Beta1Client.ReportPhishing(request);
     // End snippet
 }
        public void ReportPhishing()
        {
            moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(moq::MockBehavior.Strict);
            ReportPhishingRequest request = new ReportPhishingRequest
            {
                ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"),
                Uri = "uri3db70593",
            };
            ReportPhishingResponse expectedResponse = new ReportPhishingResponse {
            };

            mockGrpcClient.Setup(x => x.ReportPhishing(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null);
            ReportPhishingResponse response = client.ReportPhishing(request.Parent, request.Uri);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for ReportPhishingAsync</summary>
        public async Task ReportPhishingRequestObjectAsync()
        {
            // Snippet: ReportPhishingAsync(ReportPhishingRequest, CallSettings)
            // Additional: ReportPhishingAsync(ReportPhishingRequest, CancellationToken)
            // Create client
            PhishingProtectionServiceV1Beta1Client phishingProtectionServiceV1Beta1Client = await PhishingProtectionServiceV1Beta1Client.CreateAsync();

            // Initialize request argument(s)
            ReportPhishingRequest request = new ReportPhishingRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                Uri = "",
            };
            // Make the request
            ReportPhishingResponse response = await phishingProtectionServiceV1Beta1Client.ReportPhishingAsync(request);

            // End snippet
        }
Example #7
0
        public void ReportPhishing2()
        {
            Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(MockBehavior.Strict);
            ReportPhishingRequest request = new ReportPhishingRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
                Uri = "uri116076",
            };
            ReportPhishingResponse expectedResponse = new ReportPhishingResponse();

            mockGrpcClient.Setup(x => x.ReportPhishing(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null);
            ReportPhishingResponse response = client.ReportPhishing(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #8
0
        public async Task ReportPhishingAsync2()
        {
            Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(MockBehavior.Strict);
            ReportPhishingRequest request = new ReportPhishingRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
                Uri = "uri116076",
            };
            ReportPhishingResponse expectedResponse = new ReportPhishingResponse();

            mockGrpcClient.Setup(x => x.ReportPhishingAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <ReportPhishingResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null);
            ReportPhishingResponse response = await client.ReportPhishingAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task ReportPhishingAsync()
        {
            moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(moq::MockBehavior.Strict);
            ReportPhishingRequest request = new ReportPhishingRequest
            {
                ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"),
                Uri = "uri3db70593",
            };
            ReportPhishingResponse expectedResponse = new ReportPhishingResponse {
            };

            mockGrpcClient.Setup(x => x.ReportPhishingAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ReportPhishingResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null);
            ReportPhishingResponse responseCallSettings   = await client.ReportPhishingAsync(request.Parent, request.Uri, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ReportPhishingResponse responseCancellationToken = await client.ReportPhishingAsync(request.Parent, request.Uri, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }