workspaces

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 25 Imported by: 0

README

WorkSpaces

Parity grade: A · SDK aws-sdk-go-v2/service/workspaces@v1.73.1 · last audited 2026-08-10 (7c8077891728)

Coverage

Metric Value
Operations audited 34 (32 ok, 2 deferred)
Feature families 14 (14 ok)
Known gaps 1
Deferred items 0
Resource leaks clean
Known gaps
  • clientProperties (ModifyClientProperties/DescribeClientProperties, including the ClientExperiencePolicy/LogUploadEnabled fields fixed this pass, gopherstack-gt9o) is NOT part of backendSnapshot -- pre-existing, deliberate (see persistence.go's field comment and whitebox_test.go), out of scope for gopherstack-gt9o which is about the missing fields, not this separate ephemeral-persistence gap. (bd: none filed for the persistence gap itself) # All gaps from the prior pass (CreateStandbyWorkspaces FailedStandbyRequests, # AssociateIpGroups/DisassociateIpGroups persistence) were closed for real this # pass — see the ops table entries above for what changed. # # gopherstack-o5ig (2026-08-10): both items previously listed as deferred below # (RunningMode-while-STOPPED, Applications family) are now fixed — see the # WorkspacesPool and Applications family notes above. CreateWorkspaceBundle.ImageId # and CreateWorkspaceImage.WorkspaceId, flagged then as a follow-up, are now # fixed too (gopherstack-e5pd, 2026-08-11) — see WorkspaceBundle_custom and # WorkspaceImage notes above. That same pass found CopyWorkspaceImage.SourceImageId # and CreateUpdatedWorkspaceImage.SourceImageId have the identical gap; both are # now fixed too (gopherstack-plmb, 2026-08-11) — see WorkspaceImage note above. # CopyWorkspaceImage's fix is conditional on SourceRegion (see that note) rather # than a full unconditional check, since this backend genuinely has no visibility # into another region's image table.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWorkspaceNotFound is returned when a workspace does not exist.
	ErrWorkspaceNotFound = awserr.New(errResourceNotFound, awserr.ErrNotFound)
	// ErrInvalidParameter is returned on invalid input.
	ErrInvalidParameter = awserr.New(errInvalidParameterValues, awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("workspaces: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AccountModification added in v1.2.0

type AccountModification struct {
	StartTime                           time.Time
	ModificationState                   string
	DedicatedTenancySupport             string
	DedicatedTenancyManagementCidrRange string
}

AccountModification records one completed change to the account's BYOL (Bring Your Own License) configuration, matching the real AccountModification SDK type (ErrorCode/ErrorMessage are omitted here: ModifyAccount in this backend always succeeds once it validates, so no failure path populates them).

type ApplicationResourceAssociation added in v1.3.1

type ApplicationResourceAssociation struct {
	Created                time.Time
	LastUpdatedTime        time.Time
	AssociatedResourceID   string
	AssociatedResourceType string
	ApplicationID          string
	State                  string
}

ApplicationResourceAssociation describes an association between an application and the resource it is associated with (a WorkSpace), matching the real ApplicationResourceAssociation SDK type. Unlike WorkspaceResourceAssociation, the identifying field here is ApplicationId, not WorkspaceId -- the wire shape describes the operation "from the application's side".

type BundleComputeType

type BundleComputeType struct {
	Name string
}

BundleComputeType holds the compute type name for a bundle.

type BundleResourceAssociation added in v1.2.0

type BundleResourceAssociation struct {
	Created                 time.Time
	LastUpdatedTime         time.Time
	AssociatedResourceID    string
	AssociatedResourceType  string
	BundleID                string
	State                   string
	StateReasonErrorCode    string
	StateReasonErrorMessage string
}

BundleResourceAssociation describes an application association for a bundle, matching the real BundleResourceAssociation SDK type. See ImageResourceAssociation -- same "always empty in this emulator" rationale.

type BundleStorage

type BundleStorage struct {
	Capacity int32
}

BundleStorage holds storage capacity for a bundle.

type DataReplicationSettings added in v1.3.4

type DataReplicationSettings struct {
	RecoverySnapshotTime *time.Time `json:"RecoverySnapshotTime,omitempty"`
	DataReplication      string     `json:"DataReplication,omitempty"`
}

DataReplicationSettings holds data replication settings.

type FailedRequest

type FailedRequest struct {
	WorkspaceID  string
	ErrorCode    string
	ErrorMessage string
}

FailedRequest holds error information for a failed workspace bulk operation.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler handles WorkSpaces HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the resource identifier from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a matcher that accepts WorkSpaces target header requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend. Handler previously had no Snapshot/Restore of its own, so cli.go's generic setupPersistence (which type-asserts the registered service.Registerable, i.e. the Handler, for a Snapshot/Restore pair) never picked WorkSpaces up even though InMemoryBackend already implemented persistence.Persistable -- dead wiring. Adding this delegation (matching the codecommit/codepipeline/ emr pattern) is what actually wires WorkSpaces into persistence.

type ImageResourceAssociation added in v1.2.0

type ImageResourceAssociation struct {
	Created                 time.Time
	LastUpdatedTime         time.Time
	AssociatedResourceID    string
	AssociatedResourceType  string
	ImageID                 string
	State                   string
	StateReasonErrorCode    string
	StateReasonErrorMessage string
}

ImageResourceAssociation describes an application association for an image, matching the real ImageResourceAssociation SDK type. A freshly emulated account always returns an empty list from DescribeImageAssociations since there is no public API to create this kind of association (see DescribeImageAssociations doc comment in images.go) -- this type exists so the wire shape is correct if that ever changes.

type ImageSource added in v1.3.1

type ImageSource struct {
	Ec2ImageID           string `json:"ec2ImageId,omitempty"`
	Ec2ImportTaskID      string `json:"ec2ImportTaskId,omitempty"`
	ImageBuildVersionArn string `json:"imageBuildVersionArn,omitempty"`
}

ImageSource models the ImageSourceIdentifier tagged union (workspaces@v1.73.1 types.go:739-770): exactly one field is populated, mirroring whichever member the caller supplied on ImportCustomWorkspaceImage.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend implements StorageBackend using in-memory maps.

Phase 3.3: every map[string]*T resource field is a *store.Table[T] registered on b.registry (see store_setup.go); registry.SnapshotAll / RestoreAll / ResetAll now drive Reset/Snapshot/Restore below (see persistence.go) instead of per-map hand-written boilerplate. tags, directoryIpGroups, imagePermissions, clientProperties, and appAssociations are left as plain maps -- their values are not *T (a map, a scalar, or a set), so there is no identity for store.Table to key on; see the field comments below and persistence.go's doc comment for which of these were persisted before this refactor and remain so.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AcceptAccountLinkInvitation

func (b *InMemoryBackend) AcceptAccountLinkInvitation(linkID string) (*storedAccountLink, error)

AcceptAccountLinkInvitation accepts an account link.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AssociateConnectionAlias

func (b *InMemoryBackend) AssociateConnectionAlias(aliasID, resourceID string) (string, error)

AssociateConnectionAlias associates an alias with a resource.

func (*InMemoryBackend) AssociateIpGroups

func (b *InMemoryBackend) AssociateIpGroups(
	directoryID string,
	groupIDs []string,
) error

AssociateIpGroups associates IP groups with a directory.

func (*InMemoryBackend) AssociateWorkspaceApplication

func (b *InMemoryBackend) AssociateWorkspaceApplication(
	workspaceID, applicationID string,
) (WorkspaceResourceAssociation, error)

AssociateWorkspaceApplication associates an application with a workspace.

ApplicationId is intentionally not validated against a real catalog: real AWS's WorkSpaces Application Manager applications come from a read-only AWS/partner catalog with no public API to create one, and this backend never seeds b.applications, so requiring a match would make every call to this operation permanently fail -- see DescribeApplications, which has the same "always empty" catalog for the same reason.

func (*InMemoryBackend) AuthorizeIpRules

func (b *InMemoryBackend) AuthorizeIpRules(
	groupID string,
	rules []ipRuleItem,
) error

AuthorizeIpRules appends rules to an IP group.

func (*InMemoryBackend) CopyWorkspaceImage

func (b *InMemoryBackend) CopyWorkspaceImage(
	name, sourceImageID, sourceRegion, description string,
	tags map[string]string,
) (string, error)

CopyWorkspaceImage copies an image. SourceImageId is checked against b.images only when sourceRegion is empty or equals this backend's own region: this service instantiates one InMemoryBackend per (account, region) (see NewInMemoryBackend/provider.go), and storedImage carries no region field, so a genuine cross-region copy's source image legitimately lives in a different backend instance this one cannot see -- rejecting it would be more restrictive than real AWS. ResourceNotFoundException is in this operation's error list (aws-sdk-go-v2/service/workspaces@v1.73.1 deserializers.go's awsAwsjson11_deserializeOpErrorCopyWorkspaceImage).

func (*InMemoryBackend) CreateAccountLinkInvitation

func (b *InMemoryBackend) CreateAccountLinkInvitation(
	targetAccountID string,
) (*storedAccountLink, error)

CreateAccountLinkInvitation creates an account link invitation.

func (*InMemoryBackend) CreateConnectClientAddIn

func (b *InMemoryBackend) CreateConnectClientAddIn(name, resourceID, url string) (string, error)

CreateConnectClientAddIn creates a new Connect client add-in.

func (*InMemoryBackend) CreateConnectionAlias

func (b *InMemoryBackend) CreateConnectionAlias(
	connectionString string, tags map[string]string,
) (string, error)

CreateConnectionAlias creates a new connection alias.

func (*InMemoryBackend) CreateIpGroup

func (b *InMemoryBackend) CreateIpGroup(
	groupName, groupDesc string,
	userRules []ipRuleItem,
	tags map[string]string,
) (string, error)

CreateIpGroup creates a new IP group and returns its ID.

func (*InMemoryBackend) CreateStandbyWorkspace added in v1.2.0

func (b *InMemoryBackend) CreateStandbyWorkspace(
	_ context.Context, spec StandbyWorkspaceSpec,
) (*PendingStandbyWorkspace, error)

CreateStandbyWorkspace creates a single standby WorkSpace and returns it in PENDING state. Returns InvalidParameterValuesException when spec.DirectoryID is not registered, matching the same per-item runtime validation as CreateWorkspace. The real StandbyWorkspace request shape carries no UserName/BundleId (see StandbyWorkspaceSpec) -- those fields belong to the primary WorkSpace, which may live in a different region's backend that this in-memory store cannot see, so the created record has no way to inherit them; PendingCreateStandbyWorkspacesRequest's real shape doesn't surface BundleId at all, and its UserName is left empty for the same reason.

func (*InMemoryBackend) CreateTags

func (b *InMemoryBackend) CreateTags(resourceID string, tags map[string]string) error

CreateTags applies tags to a workspace resource ID. Returns InvalidParameterValuesException if tag key/value limits are exceeded or if applying the tags would exceed the 50-tag limit per resource.

func (*InMemoryBackend) CreateUpdatedWorkspaceImage

func (b *InMemoryBackend) CreateUpdatedWorkspaceImage(
	sourceImageID, name, description string, tags map[string]string,
) (string, error)

CreateUpdatedWorkspaceImage creates an updated version of an existing image. Returns errImageNotFound for a SourceImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateUpdatedWorkspaceImage).

func (*InMemoryBackend) CreateWorkspace

func (b *InMemoryBackend) CreateWorkspace(
	ctx context.Context,
	spec *WorkspaceCreationSpec,
) (*Workspace, error)

CreateWorkspace creates a new WorkSpace and returns it. Returns InvalidParameterValuesException when spec.DirectoryID is not registered.

func (*InMemoryBackend) CreateWorkspaceBundle

func (b *InMemoryBackend) CreateWorkspaceBundle(
	name, description, imageID, computeType string,
	tags map[string]string,
) (*storedCustomBundle, error)

CreateWorkspaceBundle creates a custom bundle. Returns errImageNotFound for an ImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateWorkspaceBundle).

func (*InMemoryBackend) CreateWorkspaceImage

func (b *InMemoryBackend) CreateWorkspaceImage(
	name, description, workspaceID string,
	tags map[string]string,
) (*storedImage, error)

CreateWorkspaceImage creates an image from a workspace. Returns ErrWorkspaceNotFound for a WorkspaceId that doesn't reference a real workspace, matching real AWS (ResourceNotFoundException is in this operation's error list; see deserializers.go's awsAwsjson11_deserializeOpErrorCreateWorkspaceImage). The real CreateWorkspaceImageOutput and WorkspaceImage type carry no source workspace reference, so there is nothing to derive from the workspace beyond confirming it exists.

func (*InMemoryBackend) CreateWorkspacesPool

func (b *InMemoryBackend) CreateWorkspacesPool(
	poolName, bundleID, directoryID, description, runningMode string,
	desiredUserSessions int32,
	tags map[string]string,
) (*storedPool, error)

CreateWorkspacesPool creates a new workspace pool.

func (*InMemoryBackend) DeleteAccountLinkInvitation

func (b *InMemoryBackend) DeleteAccountLinkInvitation(linkID string) (*storedAccountLink, error)

DeleteAccountLinkInvitation deletes a pending account link invitation. "DELETED" is not a member of the real AccountLinkStatusEnum, so the returned AccountLink keeps whatever status it already had (this backend only reaches this op while a link is still PENDING_ACCEPTANCE_BY_TARGET_ACCOUNT) rather than fabricating one.

func (*InMemoryBackend) DeleteClientBranding

func (b *InMemoryBackend) DeleteClientBranding(resourceID string, platforms []string) error

DeleteClientBranding removes branding data for specific platforms.

func (*InMemoryBackend) DeleteConnectClientAddIn

func (b *InMemoryBackend) DeleteConnectClientAddIn(addInID, _ string) error

DeleteConnectClientAddIn removes a Connect client add-in.

func (*InMemoryBackend) DeleteConnectionAlias

func (b *InMemoryBackend) DeleteConnectionAlias(aliasID string) error

DeleteConnectionAlias removes a connection alias.

func (*InMemoryBackend) DeleteIPGroup

func (b *InMemoryBackend) DeleteIPGroup(
	groupID string,
) error

DeleteIPGroup removes an IP group by ID.

func (*InMemoryBackend) DeleteTags

func (b *InMemoryBackend) DeleteTags(resourceID string, tagKeys []string) error

DeleteTags removes tags from a workspace resource ID.

func (*InMemoryBackend) DeleteWorkspaceBundle

func (b *InMemoryBackend) DeleteWorkspaceBundle(bundleID string) error

DeleteWorkspaceBundle removes a custom bundle.

func (*InMemoryBackend) DeleteWorkspaceImage

func (b *InMemoryBackend) DeleteWorkspaceImage(imageID string) error

DeleteWorkspaceImage removes an image.

func (*InMemoryBackend) DeployWorkspaceApplications

func (b *InMemoryBackend) DeployWorkspaceApplications(
	workspaceID string, _ bool,
) ([]WorkspaceResourceAssociation, error)

DeployWorkspaceApplications deploys the applications currently associated with a WorkSpace. This backend has no pending-install queue -- Associate already leaves every association COMPLETED -- so Deploy's real work here is validating the WorkSpace exists and reporting its current associations.

func (*InMemoryBackend) DeregisterWorkspaceDirectory

func (b *InMemoryBackend) DeregisterWorkspaceDirectory(directoryID string) error

DeregisterWorkspaceDirectory deregisters a directory. Returns InvalidResourceStateException when any WorkSpaces are still registered to the directory, matching real AWS: "If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory" -- this backend never auto-cascade-deletes WorkSpaces on deregister, since real AWS doesn't either.

func (*InMemoryBackend) DescribeAccount

func (b *InMemoryBackend) DescribeAccount() storedAccountConfig

DescribeAccount returns account configuration.

func (*InMemoryBackend) DescribeAccountModifications added in v1.2.0

func (b *InMemoryBackend) DescribeAccountModifications(
	nextToken string,
) ([]AccountModification, string, error)

DescribeAccountModifications returns the history of BYOL configuration changes recorded by ModifyAccount, most recent first (matching real AWS ordering), paginated. The real DescribeAccountModificationsInput has no MaxResults field (only NextToken), unlike most other paginated ops in this service -- so this backend applies its own fixed internal page size.

func (*InMemoryBackend) DescribeApplicationAssociations

func (b *InMemoryBackend) DescribeApplicationAssociations(
	applicationID string, associatedResourceTypes []string, _ int32, _ string,
) ([]ApplicationResourceAssociation, string, error)

DescribeApplicationAssociations returns workspace associations for an application.

ApplicationId is not validated for existence, matching AssociateWorkspaceApplication: the applications catalog is never populated in this backend, so requiring a match would make this operation permanently return zero results even for associations it created itself.

func (*InMemoryBackend) DescribeApplications

func (b *InMemoryBackend) DescribeApplications(
	appIDs []string,
	_ int32,
	_ string,
) ([]*storedApplication, string, error)

DescribeApplications returns stored applications, filtered by IDs.

func (*InMemoryBackend) DescribeBundleAssociations added in v1.2.0

func (b *InMemoryBackend) DescribeBundleAssociations(
	bundleID string, resourceTypes []string,
) ([]BundleResourceAssociation, error)

DescribeBundleAssociations returns application associations for a bundle. See DescribeImageAssociations in images.go: real AWS exposes no public API to create a bundle<->application association, so a freshly emulated account always has an empty list. This still performs the real required-field and existence validation a live call would enforce.

func (*InMemoryBackend) DescribeClientBranding

func (b *InMemoryBackend) DescribeClientBranding(
	resourceID string,
) (map[string]map[string]any, error)

DescribeClientBranding returns branding data for a resource.

func (*InMemoryBackend) DescribeClientProperties

func (b *InMemoryBackend) DescribeClientProperties(
	resourceIDs []string,
) (map[string]storedClientProps, error)

DescribeClientProperties returns client properties for resource IDs.

func (*InMemoryBackend) DescribeConnectClientAddIns

func (b *InMemoryBackend) DescribeConnectClientAddIns(
	resourceID string, _ int32, _ string,
) ([]*storedConnectAddIn, string, error)

DescribeConnectClientAddIns returns add-ins for a resource.

func (*InMemoryBackend) DescribeConnectionAliasPermissions

func (b *InMemoryBackend) DescribeConnectionAliasPermissions(
	aliasID string, _ int32, _ string,
) (string, []connAliasPermission, string, error)

DescribeConnectionAliasPermissions returns shared-account permissions for an alias.

func (*InMemoryBackend) DescribeConnectionAliases

func (b *InMemoryBackend) DescribeConnectionAliases(
	aliasIDs []string, resourceID string, _ int32, _ string,
) ([]*storedConnAlias, string, error)

DescribeConnectionAliases returns connection aliases filtered by IDs or resource.

func (*InMemoryBackend) DescribeCustomWorkspaceImageImport

func (b *InMemoryBackend) DescribeCustomWorkspaceImageImport(imageID string) (*storedImage, error)

DescribeCustomWorkspaceImageImport returns import state for a custom image.

func (*InMemoryBackend) DescribeImageAssociations added in v1.2.0

func (b *InMemoryBackend) DescribeImageAssociations(
	imageID string, resourceTypes []string,
) ([]ImageResourceAssociation, error)

DescribeImageAssociations returns application associations for an image. Real AWS's WorkSpaces Application Manager exposes no public API to create an image<->application association (only AssociateWorkspaceApplication, which associates an application directly with a WorkSpace, and DeployWorkspaceApplications, neither of which touch an image or bundle) -- so a freshly emulated account always has an empty association list. This still performs the real required-field and existence validation a live call would enforce, matching the pattern used by RestoreWorkspace for an otherwise-no-op operation.

func (*InMemoryBackend) DescribeIpGroups

func (b *InMemoryBackend) DescribeIpGroups(
	groupIDs []string, _ int32, _ string,
) ([]*storedIpGroup, string, error)

DescribeIpGroups returns IP groups, optionally filtered by IDs.

func (*InMemoryBackend) DescribeTags

func (b *InMemoryBackend) DescribeTags(resourceID string) (map[string]string, error)

DescribeTags returns tags for a workspace resource ID.

func (*InMemoryBackend) DescribeWorkspaceAssociations

func (b *InMemoryBackend) DescribeWorkspaceAssociations(
	workspaceID string,
	associatedResourceTypes []string,
) ([]WorkspaceResourceAssociation, error)

DescribeWorkspaceAssociations returns application associations for a workspace.

func (*InMemoryBackend) DescribeWorkspaceBundles

func (b *InMemoryBackend) DescribeWorkspaceBundles(
	_ context.Context,
	bundleIDs []string, owner string, nextToken string,
) ([]*WorkspaceBundle, string, error)

DescribeWorkspaceBundles returns workspace bundles, optionally filtered by IDs or owner. When no owner is specified, returns both Amazon-owned and account-owned custom bundles. When owner is "Amazon", returns only Amazon-owned bundles. When owner is an account ID, returns custom bundles for that account. Results are sorted by BundleID and paginated (max 25 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspaceDirectories

func (b *InMemoryBackend) DescribeWorkspaceDirectories(
	_ context.Context,
	directoryIDs []string, nextToken string,
) ([]*WorkspaceDirectory, string, error)

DescribeWorkspaceDirectories returns workspace directories matching the given filters. Only directories that have been registered via RegisterWorkspaceDirectory are returned. Results are sorted by DirectoryID and paginated (max 50 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspaceImagePermissions

func (b *InMemoryBackend) DescribeWorkspaceImagePermissions(
	imageID string,
) (string, map[string]bool, error)

DescribeWorkspaceImagePermissions returns sharing permissions for an image.

func (*InMemoryBackend) DescribeWorkspaceImages

func (b *InMemoryBackend) DescribeWorkspaceImages(
	imageIDs []string, _ string, _ int32, _ string,
) ([]*storedImage, string, error)

DescribeWorkspaceImages returns workspace images, optionally filtered by IDs.

func (*InMemoryBackend) DescribeWorkspaces

func (b *InMemoryBackend) DescribeWorkspaces(
	ctx context.Context,
	workspaceIDs, directoryIDs, userIDs, bundleIDs []string,
	limit int32, nextToken string,
) ([]*Workspace, string, error)

DescribeWorkspaces returns workspaces matching the given filters. Results are sorted by WorkspaceId and paginated (max 25 per page, matching AWS).

func (*InMemoryBackend) DescribeWorkspacesPoolSessions

func (b *InMemoryBackend) DescribeWorkspacesPoolSessions(
	poolID, _ string, _ int32, _ string,
) ([]*storedPoolSession, string, error)

DescribeWorkspacesPoolSessions returns sessions for a pool.

func (*InMemoryBackend) DescribeWorkspacesPools

func (b *InMemoryBackend) DescribeWorkspacesPools(
	poolIDs []string, _ int32, _ string,
) ([]*storedPool, string, error)

DescribeWorkspacesPools returns pools, optionally filtered by IDs.

func (*InMemoryBackend) DisassociateConnectionAlias

func (b *InMemoryBackend) DisassociateConnectionAlias(aliasID string) error

DisassociateConnectionAlias removes the resource association from an alias.

func (*InMemoryBackend) DisassociateIpGroups

func (b *InMemoryBackend) DisassociateIpGroups(
	directoryID string,
	groupIDs []string,
) error

DisassociateIpGroups removes IP group associations from a directory.

func (*InMemoryBackend) DisassociateWorkspaceApplication

func (b *InMemoryBackend) DisassociateWorkspaceApplication(
	workspaceID, applicationID string,
) (WorkspaceResourceAssociation, error)

DisassociateWorkspaceApplication removes an application association from a workspace, returning the resulting REMOVED association. Created/ LastUpdatedTime are left zero-valued on the returned value: once removed, this backend no longer tracks when the association was originally made, and fabricating a timestamp would be dishonest.

func (b *InMemoryBackend) GetAccountLink(linkID string) (*storedAccountLink, error)

GetAccountLink retrieves an account link by ID.

func (*InMemoryBackend) GetWorkspacesConnectionStatus

func (b *InMemoryBackend) GetWorkspacesConnectionStatus(
	workspaceIDs []string,
) ([]*WorkspaceConnectionStatus, error)

GetWorkspacesConnectionStatus returns connection status for the given workspace IDs. If no IDs are provided, returns status for all workspaces. AVAILABLE workspaces report DISCONNECTED (not yet connected in this emulator); STOPPED workspaces report NOT_CONNECTED, matching real AWS behaviour for offline workspaces.

func (*InMemoryBackend) ImportClientBranding

func (b *InMemoryBackend) ImportClientBranding(
	resourceID string, platforms map[string]map[string]any,
) error

ImportClientBranding stores branding data for a resource.

func (*InMemoryBackend) ImportCustomWorkspaceImage

func (b *InMemoryBackend) ImportCustomWorkspaceImage(
	name, description string, spec customWorkspaceImageImportSpec,
) (*storedImage, error)

ImportCustomWorkspaceImage imports a custom workspace image.

func (*InMemoryBackend) ImportWorkspaceImage

func (b *InMemoryBackend) ImportWorkspaceImage(
	ec2ImageID, name, description, ingestionProcess string, tags map[string]string,
) (string, error)

ImportWorkspaceImage imports an EC2 image as a workspace image. IngestionProcess is required on the real ImportWorkspaceImageInput (workspaces@v1.73.1 api_op_ImportWorkspaceImage.go:67).

func (b *InMemoryBackend) ListAccountLinks(
	statusFilter string,
	_ int32,
	_ string,
) ([]*storedAccountLink, string, error)

ListAccountLinks returns account links, optionally filtered by status.

func (*InMemoryBackend) ListAvailableManagementCidrRanges added in v1.2.0

func (b *InMemoryBackend) ListAvailableManagementCidrRanges(
	constraint string, maxResults int32, nextToken string,
) ([]string, string, error)

ListAvailableManagementCidrRanges returns candidate BYOL management network CIDR ranges contained within constraint, paginated. ManagementCidrRangeConstraint is a required field on the real API (smithy `required` trait) and must be a syntactically valid IPv4 CIDR block; both are validated here.

func (*InMemoryBackend) MigrateWorkspace

func (b *InMemoryBackend) MigrateWorkspace(
	sourceWorkspaceID, bundleID string,
) (sourceID, targetID string, err error)

MigrateWorkspace migrates a workspace to a new bundle.

func (*InMemoryBackend) ModifyAccount

func (b *InMemoryBackend) ModifyAccount(
	dedicatedTenancyCidr, dedicatedTenancySupport string,
) error

ModifyAccount updates account configuration and records the change as a completed AccountModification, matching real AWS's DescribeAccountModifications (which surfaces the history of BYOL configuration changes). This backend applies the change synchronously, so ModificationState is always COMPLETED -- there is no PENDING window to model.

func (*InMemoryBackend) ModifyCertificateBasedAuthProperties

func (b *InMemoryBackend) ModifyCertificateBasedAuthProperties(
	directoryID string,
	props map[string]string,
	propertiesToDelete []string,
) error

ModifyCertificateBasedAuthProperties stores certificate auth properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyClientProperties

func (b *InMemoryBackend) ModifyClientProperties(
	resourceID string, clientExperiencePolicy, logUploadEnabled, reconnectEnabled *string,
) error

ModifyClientProperties merges the supplied client properties into a resource's stored properties. Each of clientExperiencePolicy, logUploadEnabled, reconnectEnabled is nil when the caller omitted it from the request, in which case the previously stored value (if any) is left untouched rather than cleared -- matching real ModifyClientProperties, which is a partial update, not a full replace.

func (*InMemoryBackend) ModifyEndpointEncryptionMode

func (b *InMemoryBackend) ModifyEndpointEncryptionMode(directoryID, mode string) error

ModifyEndpointEncryptionMode stores the endpoint encryption mode for a registered directory. Returns errDirectoryNotFound for a DirectoryId that was never registered, matching real AWS (ResourceNotFoundException is in this operation's error list).

func (*InMemoryBackend) ModifySamlProperties

func (b *InMemoryBackend) ModifySamlProperties(directoryID string, props map[string]string) error

ModifySamlProperties stores SAML properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifySelfservicePermissions

func (b *InMemoryBackend) ModifySelfservicePermissions(
	directoryID string,
	props map[string]string,
) error

ModifySelfservicePermissions stores self-service permissions for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyStreamingProperties

func (b *InMemoryBackend) ModifyStreamingProperties(
	directoryID string,
	props map[string]string,
) error

ModifyStreamingProperties stores streaming properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyWorkspaceAccessProperties

func (b *InMemoryBackend) ModifyWorkspaceAccessProperties(
	directoryID string,
	props map[string]string,
) error

ModifyWorkspaceAccessProperties stores workspace access properties for a registered directory. See ModifyEndpointEncryptionMode.

func (*InMemoryBackend) ModifyWorkspaceCreationProperties

func (b *InMemoryBackend) ModifyWorkspaceCreationProperties(
	directoryID string,
	props map[string]string,
) error

ModifyWorkspaceCreationProperties stores workspace creation properties for a registered directory. Returns errDirectoryNotFound for a DirectoryId that was never registered, matching real AWS (ResourceNotFoundException is in this operation's error list).

func (*InMemoryBackend) ModifyWorkspaceProperties

func (b *InMemoryBackend) ModifyWorkspaceProperties(
	workspaceID string,
	props WorkspaceProperties,
) error

ModifyWorkspaceProperties updates and persists mutable properties of a WorkSpace. Returns InvalidParameterValuesException for unknown compute type names or running modes.

func (*InMemoryBackend) ModifyWorkspaceState

func (b *InMemoryBackend) ModifyWorkspaceState(workspaceID, state string) error

ModifyWorkspaceState updates the administrative state of a WorkSpace.

func (*InMemoryBackend) RebootWorkspaces

func (b *InMemoryBackend) RebootWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

RebootWorkspaces reboots the given workspaces, returning failures for unknown IDs or a workspace whose state doesn't support rebooting.

func (*InMemoryBackend) RebuildWorkspaces

func (b *InMemoryBackend) RebuildWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

RebuildWorkspaces rebuilds the given workspaces, returning failures for unknown IDs or a workspace whose state doesn't support rebuilding.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) RegisterWorkspaceDirectory

func (b *InMemoryBackend) RegisterWorkspaceDirectory(directoryID string, subnetIDs []string) error

RegisterWorkspaceDirectory registers a directory and stores subnet IDs. Returns ResourceAlreadyExistsException when the directory is already registered, matching real AWS: you cannot re-register an already-registered directory.

func (*InMemoryBackend) RejectAccountLinkInvitation

func (b *InMemoryBackend) RejectAccountLinkInvitation(linkID string) (*storedAccountLink, error)

RejectAccountLinkInvitation rejects an account link.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) RestoreWorkspace

func (b *InMemoryBackend) RestoreWorkspace(workspaceID string) error

RestoreWorkspace restores a WorkSpace from its most recent snapshot. This backend does not model snapshots, so the operation is otherwise a no-op beyond existence validation, matching real AWS's ResourceNotFoundException for unknown WorkspaceIds.

func (*InMemoryBackend) RevokeIpRules

func (b *InMemoryBackend) RevokeIpRules(
	groupID string,
	ipRules []string,
) error

RevokeIpRules removes rules (by IpRule string) from an IP group.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartWorkspaces

func (b *InMemoryBackend) StartWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

StartWorkspaces starts the given workspaces, transitioning STOPPED workspaces to AVAILABLE.

func (*InMemoryBackend) StartWorkspacesPool

func (b *InMemoryBackend) StartWorkspacesPool(poolID string) error

StartWorkspacesPool transitions a pool to RUNNING.

func (*InMemoryBackend) StopWorkspaces

func (b *InMemoryBackend) StopWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

StopWorkspaces stops the given workspaces, transitioning them to STOPPED state.

func (*InMemoryBackend) StopWorkspacesPool

func (b *InMemoryBackend) StopWorkspacesPool(poolID string) error

StopWorkspacesPool transitions a pool to STOPPED.

func (*InMemoryBackend) TerminateWorkspaces

func (b *InMemoryBackend) TerminateWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

TerminateWorkspaces terminates (deletes) the given workspaces, returning failures for unknown IDs.

func (*InMemoryBackend) TerminateWorkspacesPool

func (b *InMemoryBackend) TerminateWorkspacesPool(poolID string) error

TerminateWorkspacesPool removes a pool.

func (*InMemoryBackend) TerminateWorkspacesPoolSession

func (b *InMemoryBackend) TerminateWorkspacesPoolSession(sessionID string) error

TerminateWorkspacesPoolSession removes a pool session.

func (*InMemoryBackend) UpdateConnectClientAddIn

func (b *InMemoryBackend) UpdateConnectClientAddIn(
	addInID, _, name, url string,
) error

UpdateConnectClientAddIn updates a Connect client add-in.

func (*InMemoryBackend) UpdateConnectionAliasPermission

func (b *InMemoryBackend) UpdateConnectionAliasPermission(
	aliasID, accountID string, allowAssociation bool,
) error

UpdateConnectionAliasPermission sets the shared-account permission for an alias.

func (*InMemoryBackend) UpdateRulesOfIpGroup

func (b *InMemoryBackend) UpdateRulesOfIpGroup(
	groupID string,
	rules []ipRuleItem,
) error

UpdateRulesOfIpGroup replaces all rules in an IP group.

func (*InMemoryBackend) UpdateWorkspaceBundle

func (b *InMemoryBackend) UpdateWorkspaceBundle(bundleID, imageID string) error

UpdateWorkspaceBundle updates the image of a custom bundle. Returns errImageNotFound for an ImageId that doesn't reference a real image, matching real AWS (ResourceNotFoundException is in this operation's error list, and UpdateWorkspaceBundleInput.ImageId is optional, so an empty value is a no-op rather than a validation failure).

func (*InMemoryBackend) UpdateWorkspaceImagePermission

func (b *InMemoryBackend) UpdateWorkspaceImagePermission(
	imageID, sharedAccountID string, allowCopy bool,
) error

UpdateWorkspaceImagePermission sets the sharing permission for an image.

func (*InMemoryBackend) UpdateWorkspacesPool

func (b *InMemoryBackend) UpdateWorkspacesPool(
	poolID, description, bundleID, directoryID, runningMode string,
	desiredUserSessions int32,
) (*storedPool, error)

UpdateWorkspacesPool updates pool fields. Fields left at their zero value (empty string / zero int) are left unchanged, matching the real API's "only specified fields are updated" partial-update semantics.

type ModificationState added in v1.3.4

type ModificationState struct {
	Resource string `json:"Resource,omitempty"`
	State    string `json:"State,omitempty"`
}

ModificationState holds modification state of a workspace.

type PendingStandbyWorkspace added in v1.2.0

type PendingStandbyWorkspace struct {
	WorkspaceID string
	DirectoryID string
	State       string
}

PendingStandbyWorkspace holds the identity of a newly created standby WorkSpace, matching the real PendingCreateStandbyWorkspacesRequest shape.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon WorkSpaces.

func (*Provider) Init

Init initializes the WorkSpaces service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RelatedWorkspace added in v1.3.4

type RelatedWorkspace struct {
	Region      string `json:"Region,omitempty"`
	State       string `json:"State,omitempty"`
	Type        string `json:"Type,omitempty"`
	WorkspaceID string `json:"WorkspaceId,omitempty"`
}

RelatedWorkspace holds related workspace information.

type StandbyWorkspaceProperties added in v1.3.4

type StandbyWorkspaceProperties struct {
	RecoverySnapshotTime *time.Time `json:"RecoverySnapshotTime,omitempty"`
	StandbyWorkspaceID   string     `json:"StandbyWorkspaceId,omitempty"`
	DataReplication      string     `json:"DataReplication,omitempty"`
}

StandbyWorkspaceProperties holds standby workspace properties.

type StandbyWorkspaceSpec added in v1.2.0

type StandbyWorkspaceSpec struct {
	Tags                map[string]string
	DirectoryID         string
	PrimaryWorkspaceID  string
	DataReplication     string
	VolumeEncryptionKey string
}

StandbyWorkspaceSpec holds the fields for creating a single standby WorkSpace, matching the real StandbyWorkspace request shape (DirectoryId, PrimaryWorkspaceId, DataReplication, Tags, VolumeEncryptionKey -- no UserName/BundleId, unlike WorkspaceCreationSpec).

type StorageBackend

type StorageBackend interface {
	CreateWorkspace(ctx context.Context, spec *WorkspaceCreationSpec) (*Workspace, error)
	DescribeWorkspaces(
		ctx context.Context,
		workspaceIDs, directoryID, userID, bundleID []string,
		limit int32, nextToken string,
	) ([]*Workspace, string, error)
	GetWorkspacesConnectionStatus(workspaceIDs []string) ([]*WorkspaceConnectionStatus, error)
	ModifyWorkspaceProperties(workspaceID string, props WorkspaceProperties) error
	ModifyWorkspaceState(workspaceID, state string) error
	RebootWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	RebuildWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	StartWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	StopWorkspaces(workspaceIDs []string) ([]FailedRequest, error)
	TerminateWorkspaces(workspaceIDs []string) ([]FailedRequest, error)

	CreateTags(resourceID string, tags map[string]string) error
	DeleteTags(resourceID string, tagKeys []string) error
	DescribeTags(resourceID string) (map[string]string, error)

	DescribeWorkspaceBundles(
		ctx context.Context,
		bundleIDs []string,
		owner string,
		nextToken string,
	) ([]*WorkspaceBundle, string, error)
	DescribeWorkspaceDirectories(
		ctx context.Context,
		directoryIDs []string,
		nextToken string,
	) ([]*WorkspaceDirectory, string, error)

	// IP Groups
	CreateIpGroup(
		groupName, groupDesc string,
		userRules []ipRuleItem,
		tags map[string]string,
	) (string, error)
	DescribeIpGroups(
		groupIDs []string,
		maxResults int32,
		nextToken string,
	) ([]*storedIpGroup, string, error)
	DeleteIPGroup(groupID string) error
	AuthorizeIpRules(groupID string, rules []ipRuleItem) error
	RevokeIpRules(groupID string, ipRules []string) error
	UpdateRulesOfIpGroup(groupID string, rules []ipRuleItem) error
	AssociateIpGroups(directoryID string, groupIDs []string) error
	DisassociateIpGroups(directoryID string, groupIDs []string) error

	// Connection Aliases
	CreateConnectionAlias(connectionString string, tags map[string]string) (string, error)
	DescribeConnectionAliases(
		aliasIDs []string, resourceID string, limit int32, nextToken string,
	) ([]*storedConnAlias, string, error)
	DeleteConnectionAlias(aliasID string) error
	AssociateConnectionAlias(aliasID, resourceID string) (string, error)
	DisassociateConnectionAlias(aliasID string) error
	DescribeConnectionAliasPermissions(
		aliasID string, maxResults int32, nextToken string,
	) (string, []connAliasPermission, string, error)
	UpdateConnectionAliasPermission(aliasID, accountID string, allowAssociation bool) error

	// Custom Bundles
	CreateWorkspaceBundle(
		name, description, imageID, computeType string,
		tags map[string]string,
	) (*storedCustomBundle, error)
	DeleteWorkspaceBundle(bundleID string) error
	UpdateWorkspaceBundle(bundleID, imageID string) error
	DescribeBundleAssociations(
		bundleID string, resourceTypes []string,
	) ([]BundleResourceAssociation, error)

	// Images
	CopyWorkspaceImage(
		name, sourceImageID, sourceRegion, description string,
		tags map[string]string,
	) (string, error)
	CreateWorkspaceImage(
		name, description, workspaceID string,
		tags map[string]string,
	) (*storedImage, error)
	DeleteWorkspaceImage(imageID string) error
	ImportWorkspaceImage(
		ec2ImageID, name, description, ingestionProcess string,
		tags map[string]string,
	) (string, error)
	ImportCustomWorkspaceImage(
		name, description string, spec customWorkspaceImageImportSpec,
	) (*storedImage, error)
	CreateUpdatedWorkspaceImage(
		sourceImageID, name, description string,
		tags map[string]string,
	) (string, error)
	DescribeWorkspaceImages(
		imageIDs []string,
		imageType string,
		maxResults int32,
		nextToken string,
	) ([]*storedImage, string, error)
	DescribeWorkspaceImagePermissions(imageID string) (string, map[string]bool, error)
	UpdateWorkspaceImagePermission(imageID, sharedAccountID string, allowCopy bool) error
	DescribeCustomWorkspaceImageImport(imageID string) (*storedImage, error)
	DescribeImageAssociations(
		imageID string, resourceTypes []string,
	) ([]ImageResourceAssociation, error)

	// Pools
	CreateWorkspacesPool(
		poolName, bundleID, directoryID, description, runningMode string,
		desiredUserSessions int32,
		tags map[string]string,
	) (*storedPool, error)
	DescribeWorkspacesPools(
		poolIDs []string,
		limit int32,
		nextToken string,
	) ([]*storedPool, string, error)
	StartWorkspacesPool(poolID string) error
	StopWorkspacesPool(poolID string) error
	TerminateWorkspacesPool(poolID string) error
	UpdateWorkspacesPool(
		poolID, description, bundleID, directoryID, runningMode string,
		desiredUserSessions int32,
	) (*storedPool, error)
	DescribeWorkspacesPoolSessions(
		poolID, userID string,
		limit int32,
		nextToken string,
	) ([]*storedPoolSession, string, error)
	TerminateWorkspacesPoolSession(sessionID string) error

	// Directories
	RegisterWorkspaceDirectory(directoryID string, subnetIDs []string) error
	DeregisterWorkspaceDirectory(directoryID string) error

	// Account
	DescribeAccount() storedAccountConfig
	ModifyAccount(dedicatedTenancyCidr, dedicatedTenancySupport string) error
	ModifyEndpointEncryptionMode(directoryID, mode string) error
	DescribeAccountModifications(
		nextToken string,
	) ([]AccountModification, string, error)
	ListAvailableManagementCidrRanges(
		constraint string, maxResults int32, nextToken string,
	) ([]string, string, error)

	// Connect Client Add-Ins
	CreateConnectClientAddIn(name, resourceID, url string) (string, error)
	DeleteConnectClientAddIn(addInID, resourceID string) error
	DescribeConnectClientAddIns(
		resourceID string,
		maxResults int32,
		nextToken string,
	) ([]*storedConnectAddIn, string, error)
	UpdateConnectClientAddIn(addInID, resourceID, name, url string) error

	// Client Branding
	ImportClientBranding(resourceID string, platforms map[string]map[string]any) error
	DescribeClientBranding(resourceID string) (map[string]map[string]any, error)
	DeleteClientBranding(resourceID string, platforms []string) error

	// Client Properties
	DescribeClientProperties(resourceIDs []string) (map[string]storedClientProps, error)
	ModifyClientProperties(resourceID string, clientExperiencePolicy, logUploadEnabled, reconnectEnabled *string) error

	// Directory modify ops
	ModifyCertificateBasedAuthProperties(directoryID string, props map[string]string, propertiesToDelete []string) error
	ModifySamlProperties(directoryID string, props map[string]string) error
	ModifySelfservicePermissions(directoryID string, props map[string]string) error
	ModifyStreamingProperties(directoryID string, props map[string]string) error
	ModifyWorkspaceAccessProperties(directoryID string, props map[string]string) error
	ModifyWorkspaceCreationProperties(directoryID string, props map[string]string) error

	// Account Links
	CreateAccountLinkInvitation(targetAccountID string) (*storedAccountLink, error)
	AcceptAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	RejectAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	DeleteAccountLinkInvitation(linkID string) (*storedAccountLink, error)
	GetAccountLink(linkID string) (*storedAccountLink, error)
	ListAccountLinks(
		statusFilter string,
		maxResults int32,
		nextToken string,
	) ([]*storedAccountLink, string, error)

	// Applications
	AssociateWorkspaceApplication(
		workspaceID, applicationID string,
	) (WorkspaceResourceAssociation, error)
	DisassociateWorkspaceApplication(
		workspaceID, applicationID string,
	) (WorkspaceResourceAssociation, error)
	DeployWorkspaceApplications(
		workspaceID string, force bool,
	) ([]WorkspaceResourceAssociation, error)
	DescribeWorkspaceAssociations(
		workspaceID string,
		associatedResourceTypes []string,
	) ([]WorkspaceResourceAssociation, error)
	DescribeApplicationAssociations(
		applicationID string, associatedResourceTypes []string, maxResults int32, nextToken string,
	) ([]ApplicationResourceAssociation, string, error)
	DescribeApplications(
		appIDs []string,
		maxResults int32,
		nextToken string,
	) ([]*storedApplication, string, error)

	// Workspace-level ops
	MigrateWorkspace(sourceWorkspaceID, bundleID string) (sourceID, targetID string, err error)
	RestoreWorkspace(workspaceID string) error
	CreateStandbyWorkspace(
		ctx context.Context, spec StandbyWorkspaceSpec,
	) (*PendingStandbyWorkspace, error)

	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for WorkSpaces storage operations.

type Workspace

type Workspace struct {
	Properties                  *WorkspaceProperties
	Tags                        map[string]string
	DataReplicationSettings     *DataReplicationSettings
	VolumeEncryptionKey         string
	State                       string
	ErrorMessage                string
	WorkspaceID                 string
	WorkspaceName               string
	DirectoryID                 string
	UserName                    string
	IPAddress                   string
	BundleID                    string
	ErrorCode                   string
	ComputerName                string
	SubnetID                    string
	StandbyWorkspacesProperties []StandbyWorkspaceProperties
	RelatedWorkspaces           []RelatedWorkspace
	ModificationStates          []ModificationState
	UserVolumeEncryptionEnabled bool
	RootVolumeEncryptionEnabled bool
}

Workspace holds full WorkSpace details.

type WorkspaceBundle

type WorkspaceBundle struct {
	ComputeType BundleComputeType
	BundleID    string
	Name        string
	Owner       string
	Description string
	ImageID     string
	UserStorage BundleStorage
	RootStorage BundleStorage
}

WorkspaceBundle holds WorkSpace bundle details.

type WorkspaceConnectionStatus

type WorkspaceConnectionStatus struct {
	ConnectionStateCheckTimestamp    time.Time
	LastKnownUserConnectionTimestamp time.Time
	WorkspaceID                      string
	ConnectionState                  string
}

WorkspaceConnectionStatus holds connection status for a WorkSpace, matching the real WorkspaceConnectionStatus SDK type's four fields (ConnectionState, ConnectionStateCheckTimestamp, LastKnownUserConnectionTimestamp, WorkspaceId) -- LastKnownUserConnectionTimestamp stays the zero time since this backend models no actual client connection activity.

type WorkspaceCreationSpec

type WorkspaceCreationSpec struct {
	Properties                  *WorkspaceProperties
	Tags                        map[string]string
	UserName                    string
	DirectoryID                 string
	BundleID                    string
	SubnetID                    string
	VolumeEncryptionKey         string
	UserVolumeEncryptionEnabled bool
	RootVolumeEncryptionEnabled bool
}

WorkspaceCreationSpec holds all fields for creating a workspace.

type WorkspaceDirectory

type WorkspaceDirectory struct {
	DirectoryID   string
	DirectoryName string
	DirectoryType string
	Alias         string
	State         string
	SubnetIDs     []string
}

WorkspaceDirectory holds WorkSpace directory details.

type WorkspaceProperties

type WorkspaceProperties struct {
	ComputeTypeName                     string `json:"ComputeTypeName,omitempty"`
	RunningMode                         string `json:"RunningMode,omitempty"`
	RootVolumeSizeGib                   int32  `json:"RootVolumeSizeGib,omitempty"`
	RunningModeAutoStopTimeoutInMinutes int32  `json:"RunningModeAutoStopTimeoutInMinutes,omitempty"`
	UserVolumeSizeGib                   int32  `json:"UserVolumeSizeGib,omitempty"`
}

WorkspaceProperties holds mutable WorkSpace properties.

type WorkspaceResourceAssociation added in v1.3.1

type WorkspaceResourceAssociation struct {
	Created                time.Time
	LastUpdatedTime        time.Time
	AssociatedResourceID   string
	AssociatedResourceType string
	State                  string
	WorkspaceID            string
}

WorkspaceResourceAssociation describes a workspace<->application association, matching the real WorkspaceResourceAssociation SDK type (field-diffed against deserializers.go's awsAwsjson11_deserializeDocumentWorkspaceResourceAssociation: the wire key is "State" with AssociationState enum values, not "AssociationStatus" / "INSTALLED", which don't exist on the real type). This backend applies Associate/Deploy synchronously, so State is always the terminal COMPLETED/REMOVED value -- there is no pending/installing window to model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL