private Amazon.ConnectWisdomService.Model.CreateKnowledgeBaseResponse CallAWSServiceOperation(IAmazonConnectWisdomService client, Amazon.ConnectWisdomService.Model.CreateKnowledgeBaseRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Wisdom Service", "CreateKnowledgeBase");
     try
     {
         #if DESKTOP
         return(client.CreateKnowledgeBase(request));
         #elif CORECLR
         return(client.CreateKnowledgeBaseAsync(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.ConnectWisdomService.Model.CreateKnowledgeBaseRequest();

            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.KnowledgeBaseType != null)
            {
                request.KnowledgeBaseType = cmdletContext.KnowledgeBaseType;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            // populate RenderingConfiguration
            var requestRenderingConfigurationIsNull = true;

            request.RenderingConfiguration = new Amazon.ConnectWisdomService.Model.RenderingConfiguration();
            System.String requestRenderingConfiguration_renderingConfiguration_TemplateUri = null;
            if (cmdletContext.RenderingConfiguration_TemplateUri != null)
            {
                requestRenderingConfiguration_renderingConfiguration_TemplateUri = cmdletContext.RenderingConfiguration_TemplateUri;
            }
            if (requestRenderingConfiguration_renderingConfiguration_TemplateUri != null)
            {
                request.RenderingConfiguration.TemplateUri = requestRenderingConfiguration_renderingConfiguration_TemplateUri;
                requestRenderingConfigurationIsNull        = false;
            }
            // determine if request.RenderingConfiguration should be set to null
            if (requestRenderingConfigurationIsNull)
            {
                request.RenderingConfiguration = null;
            }

            // populate ServerSideEncryptionConfiguration
            var requestServerSideEncryptionConfigurationIsNull = true;

            request.ServerSideEncryptionConfiguration = new Amazon.ConnectWisdomService.Model.ServerSideEncryptionConfiguration();
            System.String requestServerSideEncryptionConfiguration_serverSideEncryptionConfiguration_KmsKeyId = null;
            if (cmdletContext.ServerSideEncryptionConfiguration_KmsKeyId != null)
            {
                requestServerSideEncryptionConfiguration_serverSideEncryptionConfiguration_KmsKeyId = cmdletContext.ServerSideEncryptionConfiguration_KmsKeyId;
            }
            if (requestServerSideEncryptionConfiguration_serverSideEncryptionConfiguration_KmsKeyId != null)
            {
                request.ServerSideEncryptionConfiguration.KmsKeyId = requestServerSideEncryptionConfiguration_serverSideEncryptionConfiguration_KmsKeyId;
                requestServerSideEncryptionConfigurationIsNull     = false;
            }
            // determine if request.ServerSideEncryptionConfiguration should be set to null
            if (requestServerSideEncryptionConfigurationIsNull)
            {
                request.ServerSideEncryptionConfiguration = null;
            }

            // populate SourceConfiguration
            var requestSourceConfigurationIsNull = true;

            request.SourceConfiguration = new Amazon.ConnectWisdomService.Model.SourceConfiguration();
            Amazon.ConnectWisdomService.Model.AppIntegrationsConfiguration requestSourceConfiguration_sourceConfiguration_AppIntegrations = null;

            // populate AppIntegrations
            var requestSourceConfiguration_sourceConfiguration_AppIntegrationsIsNull = true;

            requestSourceConfiguration_sourceConfiguration_AppIntegrations = new Amazon.ConnectWisdomService.Model.AppIntegrationsConfiguration();
            System.String requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_AppIntegrationArn = null;
            if (cmdletContext.AppIntegrations_AppIntegrationArn != null)
            {
                requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_AppIntegrationArn = cmdletContext.AppIntegrations_AppIntegrationArn;
            }
            if (requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_AppIntegrationArn != null)
            {
                requestSourceConfiguration_sourceConfiguration_AppIntegrations.AppIntegrationArn = requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_AppIntegrationArn;
                requestSourceConfiguration_sourceConfiguration_AppIntegrationsIsNull             = false;
            }
            List <System.String> requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_ObjectField = null;

            if (cmdletContext.AppIntegrations_ObjectField != null)
            {
                requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_ObjectField = cmdletContext.AppIntegrations_ObjectField;
            }
            if (requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_ObjectField != null)
            {
                requestSourceConfiguration_sourceConfiguration_AppIntegrations.ObjectFields = requestSourceConfiguration_sourceConfiguration_AppIntegrations_appIntegrations_ObjectField;
                requestSourceConfiguration_sourceConfiguration_AppIntegrationsIsNull        = false;
            }
            // determine if requestSourceConfiguration_sourceConfiguration_AppIntegrations should be set to null
            if (requestSourceConfiguration_sourceConfiguration_AppIntegrationsIsNull)
            {
                requestSourceConfiguration_sourceConfiguration_AppIntegrations = null;
            }
            if (requestSourceConfiguration_sourceConfiguration_AppIntegrations != null)
            {
                request.SourceConfiguration.AppIntegrations = requestSourceConfiguration_sourceConfiguration_AppIntegrations;
                requestSourceConfigurationIsNull            = false;
            }
            // determine if request.SourceConfiguration should be set to null
            if (requestSourceConfigurationIsNull)
            {
                request.SourceConfiguration = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

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