Container for the parameters to the UpdateApplication operation. Updates an existing Kinesis Analytics application. Using this API, you can update application code, input configuration, and output configuration.

Note that Kinesis Analytics updates the CurrentApplicationVersionId each time you update your application.

This opeation requires permission for the kinesisanalytics:UpdateApplication action.

Inheritance: AmazonKinesisAnalyticsRequest
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateApplication operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateApplication operation on AmazonKinesisAnalyticsClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">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>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateApplication
        ///         operation.</returns>
        public IAsyncResult BeginUpdateApplication(UpdateApplicationRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateApplicationRequestMarshaller();
            var unmarshaller = UpdateApplicationResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateApplicationRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Updates an existing Kinesis Analytics application. Using this API, you can update
        /// application code, input configuration, and output configuration. 
        /// 
        ///  
        /// <para>
        /// Note that Kinesis Analytics updates the <code>CurrentApplicationVersionId</code> each
        /// time you update your application. 
        /// </para>
        ///  
        /// <para>
        /// This opeation requires permission for the <code>kinesisanalytics:UpdateApplication</code>
        /// action.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateApplication service method.</param>
        /// 
        /// <returns>The response from the UpdateApplication service method, as returned by KinesisAnalytics.</returns>
        /// <exception cref="Amazon.KinesisAnalytics.Model.CodeValidationException">
        /// User-provided application code (query) is invalid. This can be a simple syntax error.
        /// </exception>
        /// <exception cref="Amazon.KinesisAnalytics.Model.ConcurrentModificationException">
        /// Exception thrown as a result of concurrent modification to an application. For example,
        /// two individuals attempting to edit the same application at the same time.
        /// </exception>
        /// <exception cref="Amazon.KinesisAnalytics.Model.InvalidArgumentException">
        /// Specified input parameter value is invalid.
        /// </exception>
        /// <exception cref="Amazon.KinesisAnalytics.Model.ResourceInUseException">
        /// Application is not available for this operation.
        /// </exception>
        /// <exception cref="Amazon.KinesisAnalytics.Model.ResourceNotFoundException">
        /// Specified application can't be found.
        /// </exception>
        public UpdateApplicationResponse UpdateApplication(UpdateApplicationRequest request)
        {
            var marshaller = new UpdateApplicationRequestMarshaller();
            var unmarshaller = UpdateApplicationResponseUnmarshaller.Instance;

            return Invoke<UpdateApplicationRequest,UpdateApplicationResponse>(request, marshaller, unmarshaller);
        }
 private Amazon.KinesisAnalytics.Model.UpdateApplicationResponse CallAWSServiceOperation(IAmazonKinesisAnalytics client, Amazon.KinesisAnalytics.Model.UpdateApplicationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis Analytics", "UpdateApplication");
     try
     {
         #if DESKTOP
         return(client.UpdateApplication(request));
         #elif CORECLR
         return(client.UpdateApplicationAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateApplication operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateApplication 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<UpdateApplicationResponse> UpdateApplicationAsync(UpdateApplicationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateApplicationRequestMarshaller();
            var unmarshaller = UpdateApplicationResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateApplicationRequest,UpdateApplicationResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.KinesisAnalytics.Model.UpdateApplicationRequest();

            if (cmdletContext.ApplicationName != null)
            {
                request.ApplicationName = cmdletContext.ApplicationName;
            }

            // populate ApplicationUpdate
            var requestApplicationUpdateIsNull = true;

            request.ApplicationUpdate = new Amazon.KinesisAnalytics.Model.ApplicationUpdate();
            System.String requestApplicationUpdate_applicationUpdate_ApplicationCodeUpdate = null;
            if (cmdletContext.ApplicationUpdate_ApplicationCodeUpdate != null)
            {
                requestApplicationUpdate_applicationUpdate_ApplicationCodeUpdate = cmdletContext.ApplicationUpdate_ApplicationCodeUpdate;
            }
            if (requestApplicationUpdate_applicationUpdate_ApplicationCodeUpdate != null)
            {
                request.ApplicationUpdate.ApplicationCodeUpdate = requestApplicationUpdate_applicationUpdate_ApplicationCodeUpdate;
                requestApplicationUpdateIsNull = false;
            }
            List <Amazon.KinesisAnalytics.Model.CloudWatchLoggingOptionUpdate> requestApplicationUpdate_applicationUpdate_CloudWatchLoggingOptionUpdate = null;

            if (cmdletContext.ApplicationUpdate_CloudWatchLoggingOptionUpdate != null)
            {
                requestApplicationUpdate_applicationUpdate_CloudWatchLoggingOptionUpdate = cmdletContext.ApplicationUpdate_CloudWatchLoggingOptionUpdate;
            }
            if (requestApplicationUpdate_applicationUpdate_CloudWatchLoggingOptionUpdate != null)
            {
                request.ApplicationUpdate.CloudWatchLoggingOptionUpdates = requestApplicationUpdate_applicationUpdate_CloudWatchLoggingOptionUpdate;
                requestApplicationUpdateIsNull = false;
            }
            List <Amazon.KinesisAnalytics.Model.InputUpdate> requestApplicationUpdate_applicationUpdate_InputUpdate = null;

            if (cmdletContext.ApplicationUpdate_InputUpdate != null)
            {
                requestApplicationUpdate_applicationUpdate_InputUpdate = cmdletContext.ApplicationUpdate_InputUpdate;
            }
            if (requestApplicationUpdate_applicationUpdate_InputUpdate != null)
            {
                request.ApplicationUpdate.InputUpdates = requestApplicationUpdate_applicationUpdate_InputUpdate;
                requestApplicationUpdateIsNull         = false;
            }
            List <Amazon.KinesisAnalytics.Model.OutputUpdate> requestApplicationUpdate_applicationUpdate_OutputUpdate = null;

            if (cmdletContext.ApplicationUpdate_OutputUpdate != null)
            {
                requestApplicationUpdate_applicationUpdate_OutputUpdate = cmdletContext.ApplicationUpdate_OutputUpdate;
            }
            if (requestApplicationUpdate_applicationUpdate_OutputUpdate != null)
            {
                request.ApplicationUpdate.OutputUpdates = requestApplicationUpdate_applicationUpdate_OutputUpdate;
                requestApplicationUpdateIsNull          = false;
            }
            List <Amazon.KinesisAnalytics.Model.ReferenceDataSourceUpdate> requestApplicationUpdate_applicationUpdate_ReferenceDataSourceUpdate = null;

            if (cmdletContext.ApplicationUpdate_ReferenceDataSourceUpdate != null)
            {
                requestApplicationUpdate_applicationUpdate_ReferenceDataSourceUpdate = cmdletContext.ApplicationUpdate_ReferenceDataSourceUpdate;
            }
            if (requestApplicationUpdate_applicationUpdate_ReferenceDataSourceUpdate != null)
            {
                request.ApplicationUpdate.ReferenceDataSourceUpdates = requestApplicationUpdate_applicationUpdate_ReferenceDataSourceUpdate;
                requestApplicationUpdateIsNull = false;
            }
            // determine if request.ApplicationUpdate should be set to null
            if (requestApplicationUpdateIsNull)
            {
                request.ApplicationUpdate = null;
            }
            if (cmdletContext.CurrentApplicationVersionId != null)
            {
                request.CurrentApplicationVersionId = cmdletContext.CurrentApplicationVersionId.Value;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }