예제 #1
0
        internal GetEventSourceMappingResponse GetEventSourceMapping(GetEventSourceMappingRequest request)
        {
            var marshaller   = new GetEventSourceMappingRequestMarshaller();
            var unmarshaller = GetEventSourceMappingResponseUnmarshaller.Instance;

            return(Invoke <GetEventSourceMappingRequest, GetEventSourceMappingResponse>(request, marshaller, unmarshaller));
        }
예제 #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetEventSourceMapping operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetEventSourceMapping 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>
        public Task <GetEventSourceMappingResponse> GetEventSourceMappingAsync(GetEventSourceMappingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetEventSourceMappingRequestMarshaller();
            var unmarshaller = GetEventSourceMappingResponseUnmarshaller.Instance;

            return(InvokeAsync <GetEventSourceMappingRequest, GetEventSourceMappingResponse>(request, marshaller,
                                                                                             unmarshaller, cancellationToken));
        }
예제 #3
0
 //Unfinished
 public void SetEventTrigger()
 {
     var lstLambdaFuncs = client.ListFunctions();
     var request        = new GetEventSourceMappingRequest()
     {
     };
     var policy = client.GetEventSourceMapping(request);
 }
예제 #4
0
파일: Lambda.cs 프로젝트: AselaDK/Activator
        public static string CreateEventSourceMapping(string eventSourceArn)
        {
            string uuid = "";

            try
            {
                AmazonLambdaClient lambdaClient;

                using (lambdaClient = new AmazonLambdaClient(Models.MyAWSConfigs.KinesisRegion))
                {
                    CreateEventSourceMappingRequest eventSourceMappingRequest = new CreateEventSourceMappingRequest
                    {
                        EventSourceArn = eventSourceArn,
                        BatchSize      = 100,
                        MaximumBatchingWindowInSeconds = 0,
                        StartingPosition = EventSourcePosition.LATEST,
                        Enabled          = true,
                        FunctionName     = MyAWSConfigs.LambdaFunctionName,
                    };
                    CreateEventSourceMappingResponse eventSourceMappingResponse = lambdaClient.CreateEventSourceMapping(eventSourceMappingRequest);

                    uuid = eventSourceMappingResponse.UUID;

                    string state = eventSourceMappingResponse.State;
                    while (state != "Enabled")
                    {
                        Thread.Sleep(1 * 1000);

                        GetEventSourceMappingRequest getRequest = new GetEventSourceMappingRequest
                        {
                            UUID = uuid,
                        };
                        GetEventSourceMappingResponse getResponse = lambdaClient.GetEventSourceMapping(getRequest);

                        state = getResponse.State;
                    }
                }
            }
            catch (AmazonLambdaException e)
            {
                Console.WriteLine("AmazonLambdaException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(uuid);
        }
예제 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetEventSourceMapping operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetEventSourceMapping operation on AmazonLambdaClient.</param>
        /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
        /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        public void GetEventSourceMappingAsync(GetEventSourceMappingRequest request, AmazonServiceCallback <GetEventSourceMappingRequest, GetEventSourceMappingResponse> callback, AsyncOptions options = null)
        {
            options = options == null?new AsyncOptions():options;
            var marshaller   = new GetEventSourceMappingRequestMarshaller();
            var unmarshaller = GetEventSourceMappingResponseUnmarshaller.Instance;
            Action <AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;

            if (callback != null)
            {
                callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => {
                    AmazonServiceResult <GetEventSourceMappingRequest, GetEventSourceMappingResponse> responseObject
                        = new AmazonServiceResult <GetEventSourceMappingRequest, GetEventSourceMappingResponse>((GetEventSourceMappingRequest)req, (GetEventSourceMappingResponse)res, ex, ao.State);
                    callback(responseObject);
                }
            }
            ;
            BeginInvoke <GetEventSourceMappingRequest>(request, marshaller, unmarshaller, options, callbackHelper);
        }
 public void GetEventSourceMappingAsync(GetEventSourceMappingRequest request, AmazonServiceCallback <GetEventSourceMappingRequest, GetEventSourceMappingResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }