Skip to content

Commit 2deeaa3

Browse files
committed
feat(machine): Add ability to create machines in off state.
BREAKING CHANGE: Moves bool machine create and update request params to *bool and adds pointer helpers.
1 parent ffec31e commit 2deeaa3

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

machine.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ type MachineCreateParams struct {
5555
TeamID string `json:"teamId,omitempty"`
5656
ScriptID string `json:"scriptId,omitempty"`
5757
NetworkID string `json:"networkId,omitempty"`
58-
ShutdownTimeoutInHours bool `json:"shutdownTimeoutInHours,omitempty"`
59-
AssignPublicIP bool `json:"assignPublicIP,omitempty"`
60-
IsManaged bool `json:"isManaged,omitempty"`
58+
ShutdownTimeoutInHours int `json:"shutdownTimeoutInHours,omitempty"`
59+
AssignPublicIP *bool `json:"assignPublicIP,omitempty"`
60+
IsManaged *bool `json:"isManaged,omitempty"`
61+
StartOnCreate *bool `json:"startOnCreate,omitempty"`
6162
}
6263

6364
type MachineDeleteParams struct {
@@ -86,11 +87,11 @@ type MachineUpdateParams struct {
8687
ID string `json:"machineId"`
8788
Name string `json:"machineName,omitempty"`
8889
ShutdownTimeoutInHours int `json:"shutdownTimeoutInHours,omitempty"`
89-
ShutdownTimeoutForces bool `json:"shutdownTimeoutForces,omitempty"`
90+
ShutdownTimeoutForces *bool `json:"shutdownTimeoutForces,omitempty"`
9091
AutoSnapshotFrequency string `json:"autoSnapshotFrequency,omitempty"`
9192
AutoSnapshotSaveCount int `json:"autoSnapshotSaveCount,omitempty"`
92-
PerformAutoSnapshot bool `json:"performAutoSnapshot,omitempty"`
93-
DynamicPublicIP bool `json:"dynamicPublicIp,omitempty"`
93+
PerformAutoSnapshot *bool `json:"performAutoSnapshot,omitempty"`
94+
DynamicPublicIP *bool `json:"dynamicPublicIp,omitempty"`
9495
}
9596

9697
func NewMachineListParams() MachineListParams {

types.go

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package paperspace
2+
3+
func Boolean(v bool) *bool {
4+
return &v
5+
}
6+
7+
func String(v string) *string {
8+
return &v
9+
}
10+
11+
func Int(v int) *int {
12+
return &v
13+
}

0 commit comments

Comments
 (0)