func (t *TeamsClient) Create(
	ctx context.Context, orgID *identity.ID, name, teamType string) (*apitypes.Team, error) {
	if orgID == nil {
		return nil, errors.New("invalid org")
	}

	if teamType == "" {
		teamType = primitive.UserTeam
	}

	teamBody := primitive.Team{
		Name:     name,
		OrgID:    orgID,
		TeamType: teamType,
	}

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

	team := apitypes.Team{
		ID:      &ID,
		Version: 1,
		Body:    &teamBody,
	}

	req, _, err := t.client.NewRequest("POST", "/teams", nil, team, true)
	if err != nil {
		return nil, err
	}

	teamResult := &apitypes.Team{}
	_, err = t.client.Do(ctx, req, teamResult, nil, nil)
	return teamResult, err
}
// Create performs a request to create a new team object
Create performs a request to create a new team object
// Create performs a request to create a new team object
func (t *TeamsClient) Create(
	ctx context.Context, orgID *identity.ID, name, teamType string) (*apitypes.Team, error) {
	if orgID == nil {
		return nil, errors.New("invalid org")
	}
	if teamType == "" {
		teamType = primitive.UserTeam
	}
	teamBody := primitive.Team{
		Name:     name,
		OrgID:    orgID,
		TeamType: teamType,
	}
	ID, err := identity.NewMutable(&teamBody)
	if err != nil {
		return nil, err
	}
	team := apitypes.Team{
		ID:      &ID,
		Version: 1,
		Body:    &teamBody,
	}
	req, _, err := t.client.NewRequest("POST", "/teams", nil, team, true)
	if err != nil {
		return nil, err
	}
	teamResult := &apitypes.Team{}
	_, err = t.client.Do(ctx, req, teamResult, nil, nil)
	return teamResult, err
}
func ( t * TeamsClient ) Create ( ctx context . Context , orgID * identity . ID , name , teamType string ) ( * apitypes . Team , error ) { if orgID == nil { return nil , errors . New ( " " ) } if teamType == " " { teamType = primitive . UserTeam } teamBody := primitive . Team { Name : name , OrgID : orgID , TeamType : teamType , } ID , err := identity . NewMutable ( & teamBody ) if err != nil { return nil , err } team := apitypes . Team { ID : & ID , Version : 1 , Body : & teamBody , } req , _ , err := t . client . NewRequest ( " " , " " , nil , team , true ) if err != nil { return nil , err } teamResult := & apitypes . Team { } _ , err = t . client . Do ( ctx , req , teamResult , nil , nil ) return teamResult , err }
Create performs a request to create a new team object
Create performs a request to create a new team object