Exemple #1
0
 private Amazon.NimbleStudio.Model.UpdateStudioComponentResponse CallAWSServiceOperation(IAmazonNimbleStudio client, Amazon.NimbleStudio.Model.UpdateStudioComponentRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Nimble Studio", "UpdateStudioComponent");
     try
     {
         #if DESKTOP
         return(client.UpdateStudioComponent(request));
         #elif CORECLR
         return(client.UpdateStudioComponentAsync(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;
     }
 }
Exemple #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.NimbleStudio.Model.UpdateStudioComponentRequest();

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

            // populate Configuration
            var requestConfigurationIsNull = true;

            request.Configuration = new Amazon.NimbleStudio.Model.StudioComponentConfiguration();
            Amazon.NimbleStudio.Model.LicenseServiceConfiguration requestConfiguration_configuration_LicenseServiceConfiguration = null;

            // populate LicenseServiceConfiguration
            var requestConfiguration_configuration_LicenseServiceConfigurationIsNull = true;

            requestConfiguration_configuration_LicenseServiceConfiguration = new Amazon.NimbleStudio.Model.LicenseServiceConfiguration();
            System.String requestConfiguration_configuration_LicenseServiceConfiguration_licenseServiceConfiguration_Endpoint = null;
            if (cmdletContext.LicenseServiceConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_LicenseServiceConfiguration_licenseServiceConfiguration_Endpoint = cmdletContext.LicenseServiceConfiguration_Endpoint;
            }
            if (requestConfiguration_configuration_LicenseServiceConfiguration_licenseServiceConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_LicenseServiceConfiguration.Endpoint = requestConfiguration_configuration_LicenseServiceConfiguration_licenseServiceConfiguration_Endpoint;
                requestConfiguration_configuration_LicenseServiceConfigurationIsNull    = false;
            }
            // determine if requestConfiguration_configuration_LicenseServiceConfiguration should be set to null
            if (requestConfiguration_configuration_LicenseServiceConfigurationIsNull)
            {
                requestConfiguration_configuration_LicenseServiceConfiguration = null;
            }
            if (requestConfiguration_configuration_LicenseServiceConfiguration != null)
            {
                request.Configuration.LicenseServiceConfiguration = requestConfiguration_configuration_LicenseServiceConfiguration;
                requestConfigurationIsNull = false;
            }
            Amazon.NimbleStudio.Model.ComputeFarmConfiguration requestConfiguration_configuration_ComputeFarmConfiguration = null;

            // populate ComputeFarmConfiguration
            var requestConfiguration_configuration_ComputeFarmConfigurationIsNull = true;

            requestConfiguration_configuration_ComputeFarmConfiguration = new Amazon.NimbleStudio.Model.ComputeFarmConfiguration();
            System.String requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_ActiveDirectoryUser = null;
            if (cmdletContext.ComputeFarmConfiguration_ActiveDirectoryUser != null)
            {
                requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_ActiveDirectoryUser = cmdletContext.ComputeFarmConfiguration_ActiveDirectoryUser;
            }
            if (requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_ActiveDirectoryUser != null)
            {
                requestConfiguration_configuration_ComputeFarmConfiguration.ActiveDirectoryUser = requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_ActiveDirectoryUser;
                requestConfiguration_configuration_ComputeFarmConfigurationIsNull = false;
            }
            System.String requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_Endpoint = null;
            if (cmdletContext.ComputeFarmConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_Endpoint = cmdletContext.ComputeFarmConfiguration_Endpoint;
            }
            if (requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_ComputeFarmConfiguration.Endpoint = requestConfiguration_configuration_ComputeFarmConfiguration_computeFarmConfiguration_Endpoint;
                requestConfiguration_configuration_ComputeFarmConfigurationIsNull    = false;
            }
            // determine if requestConfiguration_configuration_ComputeFarmConfiguration should be set to null
            if (requestConfiguration_configuration_ComputeFarmConfigurationIsNull)
            {
                requestConfiguration_configuration_ComputeFarmConfiguration = null;
            }
            if (requestConfiguration_configuration_ComputeFarmConfiguration != null)
            {
                request.Configuration.ComputeFarmConfiguration = requestConfiguration_configuration_ComputeFarmConfiguration;
                requestConfigurationIsNull = false;
            }
            Amazon.NimbleStudio.Model.ActiveDirectoryConfiguration requestConfiguration_configuration_ActiveDirectoryConfiguration = null;

            // populate ActiveDirectoryConfiguration
            var requestConfiguration_configuration_ActiveDirectoryConfigurationIsNull = true;

            requestConfiguration_configuration_ActiveDirectoryConfiguration = new Amazon.NimbleStudio.Model.ActiveDirectoryConfiguration();
            List <Amazon.NimbleStudio.Model.ActiveDirectoryComputerAttribute> requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_ComputerAttribute = null;

            if (cmdletContext.ActiveDirectoryConfiguration_ComputerAttribute != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_ComputerAttribute = cmdletContext.ActiveDirectoryConfiguration_ComputerAttribute;
            }
            if (requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_ComputerAttribute != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration.ComputerAttributes = requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_ComputerAttribute;
                requestConfiguration_configuration_ActiveDirectoryConfigurationIsNull = false;
            }
            System.String requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_DirectoryId = null;
            if (cmdletContext.ActiveDirectoryConfiguration_DirectoryId != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_DirectoryId = cmdletContext.ActiveDirectoryConfiguration_DirectoryId;
            }
            if (requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_DirectoryId != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration.DirectoryId = requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_DirectoryId;
                requestConfiguration_configuration_ActiveDirectoryConfigurationIsNull       = false;
            }
            System.String requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_OrganizationalUnitDistinguishedName = null;
            if (cmdletContext.ActiveDirectoryConfiguration_OrganizationalUnitDistinguishedName != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_OrganizationalUnitDistinguishedName = cmdletContext.ActiveDirectoryConfiguration_OrganizationalUnitDistinguishedName;
            }
            if (requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_OrganizationalUnitDistinguishedName != null)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration.OrganizationalUnitDistinguishedName = requestConfiguration_configuration_ActiveDirectoryConfiguration_activeDirectoryConfiguration_OrganizationalUnitDistinguishedName;
                requestConfiguration_configuration_ActiveDirectoryConfigurationIsNull = false;
            }
            // determine if requestConfiguration_configuration_ActiveDirectoryConfiguration should be set to null
            if (requestConfiguration_configuration_ActiveDirectoryConfigurationIsNull)
            {
                requestConfiguration_configuration_ActiveDirectoryConfiguration = null;
            }
            if (requestConfiguration_configuration_ActiveDirectoryConfiguration != null)
            {
                request.Configuration.ActiveDirectoryConfiguration = requestConfiguration_configuration_ActiveDirectoryConfiguration;
                requestConfigurationIsNull = false;
            }
            Amazon.NimbleStudio.Model.SharedFileSystemConfiguration requestConfiguration_configuration_SharedFileSystemConfiguration = null;

            // populate SharedFileSystemConfiguration
            var requestConfiguration_configuration_SharedFileSystemConfigurationIsNull = true;

            requestConfiguration_configuration_SharedFileSystemConfiguration = new Amazon.NimbleStudio.Model.SharedFileSystemConfiguration();
            System.String requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_Endpoint = null;
            if (cmdletContext.SharedFileSystemConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_Endpoint = cmdletContext.SharedFileSystemConfiguration_Endpoint;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_Endpoint != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration.Endpoint = requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_Endpoint;
                requestConfiguration_configuration_SharedFileSystemConfigurationIsNull    = false;
            }
            System.String requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_FileSystemId = null;
            if (cmdletContext.SharedFileSystemConfiguration_FileSystemId != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_FileSystemId = cmdletContext.SharedFileSystemConfiguration_FileSystemId;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_FileSystemId != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration.FileSystemId = requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_FileSystemId;
                requestConfiguration_configuration_SharedFileSystemConfigurationIsNull        = false;
            }
            System.String requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_LinuxMountPoint = null;
            if (cmdletContext.SharedFileSystemConfiguration_LinuxMountPoint != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_LinuxMountPoint = cmdletContext.SharedFileSystemConfiguration_LinuxMountPoint;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_LinuxMountPoint != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration.LinuxMountPoint = requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_LinuxMountPoint;
                requestConfiguration_configuration_SharedFileSystemConfigurationIsNull           = false;
            }
            System.String requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_ShareName = null;
            if (cmdletContext.SharedFileSystemConfiguration_ShareName != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_ShareName = cmdletContext.SharedFileSystemConfiguration_ShareName;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_ShareName != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration.ShareName = requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_ShareName;
                requestConfiguration_configuration_SharedFileSystemConfigurationIsNull     = false;
            }
            System.String requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_WindowsMountDrive = null;
            if (cmdletContext.SharedFileSystemConfiguration_WindowsMountDrive != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_WindowsMountDrive = cmdletContext.SharedFileSystemConfiguration_WindowsMountDrive;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_WindowsMountDrive != null)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration.WindowsMountDrive = requestConfiguration_configuration_SharedFileSystemConfiguration_sharedFileSystemConfiguration_WindowsMountDrive;
                requestConfiguration_configuration_SharedFileSystemConfigurationIsNull             = false;
            }
            // determine if requestConfiguration_configuration_SharedFileSystemConfiguration should be set to null
            if (requestConfiguration_configuration_SharedFileSystemConfigurationIsNull)
            {
                requestConfiguration_configuration_SharedFileSystemConfiguration = null;
            }
            if (requestConfiguration_configuration_SharedFileSystemConfiguration != null)
            {
                request.Configuration.SharedFileSystemConfiguration = requestConfiguration_configuration_SharedFileSystemConfiguration;
                requestConfigurationIsNull = false;
            }
            // determine if request.Configuration should be set to null
            if (requestConfigurationIsNull)
            {
                request.Configuration = null;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Ec2SecurityGroupId != null)
            {
                request.Ec2SecurityGroupIds = cmdletContext.Ec2SecurityGroupId;
            }
            if (cmdletContext.InitializationScript != null)
            {
                request.InitializationScripts = cmdletContext.InitializationScript;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.ScriptParameter != null)
            {
                request.ScriptParameters = cmdletContext.ScriptParameter;
            }
            if (cmdletContext.StudioComponentId != null)
            {
                request.StudioComponentId = cmdletContext.StudioComponentId;
            }
            if (cmdletContext.StudioId != null)
            {
                request.StudioId = cmdletContext.StudioId;
            }
            if (cmdletContext.Subtype != null)
            {
                request.Subtype = cmdletContext.Subtype;
            }
            if (cmdletContext.Type != null)
            {
                request.Type = cmdletContext.Type;
            }

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