Skip to content

Commit

Permalink
Update core clients and update workspace api token to work with new c…
Browse files Browse the repository at this point in the history
…lient (#1540)
  • Loading branch information
vandyliu authored and kushalmalani committed Feb 13, 2024
1 parent e2ab410 commit bf7d553
Show file tree
Hide file tree
Showing 7 changed files with 1,173 additions and 285 deletions.
1,228 changes: 994 additions & 234 deletions astro-client-core/api.gen.go

Large diffs are not rendered by default.

102 changes: 84 additions & 18 deletions astro-client-core/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion astro-client-iam-core/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 37 additions & 12 deletions astro-client-platform-core/api.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions cloud/workspace/workspace_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ func UpdateToken(id, name, newName, description, role, workspace string, out io.

apiTokenID := token.Id

UpdateWorkspaceAPITokenRequest := astrocore.UpdateWorkspaceApiTokenJSONRequestBody{}
UpdateWorkspaceAPITokenRequest := astrocore.UpdateWorkspaceApiTokenJSONRequestBody{
Roles: &astrocore.UpdateWorkspaceApiTokenRolesRequest{},
}

if newName == "" {
UpdateWorkspaceAPITokenRequest.Name = token.Name
Expand All @@ -180,13 +182,13 @@ func UpdateToken(id, name, newName, description, role, workspace string, out io.
if err != nil {
return err
}
UpdateWorkspaceAPITokenRequest.Role = role
UpdateWorkspaceAPITokenRequest.Roles.Workspace = &role
} else {
err := user.IsWorkspaceRoleValid(role)
if err != nil {
return err
}
UpdateWorkspaceAPITokenRequest.Role = role
UpdateWorkspaceAPITokenRequest.Roles.Workspace = &role
}

resp, err := client.UpdateWorkspaceApiTokenWithResponse(httpContext.Background(), ctx.Organization, workspace, apiTokenID, UpdateWorkspaceAPITokenRequest)
Expand Down
Loading

0 comments on commit bf7d553

Please sign in to comment.