Added create account member with policies utility method
@@ -48,7 +48,7 @@ type AccountMemberDetailResponse struct {
// the account.
type AccountMemberInvitation struct {
Email string `json:"email"`
- Roles []string `json:"roles"`
+ Roles []string `json:"roles,omitempty"`
Policies []Policy `json:"policies,omitempty"`
Status string `json:"status,omitempty"`
}
@@ -106,6 +106,16 @@ func (api *API) CreateAccountMemberWithRoles(ctx context.Context, accountID stri
return api.CreateAccountMember(ctx, accountID, invite)
}
+func (api *API) CreateAccountMemberWithPolicies(ctx context.Context, accountID string, emailAddress string, policies []Policy) (AccountMember, error) {
+ invite := AccountMemberInvitation{
+ Email: emailAddress,
+ Roles: nil,
+ Policies: policies,
+ Status: "",
+ }
+ return api.CreateAccountMember(ctx, accountID, invite)
+}
+
func (api *API) CreateAccountMember(ctx context.Context, accountID string, invite AccountMemberInvitation) (AccountMember, error) {
// make sure we have account
if accountID == "" {
