(Workspaces)
Retrieve a workspace for the authenticated user.
package main
import(
dubgo "github.com/dubinc/dub-go"
"context"
"github.com/dubinc/dub-go/models/operations"
"log"
)
func main() {
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
ctx := context.Background()
res, err := s.Workspaces.Get(ctx, operations.GetWorkspaceRequest{
IDOrSlug: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetWorkspaceRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.WorkspaceSchema, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.BadRequest | 400 | application/json |
sdkerrors.Unauthorized | 401 | application/json |
sdkerrors.Forbidden | 403 | application/json |
sdkerrors.NotFound | 404 | application/json |
sdkerrors.Conflict | 409 | application/json |
sdkerrors.InviteExpired | 410 | application/json |
sdkerrors.UnprocessableEntity | 422 | application/json |
sdkerrors.RateLimitExceeded | 429 | application/json |
sdkerrors.InternalServerError | 500 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Update a workspace by ID or slug.
package main
import(
dubgo "github.com/dubinc/dub-go"
"context"
"log"
)
func main() {
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
ctx := context.Background()
res, err := s.Workspaces.Update(ctx, "<value>", nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
idOrSlug |
string | ✔️ | The ID or slug of the workspace to update. |
requestBody |
*operations.UpdateWorkspaceRequestBody | ➖ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.WorkspaceSchema, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.BadRequest | 400 | application/json |
sdkerrors.Unauthorized | 401 | application/json |
sdkerrors.Forbidden | 403 | application/json |
sdkerrors.NotFound | 404 | application/json |
sdkerrors.Conflict | 409 | application/json |
sdkerrors.InviteExpired | 410 | application/json |
sdkerrors.UnprocessableEntity | 422 | application/json |
sdkerrors.RateLimitExceeded | 429 | application/json |
sdkerrors.InternalServerError | 500 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |