internal virtual GetNotificationChannelResponse GetNotificationChannel(GetNotificationChannelRequest request) { var marshaller = GetNotificationChannelRequestMarshaller.Instance; var unmarshaller = GetNotificationChannelResponseUnmarshaller.Instance; return(Invoke <GetNotificationChannelRequest, GetNotificationChannelResponse>(request, marshaller, unmarshaller)); }
public async Task <GetNotificationChannelResponse> GetAsync(GetNotificationChannelRequest request) { var item = await _notificationChannelsRepository.GetAsync(request.Id); return(new GetNotificationChannelResponse { Item = item }); }
internal virtual GetNotificationChannelResponse GetNotificationChannel(GetNotificationChannelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetNotificationChannelRequestMarshaller.Instance; options.ResponseUnmarshaller = GetNotificationChannelResponseUnmarshaller.Instance; return(Invoke <GetNotificationChannelResponse>(request, options)); }
/// <summary>Snippet for GetNotificationChannel</summary> public void GetNotificationChannel_RequestObject() { // Snippet: GetNotificationChannel(GetNotificationChannelRequest,CallSettings) // Create client NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create(); // Initialize request argument(s) GetNotificationChannelRequest request = new GetNotificationChannelRequest { NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"), }; // Make the request NotificationChannel response = notificationChannelServiceClient.GetNotificationChannel(request); // End snippet }
/// <summary>Snippet for GetNotificationChannelAsync</summary> public async Task GetNotificationChannelAsync_RequestObject() { // Snippet: GetNotificationChannelAsync(GetNotificationChannelRequest,CallSettings) // Additional: GetNotificationChannelAsync(GetNotificationChannelRequest,CancellationToken) // Create client NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync(); // Initialize request argument(s) GetNotificationChannelRequest request = new GetNotificationChannelRequest { NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"), }; // Make the request NotificationChannel response = await notificationChannelServiceClient.GetNotificationChannelAsync(request); // End snippet }
public async Task GetNotificationChannelAsync2() { Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict); GetNotificationChannelRequest request = new GetNotificationChannelRequest { NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"), }; NotificationChannel expectedResponse = new NotificationChannel { Type = "type3575610", Name = "name2-1052831874", DisplayName = "displayName1615086568", Description = "description-1724546052", }; mockGrpcClient.Setup(x => x.GetNotificationChannelAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <NotificationChannel>(Task.FromResult(expectedResponse), null, null, null, null)); NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null); NotificationChannel response = await client.GetNotificationChannelAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetNotificationChannel() { Mock <NotificationChannelService.NotificationChannelServiceClient> mockGrpcClient = new Mock <NotificationChannelService.NotificationChannelServiceClient>(MockBehavior.Strict); GetNotificationChannelRequest expectedRequest = new GetNotificationChannelRequest { NotificationChannelName = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"), }; NotificationChannel expectedResponse = new NotificationChannel { Type = "type3575610", Name = "name2-1052831874", DisplayName = "displayName1615086568", Description = "description-1724546052", }; mockGrpcClient.Setup(x => x.GetNotificationChannel(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); NotificationChannelServiceClient client = new NotificationChannelServiceClientImpl(mockGrpcClient.Object, null); NotificationChannelName name = new NotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]"); NotificationChannel response = client.GetNotificationChannel(name); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Initiates the asynchronous execution of the GetNotificationChannel operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetNotificationChannel 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/GetNotificationChannel">REST API Reference for GetNotificationChannel Operation</seealso> public virtual Task <GetNotificationChannelResponse> GetNotificationChannelAsync(GetNotificationChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = GetNotificationChannelRequestMarshaller.Instance; var unmarshaller = GetNotificationChannelResponseUnmarshaller.Instance; return(InvokeAsync <GetNotificationChannelRequest, GetNotificationChannelResponse>(request, marshaller, unmarshaller, cancellationToken)); }