From 9fc1df415d7885fb8c688063fcd63f155695f20d Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Thu, 24 Feb 2022 11:19:16 -0800 Subject: [PATCH] change ID to type --- ssh_key.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ssh_key.go b/ssh_key.go index efaec7a97..fd9df760d 100644 --- a/ssh_key.go +++ b/ssh_key.go @@ -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"` @@ -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 {