func (i *InvitesClient) Send(ctx context.Context, email string, orgID, inviterID identity.ID, teamIDs []identity.ID) error {
	invite := apitypes.OrgInvite{}
	now := time.Now()

	inviteBody := primitive.OrgInvite{
		OrgID:        &orgID,
		InviterID:    &inviterID,
		PendingTeams: teamIDs,
		Email:        email,
		Created:      &now,
		// Null values below
		InviteeID:  nil,
		ApproverID: nil,
		Accepted:   nil,
		Approved:   nil,
	}

	ID, err := identity.NewMutable(&inviteBody)
	if err != nil {
		return err
	}

	invite.ID = ID.String()
	invite.Version = 1
	invite.Body = &inviteBody

	req, _, err := i.client.NewRequest("POST", "/org-invites", nil, &invite, true)
	if err != nil {
		return err
	}

	_, err = i.client.Do(ctx, req, nil, nil, nil)
	return err
}
// Send creates a new org invitation
Send creates a new org invitation
// Send creates a new org invitation
func (i *InvitesClient) Send(ctx context.Context, email string, orgID, inviterID identity.ID, teamIDs []identity.ID) error {
	invite := apitypes.OrgInvite{}
	now := time.Now()
	inviteBody := primitive.OrgInvite{
		OrgID:        &orgID,
		InviterID:    &inviterID,
		PendingTeams: teamIDs,
		Email:        email,
		Created:      &now,
		InviteeID:  nil,
		ApproverID: nil,
		Accepted:   nil,
		Approved:   nil,
	}
	ID, err := identity.NewMutable(&inviteBody)
	if err != nil {
		return err
	}
	invite.ID = ID.String()
	invite.Version = 1
	invite.Body = &inviteBody
	req, _, err := i.client.NewRequest("POST", "/org-invites", nil, &invite, true)
	if err != nil {
		return err
	}
	_, err = i.client.Do(ctx, req, nil, nil, nil)
	return err
}
func ( i * InvitesClient ) Send ( ctx context . Context , email string , orgID , inviterID identity . ID , teamIDs [ ] identity . ID ) error { invite := apitypes . OrgInvite { } now := time . Now ( ) inviteBody := primitive . OrgInvite { OrgID : & orgID , InviterID : & inviterID , PendingTeams : teamIDs , Email : email , Created : & now , InviteeID : nil , ApproverID : nil , Accepted : nil , Approved : nil , } ID , err := identity . NewMutable ( & inviteBody ) if err != nil { return err } invite . ID = ID . String ( ) invite . Version = 1 invite . Body = & inviteBody req , _ , err := i . client . NewRequest ( " " , " " , nil , & invite , true ) if err != nil { return err } _ , err = i . client . Do ( ctx , req , nil , nil , nil ) return err }
Send creates a new org invitation
Send creates a new org invitation
// Null values below