@@ -17,38 +17,38 @@ type DevURL struct {
17
17
}
18
18
19
19
type delDevURLRequest struct {
20
- EnvID string `json:"environment_id "`
21
- DevURLID string `json:"url_id"`
20
+ WorkspaceID string `json:"workspace_id "`
21
+ DevURLID string `json:"url_id"`
22
22
}
23
23
24
24
// DeleteDevURL deletes the specified devurl.
25
- func (c * DefaultClient ) DeleteDevURL (ctx context.Context , envID , urlID string ) error {
26
- reqURL := fmt .Sprintf ("/api/v0/environments /%s/devurls/%s" , envID , urlID )
25
+ func (c * DefaultClient ) DeleteDevURL (ctx context.Context , workspaceID , urlID string ) error {
26
+ reqURL := fmt .Sprintf ("/api/v0/workspaces /%s/devurls/%s" , workspaceID , urlID )
27
27
28
28
return c .requestBody (ctx , http .MethodDelete , reqURL , delDevURLRequest {
29
- EnvID : envID ,
30
- DevURLID : urlID ,
29
+ WorkspaceID : workspaceID ,
30
+ DevURLID : urlID ,
31
31
}, nil )
32
32
}
33
33
34
34
// CreateDevURLReq defines the request parameters for creating a new DevURL.
35
35
type CreateDevURLReq struct {
36
- EnvID string `json:"environment_id "`
37
- Port int `json:"port"`
38
- Access string `json:"access"`
39
- Name string `json:"name"`
40
- Scheme string `json:"scheme"`
36
+ WorkspaceID string `json:"workspace_id "`
37
+ Port int `json:"port"`
38
+ Access string `json:"access"`
39
+ Name string `json:"name"`
40
+ Scheme string `json:"scheme"`
41
41
}
42
42
43
43
// CreateDevURL inserts a new dev URL for the authenticated user.
44
- func (c * DefaultClient ) CreateDevURL (ctx context.Context , envID string , req CreateDevURLReq ) error {
45
- return c .requestBody (ctx , http .MethodPost , "/api/v0/environments /" + envID + "/devurls" , req , nil )
44
+ func (c * DefaultClient ) CreateDevURL (ctx context.Context , workspaceID string , req CreateDevURLReq ) error {
45
+ return c .requestBody (ctx , http .MethodPost , "/api/v0/workspaces /" + workspaceID + "/devurls" , req , nil )
46
46
}
47
47
48
- // DevURLs fetches the Dev URLs for a given environment .
49
- func (c * DefaultClient ) DevURLs (ctx context.Context , envID string ) ([]DevURL , error ) {
48
+ // DevURLs fetches the Dev URLs for a given workspace .
49
+ func (c * DefaultClient ) DevURLs (ctx context.Context , workspaceID string ) ([]DevURL , error ) {
50
50
var devurls []DevURL
51
- if err := c .requestBody (ctx , http .MethodGet , "/api/v0/environments /" + envID + "/devurls" , nil , & devurls ); err != nil {
51
+ if err := c .requestBody (ctx , http .MethodGet , "/api/v0/workspaces /" + workspaceID + "/devurls" , nil , & devurls ); err != nil {
52
52
return nil , err
53
53
}
54
54
return devurls , nil
@@ -58,6 +58,6 @@ func (c *DefaultClient) DevURLs(ctx context.Context, envID string) ([]DevURL, er
58
58
type PutDevURLReq CreateDevURLReq
59
59
60
60
// PutDevURL updates an existing devurl for the authenticated user.
61
- func (c * DefaultClient ) PutDevURL (ctx context.Context , envID , urlID string , req PutDevURLReq ) error {
62
- return c .requestBody (ctx , http .MethodPut , "/api/v0/environments /" + envID + "/devurls/" + urlID , req , nil )
61
+ func (c * DefaultClient ) PutDevURL (ctx context.Context , workspaceID , urlID string , req PutDevURLReq ) error {
62
+ return c .requestBody (ctx , http .MethodPut , "/api/v0/workspaces /" + workspaceID + "/devurls/" + urlID , req , nil )
63
63
}
0 commit comments