@@ -29,6 +29,7 @@ type OrganizationsService interface {
2929 List (context.Context , * OrganizationsListOptions ) (* Organizations , * Response , error )
3030 Invitations (context.Context , string , * InvitationOptions ) ([]* Invitation , * Response , error )
3131 Get (context.Context , string ) (* Organization , * Response , error )
32+ Update (context.Context , string , * Organization ) (* Organization , * Response , error )
3233 Create (context.Context , * CreateOrganizationRequest ) (* CreateOrganizationResponse , * Response , error )
3334 Invitation (context.Context , string , string ) (* Invitation , * Response , error )
3435 Projects (context.Context , string , * ProjectsListOptions ) (* Projects , * Response , error )
@@ -138,6 +139,30 @@ func (s *OrganizationsServiceOp) Get(ctx context.Context, orgID string) (*Organi
138139 return root , resp , err
139140}
140141
142+ // Update updates a single organization.
143+ //
144+ // See more: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Organizations/operation/renameOrganization
145+ func (s * OrganizationsServiceOp ) Update (ctx context.Context , orgID string , org * Organization ) (* Organization , * Response , error ) {
146+ if orgID == "" {
147+ return nil , nil , NewArgError ("orgID" , "must be set" )
148+ }
149+
150+ path := fmt .Sprintf ("%s/%s" , orgsBasePath , orgID )
151+
152+ req , err := s .Client .NewRequest (ctx , http .MethodPatch , path , org )
153+ if err != nil {
154+ return nil , nil , err
155+ }
156+
157+ root := new (Organization )
158+ resp , err := s .Client .Do (ctx , req , root )
159+ if err != nil {
160+ return nil , resp , err
161+ }
162+
163+ return root , resp , err
164+ }
165+
141166// Projects gets all projects for the given organization ID.
142167//
143168// See more: https://docs.atlas.mongodb.com/reference/api/organization-get-all-projects/
0 commit comments