Skip to content

Commit

Permalink
fix: method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wcrum committed Sep 5, 2024
1 parent c382bf4 commit 122a498
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions client/api_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/spectrocloud/palette-sdk-go/api/models"
)

// GetAPIKeys retrieves all API Keys.
func (h *V1Client) GetAPIKeys() (*models.V1APIKeys, error) {
params := clientv1.NewV1APIKeysListParams()
resp, err := h.Client.V1APIKeysList(params)
Expand All @@ -20,6 +21,7 @@ func (h *V1Client) GetAPIKeys() (*models.V1APIKeys, error) {
return resp.Payload, nil
}

// DeleteAPIKeyByName deletes an existing API Key by name.
func (h *V1Client) DeleteAPIKeyByName(name string) error {
keys, err := h.GetAPIKeys()
if err != nil {
Expand All @@ -33,6 +35,7 @@ func (h *V1Client) DeleteAPIKeyByName(name string) error {
return fmt.Errorf("api key with name '%s' not found", name)
}

// DeleteAPIKey deletes an existing API Key by UID.
func (h *V1Client) DeleteAPIKey(uid string) error {
params := clientv1.NewV1APIKeysUIDDeleteParams().WithUID(uid)
_, err := h.Client.V1APIKeysUIDDelete(params)
Expand Down
2 changes: 1 addition & 1 deletion client/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (h *V1Client) GetProjectUID(projectName string) (string, error) {
return "", fmt.Errorf("project '%s' not found", projectName)
}

// GetProjectByUID retrieves an existing project by UID.
// GetProject retrieves an existing project by UID.
func (h *V1Client) GetProject(uid string) (*models.V1Project, error) {
// ACL scoped to tenant only
params := clientv1.NewV1ProjectsUIDGetParams().
Expand Down
2 changes: 1 addition & 1 deletion client/ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (h *V1Client) GetSSHKeyByName(name string) (*models.V1UserAssetSSH, error)
return nil, fmt.Errorf("ssh key '%s' not found", name)
}

// GetSSHKeyByUID retrieves an existing SSH key by UID.
// GetSSHKey retrieves an existing SSH key by UID.
func (h *V1Client) GetSSHKey(uid string) (*models.V1UserAssetSSH, error) {
params := clientv1.NewV1UsersAssetSSHGetUIDParamsWithContext(h.ctx).
WithUID(uid)
Expand Down
2 changes: 1 addition & 1 deletion client/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (h *V1Client) GetUserByEmail(email string) (*models.V1User, error) {
return nil, fmt.Errorf("user with email '%s' not found", email)
}

// DeleteUserByUID deletes an existing user by UID.
// DeleteUser deletes an existing user by UID.
func (h *V1Client) DeleteUser(uid string) error {
params := clientv1.NewV1UsersUIDDeleteParams().WithUID(uid)
_, err := h.Client.V1UsersUIDDelete(params)
Expand Down

0 comments on commit 122a498

Please sign in to comment.