public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WorkSpaces.Model.ModifyWorkspacePropertiesRequest(); if (cmdletContext.WorkspaceId != null) { request.WorkspaceId = cmdletContext.WorkspaceId; } // populate WorkspaceProperties var requestWorkspacePropertiesIsNull = true; request.WorkspaceProperties = new Amazon.WorkSpaces.Model.WorkspaceProperties(); Amazon.WorkSpaces.Compute requestWorkspaceProperties_workspaceProperties_ComputeTypeName = null; if (cmdletContext.WorkspaceProperties_ComputeTypeName != null) { requestWorkspaceProperties_workspaceProperties_ComputeTypeName = cmdletContext.WorkspaceProperties_ComputeTypeName; } if (requestWorkspaceProperties_workspaceProperties_ComputeTypeName != null) { request.WorkspaceProperties.ComputeTypeName = requestWorkspaceProperties_workspaceProperties_ComputeTypeName; requestWorkspacePropertiesIsNull = false; } System.Int32?requestWorkspaceProperties_workspaceProperties_RootVolumeSizeGib = null; if (cmdletContext.WorkspaceProperties_RootVolumeSizeGib != null) { requestWorkspaceProperties_workspaceProperties_RootVolumeSizeGib = cmdletContext.WorkspaceProperties_RootVolumeSizeGib.Value; } if (requestWorkspaceProperties_workspaceProperties_RootVolumeSizeGib != null) { request.WorkspaceProperties.RootVolumeSizeGib = requestWorkspaceProperties_workspaceProperties_RootVolumeSizeGib.Value; requestWorkspacePropertiesIsNull = false; } Amazon.WorkSpaces.RunningMode requestWorkspaceProperties_workspaceProperties_RunningMode = null; if (cmdletContext.WorkspaceProperties_RunningMode != null) { requestWorkspaceProperties_workspaceProperties_RunningMode = cmdletContext.WorkspaceProperties_RunningMode; } if (requestWorkspaceProperties_workspaceProperties_RunningMode != null) { request.WorkspaceProperties.RunningMode = requestWorkspaceProperties_workspaceProperties_RunningMode; requestWorkspacePropertiesIsNull = false; } System.Int32?requestWorkspaceProperties_workspaceProperties_RunningModeAutoStopTimeoutInMinute = null; if (cmdletContext.WorkspaceProperties_RunningModeAutoStopTimeoutInMinute != null) { requestWorkspaceProperties_workspaceProperties_RunningModeAutoStopTimeoutInMinute = cmdletContext.WorkspaceProperties_RunningModeAutoStopTimeoutInMinute.Value; } if (requestWorkspaceProperties_workspaceProperties_RunningModeAutoStopTimeoutInMinute != null) { request.WorkspaceProperties.RunningModeAutoStopTimeoutInMinutes = requestWorkspaceProperties_workspaceProperties_RunningModeAutoStopTimeoutInMinute.Value; requestWorkspacePropertiesIsNull = false; } System.Int32?requestWorkspaceProperties_workspaceProperties_UserVolumeSizeGib = null; if (cmdletContext.WorkspaceProperties_UserVolumeSizeGib != null) { requestWorkspaceProperties_workspaceProperties_UserVolumeSizeGib = cmdletContext.WorkspaceProperties_UserVolumeSizeGib.Value; } if (requestWorkspaceProperties_workspaceProperties_UserVolumeSizeGib != null) { request.WorkspaceProperties.UserVolumeSizeGib = requestWorkspaceProperties_workspaceProperties_UserVolumeSizeGib.Value; requestWorkspacePropertiesIsNull = false; } // determine if request.WorkspaceProperties should be set to null if (requestWorkspacePropertiesIsNull) { request.WorkspaceProperties = 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); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WorkSpaces.Model.CreateWorkspaceBundleRequest(); if (cmdletContext.BundleDescription != null) { request.BundleDescription = cmdletContext.BundleDescription; } if (cmdletContext.BundleName != null) { request.BundleName = cmdletContext.BundleName; } // populate ComputeType var requestComputeTypeIsNull = true; request.ComputeType = new Amazon.WorkSpaces.Model.ComputeType(); Amazon.WorkSpaces.Compute requestComputeType_computeType_Name = null; if (cmdletContext.ComputeType_Name != null) { requestComputeType_computeType_Name = cmdletContext.ComputeType_Name; } if (requestComputeType_computeType_Name != null) { request.ComputeType.Name = requestComputeType_computeType_Name; requestComputeTypeIsNull = false; } // determine if request.ComputeType should be set to null if (requestComputeTypeIsNull) { request.ComputeType = null; } if (cmdletContext.ImageId != null) { request.ImageId = cmdletContext.ImageId; } // populate RootStorage var requestRootStorageIsNull = true; request.RootStorage = new Amazon.WorkSpaces.Model.RootStorage(); System.String requestRootStorage_rootStorage_Capacity = null; if (cmdletContext.RootStorage_Capacity != null) { requestRootStorage_rootStorage_Capacity = cmdletContext.RootStorage_Capacity; } if (requestRootStorage_rootStorage_Capacity != null) { request.RootStorage.Capacity = requestRootStorage_rootStorage_Capacity; requestRootStorageIsNull = false; } // determine if request.RootStorage should be set to null if (requestRootStorageIsNull) { request.RootStorage = null; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } // populate UserStorage var requestUserStorageIsNull = true; request.UserStorage = new Amazon.WorkSpaces.Model.UserStorage(); System.String requestUserStorage_userStorage_Capacity = null; if (cmdletContext.UserStorage_Capacity != null) { requestUserStorage_userStorage_Capacity = cmdletContext.UserStorage_Capacity; } if (requestUserStorage_userStorage_Capacity != null) { request.UserStorage.Capacity = requestUserStorage_userStorage_Capacity; requestUserStorageIsNull = false; } // determine if request.UserStorage should be set to null if (requestUserStorageIsNull) { request.UserStorage = 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); }