func (a CoreAttribute) Uniqueness() string {
	raw, _ := a.uniqueness.MarshalJSON()
	return string(raw)
}
Uniqueness returns the attributes uniqueness.
package schema
import (
	"encoding/json"
	"fmt"
	"regexp"
	"strings"
	datetime "github.com/di-wu/xsd-datetime"
	"github.com/elimity-com/scim/errors"
	"github.com/elimity-com/scim/optional"
)
type CoreAttribute struct {
	canonicalValues []string
	caseExact       bool
	description     optional.String
	multiValued     bool
	mutability      attributeMutability
	name            string
	referenceTypes  []AttributeReferenceType
	required        bool
	returned        attributeReturned
	subAttributes   Attributes
	typ             attributeType
	uniqueness      attributeUniqueness
}
func ComplexCoreAttribute(params ComplexParams) CoreAttribute {
	checkAttributeName(params.Name)
	names := map[string]int{}
	var sa []CoreAttribute
	for i, a := range params.SubAttributes {
		name := strings.ToLower(a.name)
		if j, ok := names[name]; ok {
			panic(fmt.Errorf("duplicate name %q for sub-attributes %d and %d", name, i, j))
		}
		names[name] = i
		sa = append(sa, CoreAttribute{
			canonicalValues: a.canonicalValues,
			caseExact:       a.caseExact,
			description:     a.description,
			multiValued:     a.multiValued,
			mutability:      a.mutability,
			name:            a.name,
			referenceTypes:  a.referenceTypes,
			required:        a.required,
			returned:        a.returned,
			typ:             a.typ,
			uniqueness:      a.uniqueness,
		})
	}
	return CoreAttribute{
		description:   params.Description,
		multiValued:   params.MultiValued,
		mutability:    params.Mutability.m,
		name:          params.Name,
		required:      params.Required,
		returned:      params.Returned.r,
		subAttributes: sa,
		typ:           attributeDataTypeComplex,
		uniqueness:    params.Uniqueness.u,
	}
}
func SimpleCoreAttribute(params SimpleParams) CoreAttribute {
	checkAttributeName(params.name)
	return CoreAttribute{
		canonicalValues: params.canonicalValues,
		caseExact:       params.caseExact,
		description:     params.description,
		multiValued:     params.multiValued,
		mutability:      params.mutability,
		name:            params.name,
		referenceTypes:  params.referenceTypes,
		required:        params.required,
		returned:        params.returned,
		typ:             params.typ,
		uniqueness:      params.uniqueness,
	}
}
func (a CoreAttribute) AttributeType() string {
	return a.typ.String()
}
func (a CoreAttribute) CanonicalValues() []string {
	return a.canonicalValues
}
func (a CoreAttribute) CaseExact() bool {
	return a.caseExact
}
func (a CoreAttribute) Description() string {
	return a.description.Value()
}
func (a CoreAttribute) HasSubAttributes() bool {
	return a.typ == attributeDataTypeComplex && len(a.subAttributes) != 0
}
func (a CoreAttribute) MultiValued() bool {
	return a.multiValued
}
func (a CoreAttribute) Mutability() string {
	raw, _ := a.mutability.MarshalJSON()
	return string(raw)
}
func (a CoreAttribute) Name() string {
	return a.name
}
func (a CoreAttribute) ReferenceTypes() []AttributeReferenceType {
	return a.referenceTypes
}
func (a CoreAttribute) Required() bool {
	return a.required
}
func (a CoreAttribute) Returned() string {
	raw, _ := a.returned.MarshalJSON()
	return string(raw)
}
func (a CoreAttribute) SubAttributes() Attributes {
	return a.subAttributes
}