private Amazon.CloudFront.Model.UpdateFieldLevelEncryptionProfileResponse CallAWSServiceOperation(IAmazonCloudFront client, Amazon.CloudFront.Model.UpdateFieldLevelEncryptionProfileRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudFront", "UpdateFieldLevelEncryptionProfile");
     try
     {
         #if DESKTOP
         return(client.UpdateFieldLevelEncryptionProfile(request));
         #elif CORECLR
         return(client.UpdateFieldLevelEncryptionProfileAsync(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.CloudFront.Model.UpdateFieldLevelEncryptionProfileRequest();


            // populate FieldLevelEncryptionProfileConfig
            var requestFieldLevelEncryptionProfileConfigIsNull = true;

            request.FieldLevelEncryptionProfileConfig = new Amazon.CloudFront.Model.FieldLevelEncryptionProfileConfig();
            System.String requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_CallerReference = null;
            if (cmdletContext.FieldLevelEncryptionProfileConfig_CallerReference != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_CallerReference = cmdletContext.FieldLevelEncryptionProfileConfig_CallerReference;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_CallerReference != null)
            {
                request.FieldLevelEncryptionProfileConfig.CallerReference = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_CallerReference;
                requestFieldLevelEncryptionProfileConfigIsNull            = false;
            }
            System.String requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Comment = null;
            if (cmdletContext.FieldLevelEncryptionProfileConfig_Comment != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Comment = cmdletContext.FieldLevelEncryptionProfileConfig_Comment;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Comment != null)
            {
                request.FieldLevelEncryptionProfileConfig.Comment = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Comment;
                requestFieldLevelEncryptionProfileConfigIsNull    = false;
            }
            System.String requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Name = null;
            if (cmdletContext.FieldLevelEncryptionProfileConfig_Name != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Name = cmdletContext.FieldLevelEncryptionProfileConfig_Name;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Name != null)
            {
                request.FieldLevelEncryptionProfileConfig.Name = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_Name;
                requestFieldLevelEncryptionProfileConfigIsNull = false;
            }
            Amazon.CloudFront.Model.EncryptionEntities requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities = null;

            // populate EncryptionEntities
            var requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntitiesIsNull = true;

            requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities = new Amazon.CloudFront.Model.EncryptionEntities();
            List <Amazon.CloudFront.Model.EncryptionEntity> requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Item = null;

            if (cmdletContext.EncryptionEntities_Item != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Item = cmdletContext.EncryptionEntities_Item;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Item != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities.Items = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Item;
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntitiesIsNull = false;
            }
            System.Int32?requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Quantity = null;
            if (cmdletContext.EncryptionEntities_Quantity != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Quantity = cmdletContext.EncryptionEntities_Quantity.Value;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Quantity != null)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities.Quantity = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities_encryptionEntities_Quantity.Value;
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntitiesIsNull    = false;
            }
            // determine if requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities should be set to null
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntitiesIsNull)
            {
                requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities = null;
            }
            if (requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities != null)
            {
                request.FieldLevelEncryptionProfileConfig.EncryptionEntities = requestFieldLevelEncryptionProfileConfig_fieldLevelEncryptionProfileConfig_EncryptionEntities;
                requestFieldLevelEncryptionProfileConfigIsNull = false;
            }
            // determine if request.FieldLevelEncryptionProfileConfig should be set to null
            if (requestFieldLevelEncryptionProfileConfigIsNull)
            {
                request.FieldLevelEncryptionProfileConfig = null;
            }
            if (cmdletContext.Id != null)
            {
                request.Id = cmdletContext.Id;
            }
            if (cmdletContext.IfMatch != null)
            {
                request.IfMatch = cmdletContext.IfMatch;
            }

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