Skip to content

Commit

Permalink
feat(workspaces): create workspaces types
Browse files Browse the repository at this point in the history
  • Loading branch information
mijailr committed Oct 3, 2020
1 parent 8f38f0d commit 1d78fa5
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/types/Workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Params, TerraformCloudData } from './TerraformCloudData'

export type WorkspaceCreate = Params<'workspaces', WorkspaceCreateAttributes>

export interface WorkspaceCreateAttributes {
name: string
agentPoolId?: string
allowDestroyPlan?: boolean
autoApply?: boolean
description?: string
executionMode?: string
fileTriggersEnabled?: boolean
sourceName?: string
sourceUrl?: string
queueAllRuns?: boolean
speculativeEnabled?: boolean
terraformVersion?: string
triggerPrefixes?: []
workingDirectory?: string
vcsRepo?: WorkspaceVcsRepoCreate
}

export interface WorkspaceVcsRepoCreate {
oauthTokenId: string
branch?: string
ingressSubmodules?: boolean
identifier: string
}

export type Workspace = TerraformCloudData<WorkspaceAttributes>

export interface WorkspaceAttributes {
autoApply: boolean
allowDestroyPlan: boolean
canQueueDestroyPlan: boolean
createdAt: Date
environment: string
fileTriggersEnabled: boolean
locked: boolean
name: string
permissions: WorkspacePermissions
queueAllRuns: boolean
terraformVersion: string
triggerPrefixes: []
vcsRepo: null
workingDirectory: string
executionMode: string
}

export interface WorkspacePermissions {
canUpdate: boolean
canDestroy: boolean
canQueueDestroy: boolean
canQueueRun: boolean
canUpdateVariable: boolean
canLock: boolean
canReadSettings: boolean
}
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './User'
export * from './Plan'
export * from './Run'
export * from './TerraformCloudData'
export * from './Workspace'

0 comments on commit 1d78fa5

Please sign in to comment.