Exemplo n.º 1
0
        internal virtual DeleteNotificationChannelResponse DeleteNotificationChannel(DeleteNotificationChannelRequest request)
        {
            var marshaller   = DeleteNotificationChannelRequestMarshaller.Instance;
            var unmarshaller = DeleteNotificationChannelResponseUnmarshaller.Instance;

            return(Invoke <DeleteNotificationChannelRequest, DeleteNotificationChannelResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 2
0
        internal virtual DeleteNotificationChannelResponse DeleteNotificationChannel(DeleteNotificationChannelRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteNotificationChannelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteNotificationChannelResponseUnmarshaller.Instance;

            return(Invoke <DeleteNotificationChannelResponse>(request, options));
        }
Exemplo n.º 3
0
        /// <summary>Snippet for DeleteNotificationChannel</summary>
        public void DeleteNotificationChannel_RequestObject()
        {
            // Snippet: DeleteNotificationChannel(DeleteNotificationChannelRequest,CallSettings)
            // Create client
            NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
            // Initialize request argument(s)
            DeleteNotificationChannelRequest request = new DeleteNotificationChannelRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };

            // Make the request
            notificationChannelServiceClient.DeleteNotificationChannel(request);
            // End snippet
        }
        public async Task DeleteNotificationChannelAsync2()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            DeleteNotificationChannelRequest request = new DeleteNotificationChannelRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteNotificationChannelAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteNotificationChannelAsync(request);

            mockGrpcClient.VerifyAll();
        }
        public void DeleteNotificationChannel2()
        {
            Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict);
            DeleteNotificationChannelRequest request = new DeleteNotificationChannelRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteNotificationChannel(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteNotificationChannel(request);
            mockGrpcClient.VerifyAll();
        }
Exemplo n.º 6
0
        /// <summary>Snippet for DeleteNotificationChannelAsync</summary>
        public async Task DeleteNotificationChannelAsync_RequestObject()
        {
            // Snippet: DeleteNotificationChannelAsync(DeleteNotificationChannelRequest,CallSettings)
            // Additional: DeleteNotificationChannelAsync(DeleteNotificationChannelRequest,CancellationToken)
            // Create client
            NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteNotificationChannelRequest request = new DeleteNotificationChannelRequest
            {
                NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"),
            };
            // Make the request
            await notificationChannelServiceClient.DeleteNotificationChannelAsync(request);

            // End snippet
        }
Exemplo n.º 7
0
        public async Task <DeleteNotificationChannelResponse> DeleteAsync(DeleteNotificationChannelRequest request)
        {
            await _notificationChannelsRepository.DeleteAsync(request.Id);

            return(new DeleteNotificationChannelResponse());
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteNotificationChannel operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteNotificationChannel operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/DeleteNotificationChannel">REST API Reference for DeleteNotificationChannel Operation</seealso>
        public virtual Task <DeleteNotificationChannelResponse> DeleteNotificationChannelAsync(DeleteNotificationChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DeleteNotificationChannelRequestMarshaller.Instance;
            var unmarshaller = DeleteNotificationChannelResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteNotificationChannelRequest, DeleteNotificationChannelResponse>(request, marshaller,
                                                                                                     unmarshaller, cancellationToken));
        }