@@ -28,7 +28,7 @@ var _ ProjectAPIKeysService = &ProjectAPIKeysOp{}
2828
2929// AssignAPIKey contains the roles to be assigned to an Organization API key into a Project
3030type AssignAPIKey struct {
31- Roles []string `json:"roles,omitempty "`
31+ Roles []string `json:"roles"`
3232}
3333
3434//List all API-KEY in the organization associated to {GROUP-ID}.
@@ -87,7 +87,7 @@ func (s *ProjectAPIKeysOp) Create(ctx context.Context, groupID string, createReq
8787//See more: https://docs.atlas.mongodb.com/reference/api/projectApiKeys/assign-one-org-apiKey-to-one-project/
8888func (s * ProjectAPIKeysOp ) Assign (ctx context.Context , groupID string , keyID string , assignAPIKeyRequest * AssignAPIKey ) (* Response , error ) {
8989 if groupID == "" {
90- return nil , NewArgError ("apiKeyID " , "must be set" )
90+ return nil , NewArgError ("groupID " , "must be set" )
9191 }
9292
9393 if keyID == "" {
@@ -98,7 +98,7 @@ func (s *ProjectAPIKeysOp) Assign(ctx context.Context, groupID string, keyID str
9898
9999 path := fmt .Sprintf ("%s/%s" , basePath , keyID )
100100
101- req , err := s .client .NewRequest (ctx , http .MethodPost , path , assignAPIKeyRequest )
101+ req , err := s .client .NewRequest (ctx , http .MethodPatch , path , assignAPIKeyRequest )
102102 if err != nil {
103103 return nil , err
104104 }
0 commit comments