public void ExplainRequestObject()
        {
            moq::Mock <PredictionService.PredictionServiceClient> mockGrpcClient = new moq::Mock <PredictionService.PredictionServiceClient>(moq::MockBehavior.Strict);
            ExplainRequest request = new ExplainRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                Instances               = { new wkt::Value(), },
                DeployedModelId         = "deployed_model_idf0bd41af",
                Parameters              = new wkt::Value(),
                ExplanationSpecOverride = new ExplanationSpecOverride(),
            };
            ExplainResponse expectedResponse = new ExplainResponse
            {
                Explanations    = { new Explanation(), },
                DeployedModelId = "deployed_model_idf0bd41af",
                Predictions     = { new wkt::Value(), },
            };

            mockGrpcClient.Setup(x => x.Explain(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PredictionServiceClient client   = new PredictionServiceClientImpl(mockGrpcClient.Object, null);
            ExplainResponse         response = client.Explain(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for DeleteEndpoint</summary>
        public void DeleteEndpointRequestObject()
        {
            // Snippet: DeleteEndpoint(DeleteEndpointRequest, CallSettings)
            // Create client
            IDSClient iDSClient = IDSClient.Create();
            // Initialize request argument(s)
            DeleteEndpointRequest request = new DeleteEndpointRequest
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                RequestId    = "",
            };
            // Make the request
            Operation <Empty, OperationMetadata> response = iDSClient.DeleteEndpoint(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = iDSClient.PollOnceDeleteEndpoint(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;
            }
            // End snippet
        }
Exemple #3
0
        public async stt::Task PredictRequestObjectAsync()
        {
            moq::Mock <PredictionService.PredictionServiceClient> mockGrpcClient = new moq::Mock <PredictionService.PredictionServiceClient>(moq::MockBehavior.Strict);
            PredictRequest request = new PredictRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                Instances  = { new wkt::Value(), },
                Parameters = new wkt::Value(),
            };
            PredictResponse expectedResponse = new PredictResponse
            {
                Predictions     = { new wkt::Value(), },
                DeployedModelId = "deployed_model_idf0bd41af",
            };

            mockGrpcClient.Setup(x => x.PredictAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <PredictResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            PredictionServiceClient client = new PredictionServiceClientImpl(mockGrpcClient.Object, null);
            PredictResponse         responseCallSettings = await client.PredictAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            PredictResponse responseCancellationToken = await client.PredictAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for DeleteEndpointAsync</summary>
        public async Task DeleteEndpointResourceNamesAsync()
        {
            // Snippet: DeleteEndpointAsync(EndpointName, CallSettings)
            // Additional: DeleteEndpointAsync(EndpointName, CancellationToken)
            // Create client
            IDSClient iDSClient = await IDSClient.CreateAsync();

            // Initialize request argument(s)
            EndpointName name = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
            // Make the request
            Operation <Empty, OperationMetadata> response = await iDSClient.DeleteEndpointAsync(name);

            // Poll until the returned long-running operation is complete
            Operation <Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation <Empty, OperationMetadata> retrievedResponse = await iDSClient.PollOnceDeleteEndpointAsync(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;
            }
            // End snippet
        }
        public async stt::Task RawPredictResourceNamesAsync()
        {
            moq::Mock <PredictionService.PredictionServiceClient> mockGrpcClient = new moq::Mock <PredictionService.PredictionServiceClient>(moq::MockBehavior.Strict);
            RawPredictRequest request = new RawPredictRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                HttpBody = new ga::HttpBody(),
            };
            ga::HttpBody expectedResponse = new ga::HttpBody
            {
                ContentType = "content_type085be0ea",
                Data        = proto::ByteString.CopyFromUtf8("data387f778d"),
                Extensions  = { new wkt::Any(), },
            };

            mockGrpcClient.Setup(x => x.RawPredictAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ga::HttpBody>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            PredictionServiceClient client = new PredictionServiceClientImpl(mockGrpcClient.Object, null);
            ga::HttpBody            responseCallSettings = await client.RawPredictAsync(request.EndpointAsEndpointName, request.HttpBody, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ga::HttpBody responseCancellationToken = await client.RawPredictAsync(request.EndpointAsEndpointName, request.HttpBody, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for GetEndpoint</summary>
 public void GetEndpointResourceNames()
 {
     // Snippet: GetEndpoint(EndpointName, CallSettings)
     // Create client
     IDSClient iDSClient = IDSClient.Create();
     // Initialize request argument(s)
     EndpointName name = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
     // Make the request
     Endpoint response = iDSClient.GetEndpoint(name);
     // End snippet
 }
 /// <summary>Snippet for RawPredict</summary>
 public void RawPredictResourceNames()
 {
     // Snippet: RawPredict(EndpointName, HttpBody, CallSettings)
     // Create client
     PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
     // Initialize request argument(s)
     EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
     HttpBody     httpBody = new HttpBody();
     // Make the request
     HttpBody response = predictionServiceClient.RawPredict(endpoint, httpBody);
     // End snippet
 }
Exemple #8
0
        public async stt::Task UpdateEndpointAsync()
        {
            moq::Mock <EndpointService.EndpointServiceClient> mockGrpcClient = new moq::Mock <EndpointService.EndpointServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            UpdateEndpointRequest request = new UpdateEndpointRequest
            {
                Endpoint   = new Endpoint(),
                UpdateMask = new wkt::FieldMask(),
            };
            Endpoint expectedResponse = new Endpoint
            {
                EndpointName   = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                DisplayName    = "display_name137f65c2",
                Description    = "description2cf9da67",
                DeployedModels =
                {
                    new DeployedModel(),
                },
                TrafficSplit =
                {
                    {
                        "key8a0b6e3c",
                        1623286560
                    },
                },
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                CreateTime           = new wkt::Timestamp(),
                UpdateTime           = new wkt::Timestamp(),
                EncryptionSpec       = new EncryptionSpec(),
                NetworkAsNetworkName = NetworkName.FromProjectNetwork("[PROJECT]", "[NETWORK]"),
                ModelDeploymentMonitoringJobAsModelDeploymentMonitoringJobName = ModelDeploymentMonitoringJobName.FromProjectLocationModelDeploymentMonitoringJob("[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"),
                EnablePrivateServiceConnect = false,
            };

            mockGrpcClient.Setup(x => x.UpdateEndpointAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Endpoint>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            EndpointServiceClient client  = new EndpointServiceClientImpl(mockGrpcClient.Object, null);
            Endpoint responseCallSettings = await client.UpdateEndpointAsync(request.Endpoint, request.UpdateMask, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Endpoint responseCancellationToken = await client.UpdateEndpointAsync(request.Endpoint, request.UpdateMask, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemple #9
0
 /// <summary>Snippet for Predict</summary>
 public void PredictResourceNames()
 {
     // Snippet: Predict(EndpointName, IEnumerable<Value>, Value, CallSettings)
     // Create client
     PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
     // Initialize request argument(s)
     EndpointName        endpoint  = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
     IEnumerable <Value> instances = new Value[] { new Value(), };
     Value parameters = new Value();
     // Make the request
     PredictResponse response = predictionServiceClient.Predict(endpoint, instances, parameters);
     // End snippet
 }
 /// <summary>Snippet for GetEndpoint</summary>
 public void GetEndpointRequestObject()
 {
     // Snippet: GetEndpoint(GetEndpointRequest, CallSettings)
     // Create client
     IDSClient iDSClient = IDSClient.Create();
     // Initialize request argument(s)
     GetEndpointRequest request = new GetEndpointRequest
     {
         EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
     };
     // Make the request
     Endpoint response = iDSClient.GetEndpoint(request);
     // End snippet
 }
        /// <summary>Snippet for GetEndpointAsync</summary>
        public async Task GetEndpointResourceNamesAsync()
        {
            // Snippet: GetEndpointAsync(EndpointName, CallSettings)
            // Additional: GetEndpointAsync(EndpointName, CancellationToken)
            // Create client
            IDSClient iDSClient = await IDSClient.CreateAsync();

            // Initialize request argument(s)
            EndpointName name = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
            // Make the request
            Endpoint response = await iDSClient.GetEndpointAsync(name);

            // End snippet
        }
 /// <summary>Snippet for RawPredict</summary>
 public void RawPredictRequestObject()
 {
     // Snippet: RawPredict(RawPredictRequest, CallSettings)
     // Create client
     PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
     // Initialize request argument(s)
     RawPredictRequest request = new RawPredictRequest
     {
         EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
         HttpBody = new HttpBody(),
     };
     // Make the request
     HttpBody response = predictionServiceClient.RawPredict(request);
     // End snippet
 }
        /// <summary>Snippet for RawPredictAsync</summary>
        public async Task RawPredictResourceNamesAsync()
        {
            // Snippet: RawPredictAsync(EndpointName, HttpBody, CallSettings)
            // Additional: RawPredictAsync(EndpointName, HttpBody, CancellationToken)
            // Create client
            PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync();

            // Initialize request argument(s)
            EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
            HttpBody     httpBody = new HttpBody();
            // Make the request
            HttpBody response = await predictionServiceClient.RawPredictAsync(endpoint, httpBody);

            // End snippet
        }
        public async stt::Task GetEndpointRequestObjectAsync()
        {
            moq::Mock <EndpointService.EndpointServiceClient> mockGrpcClient = new moq::Mock <EndpointService.EndpointServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetEndpointRequest request = new GetEndpointRequest
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
            };
            Endpoint expectedResponse = new Endpoint
            {
                EndpointName   = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                DisplayName    = "display_name137f65c2",
                Description    = "description2cf9da67",
                DeployedModels =
                {
                    new DeployedModel(),
                },
                TrafficSplit =
                {
                    {
                        "key8a0b6e3c",
                        1623286560
                    },
                },
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                CreateTime     = new wkt::Timestamp(),
                UpdateTime     = new wkt::Timestamp(),
                EncryptionSpec = new EncryptionSpec(),
            };

            mockGrpcClient.Setup(x => x.GetEndpointAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Endpoint>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            EndpointServiceClient client  = new EndpointServiceClientImpl(mockGrpcClient.Object, null);
            Endpoint responseCallSettings = await client.GetEndpointAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Endpoint responseCancellationToken = await client.GetEndpointAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Exemple #15
0
        public void GetEndpointResourceNames()
        {
            moq::Mock <EndpointService.EndpointServiceClient> mockGrpcClient = new moq::Mock <EndpointService.EndpointServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetEndpointRequest request = new GetEndpointRequest
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
            };
            Endpoint expectedResponse = new Endpoint
            {
                EndpointName   = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                DisplayName    = "display_name137f65c2",
                Description    = "description2cf9da67",
                DeployedModels =
                {
                    new DeployedModel(),
                },
                TrafficSplit =
                {
                    {
                        "key8a0b6e3c",
                        1623286560
                    },
                },
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                CreateTime           = new wkt::Timestamp(),
                UpdateTime           = new wkt::Timestamp(),
                EncryptionSpec       = new EncryptionSpec(),
                NetworkAsNetworkName = NetworkName.FromProjectNetwork("[PROJECT]", "[NETWORK]"),
                ModelDeploymentMonitoringJobAsModelDeploymentMonitoringJobName = ModelDeploymentMonitoringJobName.FromProjectLocationModelDeploymentMonitoringJob("[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]"),
                EnablePrivateServiceConnect = false,
            };

            mockGrpcClient.Setup(x => x.GetEndpoint(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            EndpointServiceClient client = new EndpointServiceClientImpl(mockGrpcClient.Object, null);
            Endpoint response            = client.GetEndpoint(request.EndpointName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #16
0
 /// <summary>Snippet for Predict</summary>
 public void PredictRequestObject()
 {
     // Snippet: Predict(PredictRequest, CallSettings)
     // Create client
     PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
     // Initialize request argument(s)
     PredictRequest request = new PredictRequest
     {
         EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
         Instances  = { new Value(), },
         Parameters = new Value(),
     };
     // Make the request
     PredictResponse response = predictionServiceClient.Predict(request);
     // End snippet
 }
        public void UpdateEndpoint()
        {
            moq::Mock <EndpointService.EndpointServiceClient> mockGrpcClient = new moq::Mock <EndpointService.EndpointServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            UpdateEndpointRequest request = new UpdateEndpointRequest
            {
                Endpoint   = new Endpoint(),
                UpdateMask = new wkt::FieldMask(),
            };
            Endpoint expectedResponse = new Endpoint
            {
                EndpointName   = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                DisplayName    = "display_name137f65c2",
                Description    = "description2cf9da67",
                DeployedModels =
                {
                    new DeployedModel(),
                },
                TrafficSplit =
                {
                    {
                        "key8a0b6e3c",
                        1623286560
                    },
                },
                Etag   = "etage8ad7218",
                Labels =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                CreateTime     = new wkt::Timestamp(),
                UpdateTime     = new wkt::Timestamp(),
                EncryptionSpec = new EncryptionSpec(),
            };

            mockGrpcClient.Setup(x => x.UpdateEndpoint(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            EndpointServiceClient client = new EndpointServiceClientImpl(mockGrpcClient.Object, null);
            Endpoint response            = client.UpdateEndpoint(request.Endpoint, request.UpdateMask);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for ExplainAsync</summary>
        public async Task ExplainResourceNamesAsync()
        {
            // Snippet: ExplainAsync(EndpointName, IEnumerable<Value>, Value, string, CallSettings)
            // Additional: ExplainAsync(EndpointName, IEnumerable<Value>, Value, string, CancellationToken)
            // Create client
            PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync();

            // Initialize request argument(s)
            EndpointName        endpoint  = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
            IEnumerable <Value> instances = new Value[] { new Value(), };
            Value  parameters             = new Value();
            string deployedModelId        = "";
            // Make the request
            ExplainResponse response = await predictionServiceClient.ExplainAsync(endpoint, instances, parameters, deployedModelId);

            // End snippet
        }
        /// <summary>Snippet for RawPredictAsync</summary>
        public async Task RawPredictRequestObjectAsync()
        {
            // Snippet: RawPredictAsync(RawPredictRequest, CallSettings)
            // Additional: RawPredictAsync(RawPredictRequest, CancellationToken)
            // Create client
            PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync();

            // Initialize request argument(s)
            RawPredictRequest request = new RawPredictRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                HttpBody = new HttpBody(),
            };
            // Make the request
            HttpBody response = await predictionServiceClient.RawPredictAsync(request);

            // End snippet
        }
 /// <summary>Snippet for Explain</summary>
 public void ExplainRequestObject()
 {
     // Snippet: Explain(ExplainRequest, CallSettings)
     // Create client
     PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create();
     // Initialize request argument(s)
     ExplainRequest request = new ExplainRequest
     {
         EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
         Instances               = { new Value(), },
         DeployedModelId         = "",
         Parameters              = new Value(),
         ExplanationSpecOverride = new ExplanationSpecOverride(),
     };
     // Make the request
     ExplainResponse response = predictionServiceClient.Explain(request);
     // End snippet
 }
Exemple #21
0
        public async stt::Task GetEndpointRequestObjectAsync()
        {
            moq::Mock <IDS.IDSClient> mockGrpcClient = new moq::Mock <IDS.IDSClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetEndpointRequest request = new GetEndpointRequest
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
            };
            Endpoint expectedResponse = new Endpoint
            {
                EndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                CreateTime   = new wkt::Timestamp(),
                UpdateTime   = new wkt::Timestamp(),
                Labels       =
                {
                    {
                        "key8a0b6e3c",
                        "value60c16320"
                    },
                },
                Network = "networkd22ce091",
                EndpointForwardingRule = "endpoint_forwarding_ruleac397159",
                EndpointIp             = "endpoint_ip2239df0a",
                Description            = "description2cf9da67",
                Severity    = Endpoint.Types.Severity.Unspecified,
                State       = Endpoint.Types.State.Ready,
                TrafficLogs = true,
            };

            mockGrpcClient.Setup(x => x.GetEndpointAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Endpoint>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            IDSClient client = new IDSClientImpl(mockGrpcClient.Object, null);
            Endpoint  responseCallSettings = await client.GetEndpointAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Endpoint responseCancellationToken = await client.GetEndpointAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void RawPredictResourceNames()
        {
            moq::Mock <PredictionService.PredictionServiceClient> mockGrpcClient = new moq::Mock <PredictionService.PredictionServiceClient>(moq::MockBehavior.Strict);
            RawPredictRequest request = new RawPredictRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                HttpBody = new ga::HttpBody(),
            };
            ga::HttpBody expectedResponse = new ga::HttpBody
            {
                ContentType = "content_type085be0ea",
                Data        = proto::ByteString.CopyFromUtf8("data387f778d"),
                Extensions  = { new wkt::Any(), },
            };

            mockGrpcClient.Setup(x => x.RawPredict(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PredictionServiceClient client   = new PredictionServiceClientImpl(mockGrpcClient.Object, null);
            ga::HttpBody            response = client.RawPredict(request.EndpointAsEndpointName, request.HttpBody);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void Predict()
        {
            moq::Mock <PredictionService.PredictionServiceClient> mockGrpcClient = new moq::Mock <PredictionService.PredictionServiceClient>(moq::MockBehavior.Strict);
            PredictRequest request = new PredictRequest
            {
                EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"),
                Instances  = { new wkt::Value(), },
                Parameters = new wkt::Value(),
            };
            PredictResponse expectedResponse = new PredictResponse
            {
                Predictions      = { new wkt::Value(), },
                DeployedModelId  = "deployed_model_idf0bd41af",
                ModelAsModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
                ModelDisplayName = "model_display_name8ef9ce34",
            };

            mockGrpcClient.Setup(x => x.Predict(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PredictionServiceClient client   = new PredictionServiceClientImpl(mockGrpcClient.Object, null);
            PredictResponse         response = client.Predict(request.Endpoint, request.Instances, request.Parameters);

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