public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SageMaker.Model.CreateDomainRequest();

            if (cmdletContext.AuthMode != null)
            {
                request.AuthMode = cmdletContext.AuthMode;
            }
            if (cmdletContext.DefaultUserSetting != null)
            {
                request.DefaultUserSettings = cmdletContext.DefaultUserSetting;
            }
            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }
            if (cmdletContext.HomeEfsFileSystemKmsKeyId != null)
            {
                request.HomeEfsFileSystemKmsKeyId = cmdletContext.HomeEfsFileSystemKmsKeyId;
            }
            if (cmdletContext.SubnetId != null)
            {
                request.SubnetIds = cmdletContext.SubnetId;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.VpcId != null)
            {
                request.VpcId = cmdletContext.VpcId;
            }

            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);
        }
 private Amazon.SageMaker.Model.CreateDomainResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateDomainRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateDomain");
     try
     {
         #if DESKTOP
         return(client.CreateDomain(request));
         #elif CORECLR
         return(client.CreateDomainAsync(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.SageMaker.Model.CreateDomainRequest();

            if (cmdletContext.AppNetworkAccessType != null)
            {
                request.AppNetworkAccessType = cmdletContext.AppNetworkAccessType;
            }
            if (cmdletContext.AppSecurityGroupManagement != null)
            {
                request.AppSecurityGroupManagement = cmdletContext.AppSecurityGroupManagement;
            }
            if (cmdletContext.AuthMode != null)
            {
                request.AuthMode = cmdletContext.AuthMode;
            }
            if (cmdletContext.DefaultUserSetting != null)
            {
                request.DefaultUserSettings = cmdletContext.DefaultUserSetting;
            }
            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }

            // populate DomainSettings
            var requestDomainSettingsIsNull = true;

            request.DomainSettings = new Amazon.SageMaker.Model.DomainSettings();
            List <System.String> requestDomainSettings_domainSettings_SecurityGroupId = null;

            if (cmdletContext.DomainSettings_SecurityGroupId != null)
            {
                requestDomainSettings_domainSettings_SecurityGroupId = cmdletContext.DomainSettings_SecurityGroupId;
            }
            if (requestDomainSettings_domainSettings_SecurityGroupId != null)
            {
                request.DomainSettings.SecurityGroupIds = requestDomainSettings_domainSettings_SecurityGroupId;
                requestDomainSettingsIsNull             = false;
            }
            Amazon.SageMaker.Model.RStudioServerProDomainSettings requestDomainSettings_domainSettings_RStudioServerProDomainSettings = null;

            // populate RStudioServerProDomainSettings
            var requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull = true;

            requestDomainSettings_domainSettings_RStudioServerProDomainSettings = new Amazon.SageMaker.Model.RStudioServerProDomainSettings();
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_DomainExecutionRoleArn = null;
            if (cmdletContext.RStudioServerProDomainSettings_DomainExecutionRoleArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_DomainExecutionRoleArn = cmdletContext.RStudioServerProDomainSettings_DomainExecutionRoleArn;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_DomainExecutionRoleArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings.DomainExecutionRoleArn = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_DomainExecutionRoleArn;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull = false;
            }
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioConnectUrl = null;
            if (cmdletContext.RStudioServerProDomainSettings_RStudioConnectUrl != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioConnectUrl = cmdletContext.RStudioServerProDomainSettings_RStudioConnectUrl;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioConnectUrl != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings.RStudioConnectUrl = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioConnectUrl;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull             = false;
            }
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioPackageManagerUrl = null;
            if (cmdletContext.RStudioServerProDomainSettings_RStudioPackageManagerUrl != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioPackageManagerUrl = cmdletContext.RStudioServerProDomainSettings_RStudioPackageManagerUrl;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioPackageManagerUrl != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings.RStudioPackageManagerUrl = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_rStudioServerProDomainSettings_RStudioPackageManagerUrl;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull = false;
            }
            Amazon.SageMaker.Model.ResourceSpec requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec = null;

            // populate DefaultResourceSpec
            var requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull = true;

            requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec = new Amazon.SageMaker.Model.ResourceSpec();
            Amazon.SageMaker.AppInstanceType requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_InstanceType = null;
            if (cmdletContext.DefaultResourceSpec_InstanceType != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_InstanceType = cmdletContext.DefaultResourceSpec_InstanceType;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_InstanceType != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec.InstanceType = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_InstanceType;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull        = false;
            }
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_LifecycleConfigArn = null;
            if (cmdletContext.DefaultResourceSpec_LifecycleConfigArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_LifecycleConfigArn = cmdletContext.DefaultResourceSpec_LifecycleConfigArn;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_LifecycleConfigArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec.LifecycleConfigArn = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_LifecycleConfigArn;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull = false;
            }
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageArn = null;
            if (cmdletContext.DefaultResourceSpec_SageMakerImageArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageArn = cmdletContext.DefaultResourceSpec_SageMakerImageArn;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec.SageMakerImageArn = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageArn;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull             = false;
            }
            System.String requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageVersionArn = null;
            if (cmdletContext.DefaultResourceSpec_SageMakerImageVersionArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageVersionArn = cmdletContext.DefaultResourceSpec_SageMakerImageVersionArn;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageVersionArn != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec.SageMakerImageVersionArn = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec_defaultResourceSpec_SageMakerImageVersionArn;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull = false;
            }
            // determine if requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec should be set to null
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpecIsNull)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec = null;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec != null)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings.DefaultResourceSpec = requestDomainSettings_domainSettings_RStudioServerProDomainSettings_domainSettings_RStudioServerProDomainSettings_DefaultResourceSpec;
                requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull = false;
            }
            // determine if requestDomainSettings_domainSettings_RStudioServerProDomainSettings should be set to null
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettingsIsNull)
            {
                requestDomainSettings_domainSettings_RStudioServerProDomainSettings = null;
            }
            if (requestDomainSettings_domainSettings_RStudioServerProDomainSettings != null)
            {
                request.DomainSettings.RStudioServerProDomainSettings = requestDomainSettings_domainSettings_RStudioServerProDomainSettings;
                requestDomainSettingsIsNull = false;
            }
            // determine if request.DomainSettings should be set to null
            if (requestDomainSettingsIsNull)
            {
                request.DomainSettings = null;
            }
            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            if (cmdletContext.HomeEfsFileSystemKmsKeyId != null)
            {
                request.HomeEfsFileSystemKmsKeyId = cmdletContext.HomeEfsFileSystemKmsKeyId;
            }
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
            if (cmdletContext.KmsKeyId != null)
            {
                request.KmsKeyId = cmdletContext.KmsKeyId;
            }
            if (cmdletContext.SubnetId != null)
            {
                request.SubnetIds = cmdletContext.SubnetId;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.VpcId != null)
            {
                request.VpcId = cmdletContext.VpcId;
            }

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