Beispiel #1
0
        internal GetCommitResponse GetCommit(GetCommitRequest request)
        {
            var marshaller   = new GetCommitRequestMarshaller();
            var unmarshaller = GetCommitResponseUnmarshaller.Instance;

            return(Invoke <GetCommitRequest, GetCommitResponse>(request, marshaller, unmarshaller));
        }
Beispiel #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetCommit operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetCommit 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 <GetCommitResponse> GetCommitAsync(GetCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new GetCommitRequestMarshaller();
            var unmarshaller = GetCommitResponseUnmarshaller.Instance;

            return(InvokeAsync <GetCommitRequest, GetCommitResponse>(request, marshaller,
                                                                     unmarshaller, cancellationToken));
        }
        /// <summary>
        /// gets the commit information
        /// </summary>
        /// <param name="codeCommit"></param>
        /// <param name="repositoryName"></param>
        /// <param name="commitId"></param>
        /// <returns></returns>
        private GetCommitResponse GetCommitInfo(AmazonCodeCommitClient codeCommit, string repositoryName, string commitId)
        {
            GetCommitRequest commitRequest = new GetCommitRequest()
            {
                RepositoryName = repositoryName,
                CommitId       = commitId
            };
            GetCommitResponse returnValue = codeCommit.GetCommitAsync(commitRequest).GetAwaiter().GetResult();

            return(returnValue);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetCommitRequest request;

            try
            {
                request = new GetCommitRequest
                {
                    RepositoryId = RepositoryId,
                    CommitId     = CommitId,
                    OpcRequestId = OpcRequestId
                };

                response = client.GetCommit(request).GetAwaiter().GetResult();
                WriteOutput(response, response.RepositoryCommit);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }