private Amazon.WorkSpaces.Model.ModifyWorkspaceAccessPropertiesResponse CallAWSServiceOperation(IAmazonWorkSpaces client, Amazon.WorkSpaces.Model.ModifyWorkspaceAccessPropertiesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon WorkSpaces", "ModifyWorkspaceAccessProperties");
     try
     {
         #if DESKTOP
         return(client.ModifyWorkspaceAccessProperties(request));
         #elif CORECLR
         return(client.ModifyWorkspaceAccessPropertiesAsync(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.WorkSpaces.Model.ModifyWorkspaceAccessPropertiesRequest();

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

            // populate WorkspaceAccessProperties
            var requestWorkspaceAccessPropertiesIsNull = true;

            request.WorkspaceAccessProperties = new Amazon.WorkSpaces.Model.WorkspaceAccessProperties();
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeAndroid = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeAndroid != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeAndroid = cmdletContext.WorkspaceAccessProperties_DeviceTypeAndroid;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeAndroid != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeAndroid = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeAndroid;
                requestWorkspaceAccessPropertiesIsNull = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeChromeOs = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeChromeOs != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeChromeOs = cmdletContext.WorkspaceAccessProperties_DeviceTypeChromeOs;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeChromeOs != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeChromeOs = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeChromeOs;
                requestWorkspaceAccessPropertiesIsNull = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeIo = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeIo != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeIo = cmdletContext.WorkspaceAccessProperties_DeviceTypeIo;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeIo != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeIos = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeIo;
                requestWorkspaceAccessPropertiesIsNull          = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeOsx = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeOsx != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeOsx = cmdletContext.WorkspaceAccessProperties_DeviceTypeOsx;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeOsx != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeOsx = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeOsx;
                requestWorkspaceAccessPropertiesIsNull          = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWeb = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeWeb != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWeb = cmdletContext.WorkspaceAccessProperties_DeviceTypeWeb;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWeb != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeWeb = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWeb;
                requestWorkspaceAccessPropertiesIsNull          = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWindow = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeWindow != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWindow = cmdletContext.WorkspaceAccessProperties_DeviceTypeWindow;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWindow != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeWindows = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeWindow;
                requestWorkspaceAccessPropertiesIsNull = false;
            }
            Amazon.WorkSpaces.AccessPropertyValue requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeZeroClient = null;
            if (cmdletContext.WorkspaceAccessProperties_DeviceTypeZeroClient != null)
            {
                requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeZeroClient = cmdletContext.WorkspaceAccessProperties_DeviceTypeZeroClient;
            }
            if (requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeZeroClient != null)
            {
                request.WorkspaceAccessProperties.DeviceTypeZeroClient = requestWorkspaceAccessProperties_workspaceAccessProperties_DeviceTypeZeroClient;
                requestWorkspaceAccessPropertiesIsNull = false;
            }
            // determine if request.WorkspaceAccessProperties should be set to null
            if (requestWorkspaceAccessPropertiesIsNull)
            {
                request.WorkspaceAccessProperties = null;
            }

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