Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ID to type #332

Merged
merged 1 commit into from Feb 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions ssh_key.go
Expand Up @@ -147,8 +147,11 @@ func (s *sshKeys) Read(ctx context.Context, sshKeyID string) (*SSHKey, error) {

// SSHKeyUpdateOptions represents the options for updating an SSH key.
type SSHKeyUpdateOptions struct {
// For internal use only!
ID string `jsonapi:"primary,ssh-keys"`
// Type is a public field utilized by JSON:API to
// set the resource type via the field tag.
// It is not a user-defined value and does not need to be set.
// https://jsonapi.org/format/#crud-creating
Type string `jsonapi:"primary,ssh-keys"`

// A new name to identify the SSH key.
Name *string `jsonapi:"attr,name,omitempty"`
Expand All @@ -160,9 +163,6 @@ func (s *sshKeys) Update(ctx context.Context, sshKeyID string, options SSHKeyUpd
return nil, ErrInvalidSHHKeyID
}

// Make sure we don't send a user provided ID.
options.ID = ""

u := fmt.Sprintf("ssh-keys/%s", url.QueryEscape(sshKeyID))
req, err := s.client.newRequest("PATCH", u, &options)
if err != nil {
Expand Down