Пример #1
0
        internal virtual DeleteFlowResponse DeleteFlow(DeleteFlowRequest request)
        {
            var marshaller   = DeleteFlowRequestMarshaller.Instance;
            var unmarshaller = DeleteFlowResponseUnmarshaller.Instance;

            return(Invoke <DeleteFlowRequest, DeleteFlowResponse>(request, marshaller, unmarshaller));
        }
Пример #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteFlow operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteFlow 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/mediaconnect-2018-11-14/DeleteFlow">REST API Reference for DeleteFlow Operation</seealso>
        public virtual Task <DeleteFlowResponse> DeleteFlowAsync(DeleteFlowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DeleteFlowRequestMarshaller.Instance;
            var unmarshaller = DeleteFlowResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteFlowRequest, DeleteFlowResponse>(request, marshaller,
                                                                       unmarshaller, cancellationToken));
        }
Пример #3
0
        public async Task <IActionResult> Produce(DeleteFlowRequest request)
        {
            var validatorActionResult = await _validationArrangement.Validate(request);

            var actionResult = await _operationArrangement.Process(request, validatorActionResult);

            return(actionResult);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteFlow operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteFlow 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/mediaconnect-2018-11-14/DeleteFlow">REST API Reference for DeleteFlow Operation</seealso>
        public virtual Task <DeleteFlowResponse> DeleteFlowAsync(DeleteFlowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteFlowRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteFlowResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteFlowResponse>(request, options, cancellationToken));
        }
        internal virtual DeleteFlowResponse DeleteFlow(DeleteFlowRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteFlowRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteFlowResponseUnmarshaller.Instance;

            return(Invoke <DeleteFlowResponse>(request, options));
        }
Пример #6
0
        public async Task <IActionResult> Delete([FromRoute] DeleteFlowFromRoute route,
                                                 [FromQuery] DeleteFlowFromQuery query,
                                                 [FromHeader] DeleteFlowFromHeader header)
        {
            var request = new DeleteFlowRequest(route, query, header);

            var result = await _apiResult.Produce(request);

            return(result);
        }
Пример #7
0
        public DeleteFlowCommand Map(DeleteFlowRequest request)
        {
            var id = new Guid(request.RouteId);

            var version = ToVersion(request.HeaderIfMatch);

            var result = new DeleteFlowCommand(id, version);

            return(result);
        }
Пример #8
0
        /// <summary>Snippet for DeleteFlow</summary>
        public void DeleteFlowRequestObject()
        {
            // Snippet: DeleteFlow(DeleteFlowRequest, CallSettings)
            // Create client
            FlowsClient flowsClient = FlowsClient.Create();
            // Initialize request argument(s)
            DeleteFlowRequest request = new DeleteFlowRequest
            {
                FlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                Force    = false,
            };

            // Make the request
            flowsClient.DeleteFlow(request);
            // End snippet
        }
        public void DeleteFlowResourceNames()
        {
            moq::Mock <Flows.FlowsClient> mockGrpcClient = new moq::Mock <Flows.FlowsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteFlowRequest request = new DeleteFlowRequest
            {
                FlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteFlow(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FlowsClient client = new FlowsClientImpl(mockGrpcClient.Object, null);

            client.DeleteFlow(request.FlowName);
            mockGrpcClient.VerifyAll();
        }
Пример #10
0
        /// <summary>Snippet for DeleteFlowAsync</summary>
        public async Task DeleteFlowRequestObjectAsync()
        {
            // Snippet: DeleteFlowAsync(DeleteFlowRequest, CallSettings)
            // Additional: DeleteFlowAsync(DeleteFlowRequest, CancellationToken)
            // Create client
            FlowsClient flowsClient = await FlowsClient.CreateAsync();

            // Initialize request argument(s)
            DeleteFlowRequest request = new DeleteFlowRequest
            {
                FlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
                Force    = false,
            };
            // Make the request
            await flowsClient.DeleteFlowAsync(request);

            // End snippet
        }
        public async stt::Task DeleteFlowResourceNamesAsync()
        {
            moq::Mock <Flows.FlowsClient> mockGrpcClient = new moq::Mock <Flows.FlowsClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            DeleteFlowRequest request = new DeleteFlowRequest
            {
                FlowName = FlowName.FromProjectLocationAgentFlow("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteFlowAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            FlowsClient client = new FlowsClientImpl(mockGrpcClient.Object, null);
            await client.DeleteFlowAsync(request.FlowName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteFlowAsync(request.FlowName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
        public async Task<IActionResult> Process(DeleteFlowRequest request, IValidatorActionResult validatorActionResult)
        {
            IActionResult actionResult;

            if (validatorActionResult.Result == null)
            {
                var call = _cqsMapper.Map(request);

                var result = await _mediator.Send(call);

                actionResult = result.IsFailure ? _apiResponse.Fail(result)
                                                : _apiResponse.Deleted();
            }
            else
            {
                actionResult = validatorActionResult.Result;
            }

            return actionResult;
        }
Пример #13
0
 /// <summary>
 /// Remove a message flow
 /// </summary>
 /// <returns> DeleteFlowResponse object</returns>
 /// <param name="request">DeleteFlowRequest object</param>
 /// <param name='jsonRpcCallId'>
 /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages.
 /// 
 /// You should use a different JSON-RPC id for every call you make.
 /// 
 /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery).
 /// </param>
 public DeleteFlowResponse DeleteFlow(DeleteFlowRequest request, string jsonRpcCallId)
 {
     DeleteFlowResponse result = new DeleteFlowResponse();
     WireRequest(0, jsonRpcCallId, "system.delete_flow", (writer) =>
         {
             request.Write(writer, false);
         }, (reader) =>
         {
             result.Read(reader);
         }
     );
     return result;
 }
Пример #14
0
 /// <summary>
 /// Remove a message flow
 /// </summary>
 /// <returns> DeleteFlowResponse object</returns>
 /// <param name="request">DeleteFlowRequest object</param>
 public DeleteFlowResponse DeleteFlow(DeleteFlowRequest request)
 {
     return DeleteFlow(request, Guid.NewGuid().ToString());
 }