コード例 #1
0
        public void BatchUndeleteAlertsRequestObject()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    =
                {
                    "alert_idc6c58cd5",
                },
            };
            BatchUndeleteAlertsResponse expectedResponse = new BatchUndeleteAlertsResponse
            {
                SuccessAlertIds =
                {
                    "success_alert_ids0aeac317",
                },
                FailedAlertStatus =
                {
                    {
                        "key8a0b6e3c",
                        new gr::Status()
                    },
                },
            };

            mockGrpcClient.Setup(x => x.BatchUndeleteAlerts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AlertCenterServiceClient    client   = new AlertCenterServiceClientImpl(mockGrpcClient.Object, null);
            BatchUndeleteAlertsResponse response = client.BatchUndeleteAlerts(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for BatchUndeleteAlerts</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void BatchUndeleteAlertsRequestObject()
 {
     // Create client
     AlertCenterServiceClient alertCenterServiceClient = AlertCenterServiceClient.Create();
     // Initialize request argument(s)
     BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
     {
         CustomerId = "",
         AlertId    = { "", },
     };
     // Make the request
     BatchUndeleteAlertsResponse response = alertCenterServiceClient.BatchUndeleteAlerts(request);
 }
コード例 #3
0
        /// <summary>Snippet for BatchUndeleteAlertsAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task BatchUndeleteAlertsRequestObjectAsync()
        {
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
            {
                CustomerId = "",
                AlertId    = { "", },
            };
            // Make the request
            BatchUndeleteAlertsResponse response = await alertCenterServiceClient.BatchUndeleteAlertsAsync(request);
        }
        /// <summary>Snippet for BatchUndeleteAlertsAsync</summary>
        public async Task BatchUndeleteAlertsRequestObjectAsync()
        {
            // Snippet: BatchUndeleteAlertsAsync(BatchUndeleteAlertsRequest, CallSettings)
            // Additional: BatchUndeleteAlertsAsync(BatchUndeleteAlertsRequest, CancellationToken)
            // Create client
            AlertCenterServiceClient alertCenterServiceClient = await AlertCenterServiceClient.CreateAsync();

            // Initialize request argument(s)
            BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
            {
                CustomerId = "",
                AlertId    = { "", },
            };
            // Make the request
            BatchUndeleteAlertsResponse response = await alertCenterServiceClient.BatchUndeleteAlertsAsync(request);

            // End snippet
        }
コード例 #5
0
        public async stt::Task BatchUndeleteAlertsRequestObjectAsync()
        {
            moq::Mock <AlertCenterService.AlertCenterServiceClient> mockGrpcClient = new moq::Mock <AlertCenterService.AlertCenterServiceClient>(moq::MockBehavior.Strict);
            BatchUndeleteAlertsRequest request = new BatchUndeleteAlertsRequest
            {
                CustomerId = "customer_id3b3724cb",
                AlertId    =
                {
                    "alert_idc6c58cd5",
                },
            };
            BatchUndeleteAlertsResponse expectedResponse = new BatchUndeleteAlertsResponse
            {
                SuccessAlertIds =
                {
                    "success_alert_ids0aeac317",
                },
                FailedAlertStatus =
                {
                    {
                        "key8a0b6e3c",
                        new gr::Status()
                    },
                },
            };

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

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

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