private Amazon.Shield.Model.EnableApplicationLayerAutomaticResponseResponse CallAWSServiceOperation(IAmazonShield client, Amazon.Shield.Model.EnableApplicationLayerAutomaticResponseRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Shield", "EnableApplicationLayerAutomaticResponse");
     try
     {
         #if DESKTOP
         return(client.EnableApplicationLayerAutomaticResponse(request));
         #elif CORECLR
         return(client.EnableApplicationLayerAutomaticResponseAsync(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;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Shield.Model.EnableApplicationLayerAutomaticResponseRequest();


            // populate Action
            var requestActionIsNull = true;

            request.Action = new Amazon.Shield.Model.ResponseAction();
            Amazon.Shield.Model.BlockAction requestAction_action_Block = null;
            if (cmdletContext.Action_Block != null)
            {
                requestAction_action_Block = cmdletContext.Action_Block;
            }
            if (requestAction_action_Block != null)
            {
                request.Action.Block = requestAction_action_Block;
                requestActionIsNull  = false;
            }
            Amazon.Shield.Model.CountAction requestAction_action_Count = null;
            if (cmdletContext.Action_Count != null)
            {
                requestAction_action_Count = cmdletContext.Action_Count;
            }
            if (requestAction_action_Count != null)
            {
                request.Action.Count = requestAction_action_Count;
                requestActionIsNull  = false;
            }
            // determine if request.Action should be set to null
            if (requestActionIsNull)
            {
                request.Action = null;
            }
            if (cmdletContext.ResourceArn != null)
            {
                request.ResourceArn = cmdletContext.ResourceArn;
            }

            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);
        }