From d0cd86bfda0feefeee304ff760a7da8c9124bb34 Mon Sep 17 00:00:00 2001 From: Mary Zhong Date: Wed, 8 Nov 2023 00:23:04 -0500 Subject: [PATCH] feat: Support updating the default org creator role --- clerk/instances.go | 2 ++ clerk/instances_test.go | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/clerk/instances.go b/clerk/instances.go index 6322f41..e8757a9 100644 --- a/clerk/instances.go +++ b/clerk/instances.go @@ -91,6 +91,7 @@ type OrganizationSettingsResponse struct { AdminDeleteEnabled bool `json:"admin_delete_enabled"` DomainsEnabled bool `json:"domains_enabled"` DomainsEnrollmentModes []string `json:"domains_enrollment_modes"` + CreatorRole string `json:"creator_role"` } type UpdateOrganizationSettingsParams struct { @@ -99,6 +100,7 @@ type UpdateOrganizationSettingsParams struct { AdminDeleteEnabled *bool `json:"admin_delete_enabled,omitempty"` DomainsEnabled *bool `json:"domains_enabled,omitempty"` DomainsEnrollmentModes []string `json:"domains_enrollment_modes,omitempty"` + CreatorRole string `json:"creator_role,omitempty"` } func (s *InstanceService) UpdateOrganizationSettings(params UpdateOrganizationSettingsParams) (*OrganizationSettingsResponse, error) { diff --git a/clerk/instances_test.go b/clerk/instances_test.go index 5e1560a..e80549d 100644 --- a/clerk/instances_test.go +++ b/clerk/instances_test.go @@ -110,7 +110,8 @@ func TestInstanceService_UpdateOrganizationSettings_happyPath(t *testing.T) { "manual_invitation", "automatic_invitation", "automatic_suggestion" - ] + ], + "creator_role": "org:custom_admin" }` var organizationSettingsResponse OrganizationSettingsResponse _ = json.Unmarshal([]byte(dummyOrganizationSettingsResponseJSON), &organizationSettingsResponse) @@ -125,8 +126,10 @@ func TestInstanceService_UpdateOrganizationSettings_happyPath(t *testing.T) { }) enabled := true + defaultCreatorRole := "org:custom_admin" got, _ := client.Instances().UpdateOrganizationSettings(UpdateOrganizationSettingsParams{ - Enabled: &enabled, + Enabled: &enabled, + CreatorRole: defaultCreatorRole, }) assert.Equal(t, &organizationSettingsResponse, got)