From eb45f1e670cbc9335d15004a5b4a3b8f561393f5 Mon Sep 17 00:00:00 2001 From: David Bloss Date: Fri, 10 Nov 2023 14:21:56 -0600 Subject: [PATCH 1/2] update UserIdentifierInput struct inputs to pointers --- .changes/unreleased/Bugfix-20231110-141748.yaml | 3 +++ src/cmd/team.go | 4 ++-- src/cmd/user.go | 2 +- src/submodules/opslevel-go | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changes/unreleased/Bugfix-20231110-141748.yaml diff --git a/.changes/unreleased/Bugfix-20231110-141748.yaml b/.changes/unreleased/Bugfix-20231110-141748.yaml new file mode 100644 index 00000000..a49ecbb0 --- /dev/null +++ b/.changes/unreleased/Bugfix-20231110-141748.yaml @@ -0,0 +1,3 @@ +kind: Bugfix +body: update UserIdentifierInput to accept pointers, matches updates to opslevel-go +time: 2023-11-10T14:17:48.981065-06:00 diff --git a/src/cmd/team.go b/src/cmd/team.go index 84a4800e..7a617bec 100644 --- a/src/cmd/team.go +++ b/src/cmd/team.go @@ -60,7 +60,7 @@ var createMemberCmd = &cobra.Command{ common.WasFound(team.Id == "", key) teamMembershipUserInput := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: email}, + User: opslevel.UserIdentifierInput{Email: opslevel.NewString(email)}, Role: role, } _, addErr := getClientGQL().AddMemberships(&team.TeamId, teamMembershipUserInput) @@ -244,7 +244,7 @@ var deleteMemberCmd = &cobra.Command{ common.WasFound(team.Id == "", key) teamMembershipUserInput := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: email}, + User: opslevel.UserIdentifierInput{Email: opslevel.NewString(email)}, } _, removeErr := getClientGQL().RemoveMemberships(&team.TeamId, teamMembershipUserInput) cobra.CheckErr(removeErr) diff --git a/src/cmd/user.go b/src/cmd/user.go index 21d98844..62a9ee69 100644 --- a/src/cmd/user.go +++ b/src/cmd/user.go @@ -189,7 +189,7 @@ EOF continue } newMembership := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: user.Email}, + User: opslevel.UserIdentifierInput{Email: opslevel.NewString(user.Email)}, Role: string(user.Role), } _, err = getClientGQL().AddMemberships(&t.TeamId, newMembership) diff --git a/src/submodules/opslevel-go b/src/submodules/opslevel-go index 0543d456..79961b0b 160000 --- a/src/submodules/opslevel-go +++ b/src/submodules/opslevel-go @@ -1 +1 @@ -Subproject commit 0543d456778d0f5c6dd7ba28a4a4daacbec55706 +Subproject commit 79961b0bff6c67d0c511ab6bf3d4b4c3bed8b69d From e6b91acacb908506ae4a62b257d595e09ba63ead Mon Sep 17 00:00:00 2001 From: David Bloss Date: Fri, 10 Nov 2023 15:11:36 -0600 Subject: [PATCH 2/2] use NewUserIdentifier constructor in place of UserIdentifierInput --- src/cmd/team.go | 4 ++-- src/cmd/user.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/team.go b/src/cmd/team.go index 7a617bec..66e3441d 100644 --- a/src/cmd/team.go +++ b/src/cmd/team.go @@ -60,7 +60,7 @@ var createMemberCmd = &cobra.Command{ common.WasFound(team.Id == "", key) teamMembershipUserInput := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: opslevel.NewString(email)}, + User: opslevel.NewUserIdentifier(email), Role: role, } _, addErr := getClientGQL().AddMemberships(&team.TeamId, teamMembershipUserInput) @@ -244,7 +244,7 @@ var deleteMemberCmd = &cobra.Command{ common.WasFound(team.Id == "", key) teamMembershipUserInput := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: opslevel.NewString(email)}, + User: opslevel.NewUserIdentifier(email), } _, removeErr := getClientGQL().RemoveMemberships(&team.TeamId, teamMembershipUserInput) cobra.CheckErr(removeErr) diff --git a/src/cmd/user.go b/src/cmd/user.go index 62a9ee69..e626bbb9 100644 --- a/src/cmd/user.go +++ b/src/cmd/user.go @@ -189,7 +189,7 @@ EOF continue } newMembership := opslevel.TeamMembershipUserInput{ - User: opslevel.UserIdentifierInput{Email: opslevel.NewString(user.Email)}, + User: opslevel.NewUserIdentifier(email), Role: string(user.Role), } _, err = getClientGQL().AddMemberships(&t.TeamId, newMembership)