// Code generated by Fern. DO NOT EDIT.

package api

import (
	json "encoding/json"
	fmt "fmt"
	big "math/big"
	internal "pentagi/pkg/observability/langfuse/api/internal"
)

var (
	sCIMCreateUserRequestFieldUserName = big.NewInt(1 << 0)
	sCIMCreateUserRequestFieldName     = big.NewInt(1 << 1)
	sCIMCreateUserRequestFieldEmails   = big.NewInt(1 << 2)
	sCIMCreateUserRequestFieldActive   = big.NewInt(1 << 3)
	sCIMCreateUserRequestFieldPassword = big.NewInt(1 << 4)
)

type SCIMCreateUserRequest struct {
	// User's email address (required)
	UserName string `json:"userName" url:"-"`
	// User's name information
	Name *SCIMName `json:"name" url:"-"`
	// User's email addresses
	Emails []*SCIMEmail `json:"emails,omitempty" url:"-"`
	// Whether the user is active
	Active *bool `json:"active,omitempty" url:"-"`
	// Initial password for the user
	Password *string `json:"password,omitempty" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (s *SCIMCreateUserRequest) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetUserName sets the UserName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMCreateUserRequest) SetUserName(userName string) {
	s.UserName = userName
	s.require(sCIMCreateUserRequestFieldUserName)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMCreateUserRequest) SetName(name *SCIMName) {
	s.Name = name
	s.require(sCIMCreateUserRequestFieldName)
}

// SetEmails sets the Emails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMCreateUserRequest) SetEmails(emails []*SCIMEmail) {
	s.Emails = emails
	s.require(sCIMCreateUserRequestFieldEmails)
}

// SetActive sets the Active field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMCreateUserRequest) SetActive(active *bool) {
	s.Active = active
	s.require(sCIMCreateUserRequestFieldActive)
}

// SetPassword sets the Password field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMCreateUserRequest) SetPassword(password *string) {
	s.Password = password
	s.require(sCIMCreateUserRequestFieldPassword)
}

func (s *SCIMCreateUserRequest) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMCreateUserRequest
	var body unmarshaler
	if err := json.Unmarshal(data, &body); err != nil {
		return err
	}
	*s = SCIMCreateUserRequest(body)
	return nil
}

func (s *SCIMCreateUserRequest) MarshalJSON() ([]byte, error) {
	type embed SCIMCreateUserRequest
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

var (
	sCIMDeleteUserRequestFieldUserID = big.NewInt(1 << 0)
)

type SCIMDeleteUserRequest struct {
	UserID string `json:"-" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (s *SCIMDeleteUserRequest) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetUserID sets the UserID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMDeleteUserRequest) SetUserID(userID string) {
	s.UserID = userID
	s.require(sCIMDeleteUserRequestFieldUserID)
}

var (
	sCIMGetUserRequestFieldUserID = big.NewInt(1 << 0)
)

type SCIMGetUserRequest struct {
	UserID string `json:"-" url:"-"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (s *SCIMGetUserRequest) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetUserID sets the UserID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMGetUserRequest) SetUserID(userID string) {
	s.UserID = userID
	s.require(sCIMGetUserRequestFieldUserID)
}

var (
	sCIMListUsersRequestFieldFilter     = big.NewInt(1 << 0)
	sCIMListUsersRequestFieldStartIndex = big.NewInt(1 << 1)
	sCIMListUsersRequestFieldCount      = big.NewInt(1 << 2)
)

type SCIMListUsersRequest struct {
	// Filter expression (e.g. userName eq "value")
	Filter *string `json:"-" url:"filter,omitempty"`
	// 1-based index of the first result to return (default 1)
	StartIndex *int `json:"-" url:"startIndex,omitempty"`
	// Maximum number of results to return (default 100)
	Count *int `json:"-" url:"count,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`
}

func (s *SCIMListUsersRequest) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetFilter sets the Filter field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMListUsersRequest) SetFilter(filter *string) {
	s.Filter = filter
	s.require(sCIMListUsersRequestFieldFilter)
}

// SetStartIndex sets the StartIndex field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMListUsersRequest) SetStartIndex(startIndex *int) {
	s.StartIndex = startIndex
	s.require(sCIMListUsersRequestFieldStartIndex)
}

// SetCount sets the Count field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMListUsersRequest) SetCount(count *int) {
	s.Count = count
	s.require(sCIMListUsersRequestFieldCount)
}

var (
	authenticationSchemeFieldName        = big.NewInt(1 << 0)
	authenticationSchemeFieldDescription = big.NewInt(1 << 1)
	authenticationSchemeFieldSpecURI     = big.NewInt(1 << 2)
	authenticationSchemeFieldType        = big.NewInt(1 << 3)
	authenticationSchemeFieldPrimary     = big.NewInt(1 << 4)
)

type AuthenticationScheme struct {
	Name        string `json:"name" url:"name"`
	Description string `json:"description" url:"description"`
	SpecURI     string `json:"specUri" url:"specUri"`
	Type        string `json:"type" url:"type"`
	Primary     bool   `json:"primary" url:"primary"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (a *AuthenticationScheme) GetName() string {
	if a == nil {
		return ""
	}
	return a.Name
}

func (a *AuthenticationScheme) GetDescription() string {
	if a == nil {
		return ""
	}
	return a.Description
}

func (a *AuthenticationScheme) GetSpecURI() string {
	if a == nil {
		return ""
	}
	return a.SpecURI
}

func (a *AuthenticationScheme) GetType() string {
	if a == nil {
		return ""
	}
	return a.Type
}

func (a *AuthenticationScheme) GetPrimary() bool {
	if a == nil {
		return false
	}
	return a.Primary
}

func (a *AuthenticationScheme) GetExtraProperties() map[string]interface{} {
	return a.extraProperties
}

func (a *AuthenticationScheme) require(field *big.Int) {
	if a.explicitFields == nil {
		a.explicitFields = big.NewInt(0)
	}
	a.explicitFields.Or(a.explicitFields, field)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (a *AuthenticationScheme) SetName(name string) {
	a.Name = name
	a.require(authenticationSchemeFieldName)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (a *AuthenticationScheme) SetDescription(description string) {
	a.Description = description
	a.require(authenticationSchemeFieldDescription)
}

// SetSpecURI sets the SpecURI field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (a *AuthenticationScheme) SetSpecURI(specURI string) {
	a.SpecURI = specURI
	a.require(authenticationSchemeFieldSpecURI)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (a *AuthenticationScheme) SetType(type_ string) {
	a.Type = type_
	a.require(authenticationSchemeFieldType)
}

// SetPrimary sets the Primary field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (a *AuthenticationScheme) SetPrimary(primary bool) {
	a.Primary = primary
	a.require(authenticationSchemeFieldPrimary)
}

func (a *AuthenticationScheme) UnmarshalJSON(data []byte) error {
	type unmarshaler AuthenticationScheme
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*a = AuthenticationScheme(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *a)
	if err != nil {
		return err
	}
	a.extraProperties = extraProperties
	a.rawJSON = json.RawMessage(data)
	return nil
}

func (a *AuthenticationScheme) MarshalJSON() ([]byte, error) {
	type embed AuthenticationScheme
	var marshaler = struct {
		embed
	}{
		embed: embed(*a),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (a *AuthenticationScheme) String() string {
	if len(a.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(a.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(a); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", a)
}

var (
	bulkConfigFieldSupported      = big.NewInt(1 << 0)
	bulkConfigFieldMaxOperations  = big.NewInt(1 << 1)
	bulkConfigFieldMaxPayloadSize = big.NewInt(1 << 2)
)

type BulkConfig struct {
	Supported      bool `json:"supported" url:"supported"`
	MaxOperations  int  `json:"maxOperations" url:"maxOperations"`
	MaxPayloadSize int  `json:"maxPayloadSize" url:"maxPayloadSize"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (b *BulkConfig) GetSupported() bool {
	if b == nil {
		return false
	}
	return b.Supported
}

func (b *BulkConfig) GetMaxOperations() int {
	if b == nil {
		return 0
	}
	return b.MaxOperations
}

func (b *BulkConfig) GetMaxPayloadSize() int {
	if b == nil {
		return 0
	}
	return b.MaxPayloadSize
}

func (b *BulkConfig) GetExtraProperties() map[string]interface{} {
	return b.extraProperties
}

func (b *BulkConfig) require(field *big.Int) {
	if b.explicitFields == nil {
		b.explicitFields = big.NewInt(0)
	}
	b.explicitFields.Or(b.explicitFields, field)
}

// SetSupported sets the Supported field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BulkConfig) SetSupported(supported bool) {
	b.Supported = supported
	b.require(bulkConfigFieldSupported)
}

// SetMaxOperations sets the MaxOperations field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BulkConfig) SetMaxOperations(maxOperations int) {
	b.MaxOperations = maxOperations
	b.require(bulkConfigFieldMaxOperations)
}

// SetMaxPayloadSize sets the MaxPayloadSize field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (b *BulkConfig) SetMaxPayloadSize(maxPayloadSize int) {
	b.MaxPayloadSize = maxPayloadSize
	b.require(bulkConfigFieldMaxPayloadSize)
}

func (b *BulkConfig) UnmarshalJSON(data []byte) error {
	type unmarshaler BulkConfig
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*b = BulkConfig(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *b)
	if err != nil {
		return err
	}
	b.extraProperties = extraProperties
	b.rawJSON = json.RawMessage(data)
	return nil
}

func (b *BulkConfig) MarshalJSON() ([]byte, error) {
	type embed BulkConfig
	var marshaler = struct {
		embed
	}{
		embed: embed(*b),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (b *BulkConfig) String() string {
	if len(b.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(b.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(b); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", b)
}

// Empty response for 204 No Content responses
type EmptyResponse struct {

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EmptyResponse) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EmptyResponse) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

func (e *EmptyResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler EmptyResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EmptyResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EmptyResponse) MarshalJSON() ([]byte, error) {
	type embed EmptyResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EmptyResponse) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

var (
	filterConfigFieldSupported  = big.NewInt(1 << 0)
	filterConfigFieldMaxResults = big.NewInt(1 << 1)
)

type FilterConfig struct {
	Supported  bool `json:"supported" url:"supported"`
	MaxResults int  `json:"maxResults" url:"maxResults"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (f *FilterConfig) GetSupported() bool {
	if f == nil {
		return false
	}
	return f.Supported
}

func (f *FilterConfig) GetMaxResults() int {
	if f == nil {
		return 0
	}
	return f.MaxResults
}

func (f *FilterConfig) GetExtraProperties() map[string]interface{} {
	return f.extraProperties
}

func (f *FilterConfig) require(field *big.Int) {
	if f.explicitFields == nil {
		f.explicitFields = big.NewInt(0)
	}
	f.explicitFields.Or(f.explicitFields, field)
}

// SetSupported sets the Supported field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (f *FilterConfig) SetSupported(supported bool) {
	f.Supported = supported
	f.require(filterConfigFieldSupported)
}

// SetMaxResults sets the MaxResults field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (f *FilterConfig) SetMaxResults(maxResults int) {
	f.MaxResults = maxResults
	f.require(filterConfigFieldMaxResults)
}

func (f *FilterConfig) UnmarshalJSON(data []byte) error {
	type unmarshaler FilterConfig
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*f = FilterConfig(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *f)
	if err != nil {
		return err
	}
	f.extraProperties = extraProperties
	f.rawJSON = json.RawMessage(data)
	return nil
}

func (f *FilterConfig) MarshalJSON() ([]byte, error) {
	type embed FilterConfig
	var marshaler = struct {
		embed
	}{
		embed: embed(*f),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (f *FilterConfig) String() string {
	if len(f.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(f.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(f); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", f)
}

var (
	resourceMetaFieldResourceType = big.NewInt(1 << 0)
	resourceMetaFieldLocation     = big.NewInt(1 << 1)
)

type ResourceMeta struct {
	ResourceType string `json:"resourceType" url:"resourceType"`
	Location     string `json:"location" url:"location"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (r *ResourceMeta) GetResourceType() string {
	if r == nil {
		return ""
	}
	return r.ResourceType
}

func (r *ResourceMeta) GetLocation() string {
	if r == nil {
		return ""
	}
	return r.Location
}

func (r *ResourceMeta) GetExtraProperties() map[string]interface{} {
	return r.extraProperties
}

func (r *ResourceMeta) require(field *big.Int) {
	if r.explicitFields == nil {
		r.explicitFields = big.NewInt(0)
	}
	r.explicitFields.Or(r.explicitFields, field)
}

// SetResourceType sets the ResourceType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceMeta) SetResourceType(resourceType string) {
	r.ResourceType = resourceType
	r.require(resourceMetaFieldResourceType)
}

// SetLocation sets the Location field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceMeta) SetLocation(location string) {
	r.Location = location
	r.require(resourceMetaFieldLocation)
}

func (r *ResourceMeta) UnmarshalJSON(data []byte) error {
	type unmarshaler ResourceMeta
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*r = ResourceMeta(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *r)
	if err != nil {
		return err
	}
	r.extraProperties = extraProperties
	r.rawJSON = json.RawMessage(data)
	return nil
}

func (r *ResourceMeta) MarshalJSON() ([]byte, error) {
	type embed ResourceMeta
	var marshaler = struct {
		embed
	}{
		embed: embed(*r),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (r *ResourceMeta) String() string {
	if len(r.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(r.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(r); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", r)
}

var (
	resourceTypeFieldSchemas          = big.NewInt(1 << 0)
	resourceTypeFieldID               = big.NewInt(1 << 1)
	resourceTypeFieldName             = big.NewInt(1 << 2)
	resourceTypeFieldEndpoint         = big.NewInt(1 << 3)
	resourceTypeFieldDescription      = big.NewInt(1 << 4)
	resourceTypeFieldSchema           = big.NewInt(1 << 5)
	resourceTypeFieldSchemaExtensions = big.NewInt(1 << 6)
	resourceTypeFieldMeta             = big.NewInt(1 << 7)
)

type ResourceType struct {
	Schemas          []string           `json:"schemas,omitempty" url:"schemas,omitempty"`
	ID               string             `json:"id" url:"id"`
	Name             string             `json:"name" url:"name"`
	Endpoint         string             `json:"endpoint" url:"endpoint"`
	Description      string             `json:"description" url:"description"`
	Schema           string             `json:"schema" url:"schema"`
	SchemaExtensions []*SchemaExtension `json:"schemaExtensions" url:"schemaExtensions"`
	Meta             *ResourceMeta      `json:"meta" url:"meta"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (r *ResourceType) GetSchemas() []string {
	if r == nil {
		return nil
	}
	return r.Schemas
}

func (r *ResourceType) GetID() string {
	if r == nil {
		return ""
	}
	return r.ID
}

func (r *ResourceType) GetName() string {
	if r == nil {
		return ""
	}
	return r.Name
}

func (r *ResourceType) GetEndpoint() string {
	if r == nil {
		return ""
	}
	return r.Endpoint
}

func (r *ResourceType) GetDescription() string {
	if r == nil {
		return ""
	}
	return r.Description
}

func (r *ResourceType) GetSchema() string {
	if r == nil {
		return ""
	}
	return r.Schema
}

func (r *ResourceType) GetSchemaExtensions() []*SchemaExtension {
	if r == nil {
		return nil
	}
	return r.SchemaExtensions
}

func (r *ResourceType) GetMeta() *ResourceMeta {
	if r == nil {
		return nil
	}
	return r.Meta
}

func (r *ResourceType) GetExtraProperties() map[string]interface{} {
	return r.extraProperties
}

func (r *ResourceType) require(field *big.Int) {
	if r.explicitFields == nil {
		r.explicitFields = big.NewInt(0)
	}
	r.explicitFields.Or(r.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetSchemas(schemas []string) {
	r.Schemas = schemas
	r.require(resourceTypeFieldSchemas)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetID(id string) {
	r.ID = id
	r.require(resourceTypeFieldID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetName(name string) {
	r.Name = name
	r.require(resourceTypeFieldName)
}

// SetEndpoint sets the Endpoint field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetEndpoint(endpoint string) {
	r.Endpoint = endpoint
	r.require(resourceTypeFieldEndpoint)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetDescription(description string) {
	r.Description = description
	r.require(resourceTypeFieldDescription)
}

// SetSchema sets the Schema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetSchema(schema string) {
	r.Schema = schema
	r.require(resourceTypeFieldSchema)
}

// SetSchemaExtensions sets the SchemaExtensions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetSchemaExtensions(schemaExtensions []*SchemaExtension) {
	r.SchemaExtensions = schemaExtensions
	r.require(resourceTypeFieldSchemaExtensions)
}

// SetMeta sets the Meta field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceType) SetMeta(meta *ResourceMeta) {
	r.Meta = meta
	r.require(resourceTypeFieldMeta)
}

func (r *ResourceType) UnmarshalJSON(data []byte) error {
	type unmarshaler ResourceType
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*r = ResourceType(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *r)
	if err != nil {
		return err
	}
	r.extraProperties = extraProperties
	r.rawJSON = json.RawMessage(data)
	return nil
}

func (r *ResourceType) MarshalJSON() ([]byte, error) {
	type embed ResourceType
	var marshaler = struct {
		embed
	}{
		embed: embed(*r),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (r *ResourceType) String() string {
	if len(r.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(r.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(r); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", r)
}

var (
	resourceTypesResponseFieldSchemas      = big.NewInt(1 << 0)
	resourceTypesResponseFieldTotalResults = big.NewInt(1 << 1)
	resourceTypesResponseFieldResources    = big.NewInt(1 << 2)
)

type ResourceTypesResponse struct {
	Schemas      []string        `json:"schemas" url:"schemas"`
	TotalResults int             `json:"totalResults" url:"totalResults"`
	Resources    []*ResourceType `json:"Resources" url:"Resources"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (r *ResourceTypesResponse) GetSchemas() []string {
	if r == nil {
		return nil
	}
	return r.Schemas
}

func (r *ResourceTypesResponse) GetTotalResults() int {
	if r == nil {
		return 0
	}
	return r.TotalResults
}

func (r *ResourceTypesResponse) GetResources() []*ResourceType {
	if r == nil {
		return nil
	}
	return r.Resources
}

func (r *ResourceTypesResponse) GetExtraProperties() map[string]interface{} {
	return r.extraProperties
}

func (r *ResourceTypesResponse) require(field *big.Int) {
	if r.explicitFields == nil {
		r.explicitFields = big.NewInt(0)
	}
	r.explicitFields.Or(r.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceTypesResponse) SetSchemas(schemas []string) {
	r.Schemas = schemas
	r.require(resourceTypesResponseFieldSchemas)
}

// SetTotalResults sets the TotalResults field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceTypesResponse) SetTotalResults(totalResults int) {
	r.TotalResults = totalResults
	r.require(resourceTypesResponseFieldTotalResults)
}

// SetResources sets the Resources field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (r *ResourceTypesResponse) SetResources(resources []*ResourceType) {
	r.Resources = resources
	r.require(resourceTypesResponseFieldResources)
}

func (r *ResourceTypesResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler ResourceTypesResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*r = ResourceTypesResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *r)
	if err != nil {
		return err
	}
	r.extraProperties = extraProperties
	r.rawJSON = json.RawMessage(data)
	return nil
}

func (r *ResourceTypesResponse) MarshalJSON() ([]byte, error) {
	type embed ResourceTypesResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*r),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (r *ResourceTypesResponse) String() string {
	if len(r.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(r.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(r); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", r)
}

var (
	schemaExtensionFieldSchema   = big.NewInt(1 << 0)
	schemaExtensionFieldRequired = big.NewInt(1 << 1)
)

type SchemaExtension struct {
	Schema   string `json:"schema" url:"schema"`
	Required bool   `json:"required" url:"required"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SchemaExtension) GetSchema() string {
	if s == nil {
		return ""
	}
	return s.Schema
}

func (s *SchemaExtension) GetRequired() bool {
	if s == nil {
		return false
	}
	return s.Required
}

func (s *SchemaExtension) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SchemaExtension) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSchema sets the Schema field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaExtension) SetSchema(schema string) {
	s.Schema = schema
	s.require(schemaExtensionFieldSchema)
}

// SetRequired sets the Required field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaExtension) SetRequired(required bool) {
	s.Required = required
	s.require(schemaExtensionFieldRequired)
}

func (s *SchemaExtension) UnmarshalJSON(data []byte) error {
	type unmarshaler SchemaExtension
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SchemaExtension(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SchemaExtension) MarshalJSON() ([]byte, error) {
	type embed SchemaExtension
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SchemaExtension) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	schemaResourceFieldID          = big.NewInt(1 << 0)
	schemaResourceFieldName        = big.NewInt(1 << 1)
	schemaResourceFieldDescription = big.NewInt(1 << 2)
	schemaResourceFieldAttributes  = big.NewInt(1 << 3)
	schemaResourceFieldMeta        = big.NewInt(1 << 4)
)

type SchemaResource struct {
	ID          string        `json:"id" url:"id"`
	Name        string        `json:"name" url:"name"`
	Description string        `json:"description" url:"description"`
	Attributes  []interface{} `json:"attributes" url:"attributes"`
	Meta        *ResourceMeta `json:"meta" url:"meta"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SchemaResource) GetID() string {
	if s == nil {
		return ""
	}
	return s.ID
}

func (s *SchemaResource) GetName() string {
	if s == nil {
		return ""
	}
	return s.Name
}

func (s *SchemaResource) GetDescription() string {
	if s == nil {
		return ""
	}
	return s.Description
}

func (s *SchemaResource) GetAttributes() []interface{} {
	if s == nil {
		return nil
	}
	return s.Attributes
}

func (s *SchemaResource) GetMeta() *ResourceMeta {
	if s == nil {
		return nil
	}
	return s.Meta
}

func (s *SchemaResource) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SchemaResource) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaResource) SetID(id string) {
	s.ID = id
	s.require(schemaResourceFieldID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaResource) SetName(name string) {
	s.Name = name
	s.require(schemaResourceFieldName)
}

// SetDescription sets the Description field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaResource) SetDescription(description string) {
	s.Description = description
	s.require(schemaResourceFieldDescription)
}

// SetAttributes sets the Attributes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaResource) SetAttributes(attributes []interface{}) {
	s.Attributes = attributes
	s.require(schemaResourceFieldAttributes)
}

// SetMeta sets the Meta field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemaResource) SetMeta(meta *ResourceMeta) {
	s.Meta = meta
	s.require(schemaResourceFieldMeta)
}

func (s *SchemaResource) UnmarshalJSON(data []byte) error {
	type unmarshaler SchemaResource
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SchemaResource(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SchemaResource) MarshalJSON() ([]byte, error) {
	type embed SchemaResource
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SchemaResource) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	schemasResponseFieldSchemas      = big.NewInt(1 << 0)
	schemasResponseFieldTotalResults = big.NewInt(1 << 1)
	schemasResponseFieldResources    = big.NewInt(1 << 2)
)

type SchemasResponse struct {
	Schemas      []string          `json:"schemas" url:"schemas"`
	TotalResults int               `json:"totalResults" url:"totalResults"`
	Resources    []*SchemaResource `json:"Resources" url:"Resources"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SchemasResponse) GetSchemas() []string {
	if s == nil {
		return nil
	}
	return s.Schemas
}

func (s *SchemasResponse) GetTotalResults() int {
	if s == nil {
		return 0
	}
	return s.TotalResults
}

func (s *SchemasResponse) GetResources() []*SchemaResource {
	if s == nil {
		return nil
	}
	return s.Resources
}

func (s *SchemasResponse) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SchemasResponse) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemasResponse) SetSchemas(schemas []string) {
	s.Schemas = schemas
	s.require(schemasResponseFieldSchemas)
}

// SetTotalResults sets the TotalResults field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemasResponse) SetTotalResults(totalResults int) {
	s.TotalResults = totalResults
	s.require(schemasResponseFieldTotalResults)
}

// SetResources sets the Resources field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SchemasResponse) SetResources(resources []*SchemaResource) {
	s.Resources = resources
	s.require(schemasResponseFieldResources)
}

func (s *SchemasResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler SchemasResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SchemasResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SchemasResponse) MarshalJSON() ([]byte, error) {
	type embed SchemasResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SchemasResponse) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sCIMEmailFieldPrimary = big.NewInt(1 << 0)
	sCIMEmailFieldValue   = big.NewInt(1 << 1)
	sCIMEmailFieldType    = big.NewInt(1 << 2)
)

type SCIMEmail struct {
	Primary bool   `json:"primary" url:"primary"`
	Value   string `json:"value" url:"value"`
	Type    string `json:"type" url:"type"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SCIMEmail) GetPrimary() bool {
	if s == nil {
		return false
	}
	return s.Primary
}

func (s *SCIMEmail) GetValue() string {
	if s == nil {
		return ""
	}
	return s.Value
}

func (s *SCIMEmail) GetType() string {
	if s == nil {
		return ""
	}
	return s.Type
}

func (s *SCIMEmail) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SCIMEmail) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetPrimary sets the Primary field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMEmail) SetPrimary(primary bool) {
	s.Primary = primary
	s.require(sCIMEmailFieldPrimary)
}

// SetValue sets the Value field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMEmail) SetValue(value string) {
	s.Value = value
	s.require(sCIMEmailFieldValue)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMEmail) SetType(type_ string) {
	s.Type = type_
	s.require(sCIMEmailFieldType)
}

func (s *SCIMEmail) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMEmail
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SCIMEmail(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SCIMEmail) MarshalJSON() ([]byte, error) {
	type embed SCIMEmail
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SCIMEmail) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sCIMFeatureSupportFieldSupported = big.NewInt(1 << 0)
)

type SCIMFeatureSupport struct {
	Supported bool `json:"supported" url:"supported"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SCIMFeatureSupport) GetSupported() bool {
	if s == nil {
		return false
	}
	return s.Supported
}

func (s *SCIMFeatureSupport) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SCIMFeatureSupport) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSupported sets the Supported field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMFeatureSupport) SetSupported(supported bool) {
	s.Supported = supported
	s.require(sCIMFeatureSupportFieldSupported)
}

func (s *SCIMFeatureSupport) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMFeatureSupport
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SCIMFeatureSupport(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SCIMFeatureSupport) MarshalJSON() ([]byte, error) {
	type embed SCIMFeatureSupport
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SCIMFeatureSupport) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sCIMNameFieldFormatted = big.NewInt(1 << 0)
)

type SCIMName struct {
	Formatted *string `json:"formatted,omitempty" url:"formatted,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SCIMName) GetFormatted() *string {
	if s == nil {
		return nil
	}
	return s.Formatted
}

func (s *SCIMName) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SCIMName) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetFormatted sets the Formatted field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMName) SetFormatted(formatted *string) {
	s.Formatted = formatted
	s.require(sCIMNameFieldFormatted)
}

func (s *SCIMName) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMName
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SCIMName(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SCIMName) MarshalJSON() ([]byte, error) {
	type embed SCIMName
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SCIMName) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sCIMUserFieldSchemas  = big.NewInt(1 << 0)
	sCIMUserFieldID       = big.NewInt(1 << 1)
	sCIMUserFieldUserName = big.NewInt(1 << 2)
	sCIMUserFieldName     = big.NewInt(1 << 3)
	sCIMUserFieldEmails   = big.NewInt(1 << 4)
	sCIMUserFieldMeta     = big.NewInt(1 << 5)
)

type SCIMUser struct {
	Schemas  []string     `json:"schemas" url:"schemas"`
	ID       string       `json:"id" url:"id"`
	UserName string       `json:"userName" url:"userName"`
	Name     *SCIMName    `json:"name" url:"name"`
	Emails   []*SCIMEmail `json:"emails" url:"emails"`
	Meta     *UserMeta    `json:"meta" url:"meta"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SCIMUser) GetSchemas() []string {
	if s == nil {
		return nil
	}
	return s.Schemas
}

func (s *SCIMUser) GetID() string {
	if s == nil {
		return ""
	}
	return s.ID
}

func (s *SCIMUser) GetUserName() string {
	if s == nil {
		return ""
	}
	return s.UserName
}

func (s *SCIMUser) GetName() *SCIMName {
	if s == nil {
		return nil
	}
	return s.Name
}

func (s *SCIMUser) GetEmails() []*SCIMEmail {
	if s == nil {
		return nil
	}
	return s.Emails
}

func (s *SCIMUser) GetMeta() *UserMeta {
	if s == nil {
		return nil
	}
	return s.Meta
}

func (s *SCIMUser) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SCIMUser) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetSchemas(schemas []string) {
	s.Schemas = schemas
	s.require(sCIMUserFieldSchemas)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetID(id string) {
	s.ID = id
	s.require(sCIMUserFieldID)
}

// SetUserName sets the UserName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetUserName(userName string) {
	s.UserName = userName
	s.require(sCIMUserFieldUserName)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetName(name *SCIMName) {
	s.Name = name
	s.require(sCIMUserFieldName)
}

// SetEmails sets the Emails field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetEmails(emails []*SCIMEmail) {
	s.Emails = emails
	s.require(sCIMUserFieldEmails)
}

// SetMeta sets the Meta field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUser) SetMeta(meta *UserMeta) {
	s.Meta = meta
	s.require(sCIMUserFieldMeta)
}

func (s *SCIMUser) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMUser
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SCIMUser(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SCIMUser) MarshalJSON() ([]byte, error) {
	type embed SCIMUser
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SCIMUser) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	sCIMUsersListResponseFieldSchemas      = big.NewInt(1 << 0)
	sCIMUsersListResponseFieldTotalResults = big.NewInt(1 << 1)
	sCIMUsersListResponseFieldStartIndex   = big.NewInt(1 << 2)
	sCIMUsersListResponseFieldItemsPerPage = big.NewInt(1 << 3)
	sCIMUsersListResponseFieldResources    = big.NewInt(1 << 4)
)

type SCIMUsersListResponse struct {
	Schemas      []string    `json:"schemas" url:"schemas"`
	TotalResults int         `json:"totalResults" url:"totalResults"`
	StartIndex   int         `json:"startIndex" url:"startIndex"`
	ItemsPerPage int         `json:"itemsPerPage" url:"itemsPerPage"`
	Resources    []*SCIMUser `json:"Resources" url:"Resources"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *SCIMUsersListResponse) GetSchemas() []string {
	if s == nil {
		return nil
	}
	return s.Schemas
}

func (s *SCIMUsersListResponse) GetTotalResults() int {
	if s == nil {
		return 0
	}
	return s.TotalResults
}

func (s *SCIMUsersListResponse) GetStartIndex() int {
	if s == nil {
		return 0
	}
	return s.StartIndex
}

func (s *SCIMUsersListResponse) GetItemsPerPage() int {
	if s == nil {
		return 0
	}
	return s.ItemsPerPage
}

func (s *SCIMUsersListResponse) GetResources() []*SCIMUser {
	if s == nil {
		return nil
	}
	return s.Resources
}

func (s *SCIMUsersListResponse) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *SCIMUsersListResponse) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUsersListResponse) SetSchemas(schemas []string) {
	s.Schemas = schemas
	s.require(sCIMUsersListResponseFieldSchemas)
}

// SetTotalResults sets the TotalResults field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUsersListResponse) SetTotalResults(totalResults int) {
	s.TotalResults = totalResults
	s.require(sCIMUsersListResponseFieldTotalResults)
}

// SetStartIndex sets the StartIndex field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUsersListResponse) SetStartIndex(startIndex int) {
	s.StartIndex = startIndex
	s.require(sCIMUsersListResponseFieldStartIndex)
}

// SetItemsPerPage sets the ItemsPerPage field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUsersListResponse) SetItemsPerPage(itemsPerPage int) {
	s.ItemsPerPage = itemsPerPage
	s.require(sCIMUsersListResponseFieldItemsPerPage)
}

// SetResources sets the Resources field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SCIMUsersListResponse) SetResources(resources []*SCIMUser) {
	s.Resources = resources
	s.require(sCIMUsersListResponseFieldResources)
}

func (s *SCIMUsersListResponse) UnmarshalJSON(data []byte) error {
	type unmarshaler SCIMUsersListResponse
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = SCIMUsersListResponse(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *SCIMUsersListResponse) MarshalJSON() ([]byte, error) {
	type embed SCIMUsersListResponse
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *SCIMUsersListResponse) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	serviceProviderConfigFieldSchemas               = big.NewInt(1 << 0)
	serviceProviderConfigFieldDocumentationURI      = big.NewInt(1 << 1)
	serviceProviderConfigFieldPatch                 = big.NewInt(1 << 2)
	serviceProviderConfigFieldBulk                  = big.NewInt(1 << 3)
	serviceProviderConfigFieldFilter                = big.NewInt(1 << 4)
	serviceProviderConfigFieldChangePassword        = big.NewInt(1 << 5)
	serviceProviderConfigFieldSort                  = big.NewInt(1 << 6)
	serviceProviderConfigFieldEtag                  = big.NewInt(1 << 7)
	serviceProviderConfigFieldAuthenticationSchemes = big.NewInt(1 << 8)
	serviceProviderConfigFieldMeta                  = big.NewInt(1 << 9)
)

type ServiceProviderConfig struct {
	Schemas               []string                `json:"schemas" url:"schemas"`
	DocumentationURI      string                  `json:"documentationUri" url:"documentationUri"`
	Patch                 *SCIMFeatureSupport     `json:"patch" url:"patch"`
	Bulk                  *BulkConfig             `json:"bulk" url:"bulk"`
	Filter                *FilterConfig           `json:"filter" url:"filter"`
	ChangePassword        *SCIMFeatureSupport     `json:"changePassword" url:"changePassword"`
	Sort                  *SCIMFeatureSupport     `json:"sort" url:"sort"`
	Etag                  *SCIMFeatureSupport     `json:"etag" url:"etag"`
	AuthenticationSchemes []*AuthenticationScheme `json:"authenticationSchemes" url:"authenticationSchemes"`
	Meta                  *ResourceMeta           `json:"meta" url:"meta"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (s *ServiceProviderConfig) GetSchemas() []string {
	if s == nil {
		return nil
	}
	return s.Schemas
}

func (s *ServiceProviderConfig) GetDocumentationURI() string {
	if s == nil {
		return ""
	}
	return s.DocumentationURI
}

func (s *ServiceProviderConfig) GetPatch() *SCIMFeatureSupport {
	if s == nil {
		return nil
	}
	return s.Patch
}

func (s *ServiceProviderConfig) GetBulk() *BulkConfig {
	if s == nil {
		return nil
	}
	return s.Bulk
}

func (s *ServiceProviderConfig) GetFilter() *FilterConfig {
	if s == nil {
		return nil
	}
	return s.Filter
}

func (s *ServiceProviderConfig) GetChangePassword() *SCIMFeatureSupport {
	if s == nil {
		return nil
	}
	return s.ChangePassword
}

func (s *ServiceProviderConfig) GetSort() *SCIMFeatureSupport {
	if s == nil {
		return nil
	}
	return s.Sort
}

func (s *ServiceProviderConfig) GetEtag() *SCIMFeatureSupport {
	if s == nil {
		return nil
	}
	return s.Etag
}

func (s *ServiceProviderConfig) GetAuthenticationSchemes() []*AuthenticationScheme {
	if s == nil {
		return nil
	}
	return s.AuthenticationSchemes
}

func (s *ServiceProviderConfig) GetMeta() *ResourceMeta {
	if s == nil {
		return nil
	}
	return s.Meta
}

func (s *ServiceProviderConfig) GetExtraProperties() map[string]interface{} {
	return s.extraProperties
}

func (s *ServiceProviderConfig) require(field *big.Int) {
	if s.explicitFields == nil {
		s.explicitFields = big.NewInt(0)
	}
	s.explicitFields.Or(s.explicitFields, field)
}

// SetSchemas sets the Schemas field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetSchemas(schemas []string) {
	s.Schemas = schemas
	s.require(serviceProviderConfigFieldSchemas)
}

// SetDocumentationURI sets the DocumentationURI field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetDocumentationURI(documentationURI string) {
	s.DocumentationURI = documentationURI
	s.require(serviceProviderConfigFieldDocumentationURI)
}

// SetPatch sets the Patch field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetPatch(patch *SCIMFeatureSupport) {
	s.Patch = patch
	s.require(serviceProviderConfigFieldPatch)
}

// SetBulk sets the Bulk field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetBulk(bulk *BulkConfig) {
	s.Bulk = bulk
	s.require(serviceProviderConfigFieldBulk)
}

// SetFilter sets the Filter field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetFilter(filter *FilterConfig) {
	s.Filter = filter
	s.require(serviceProviderConfigFieldFilter)
}

// SetChangePassword sets the ChangePassword field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetChangePassword(changePassword *SCIMFeatureSupport) {
	s.ChangePassword = changePassword
	s.require(serviceProviderConfigFieldChangePassword)
}

// SetSort sets the Sort field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetSort(sort *SCIMFeatureSupport) {
	s.Sort = sort
	s.require(serviceProviderConfigFieldSort)
}

// SetEtag sets the Etag field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetEtag(etag *SCIMFeatureSupport) {
	s.Etag = etag
	s.require(serviceProviderConfigFieldEtag)
}

// SetAuthenticationSchemes sets the AuthenticationSchemes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetAuthenticationSchemes(authenticationSchemes []*AuthenticationScheme) {
	s.AuthenticationSchemes = authenticationSchemes
	s.require(serviceProviderConfigFieldAuthenticationSchemes)
}

// SetMeta sets the Meta field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *ServiceProviderConfig) SetMeta(meta *ResourceMeta) {
	s.Meta = meta
	s.require(serviceProviderConfigFieldMeta)
}

func (s *ServiceProviderConfig) UnmarshalJSON(data []byte) error {
	type unmarshaler ServiceProviderConfig
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*s = ServiceProviderConfig(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *s)
	if err != nil {
		return err
	}
	s.extraProperties = extraProperties
	s.rawJSON = json.RawMessage(data)
	return nil
}

func (s *ServiceProviderConfig) MarshalJSON() ([]byte, error) {
	type embed ServiceProviderConfig
	var marshaler = struct {
		embed
	}{
		embed: embed(*s),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (s *ServiceProviderConfig) String() string {
	if len(s.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(s); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", s)
}

var (
	userMetaFieldResourceType = big.NewInt(1 << 0)
	userMetaFieldCreated      = big.NewInt(1 << 1)
	userMetaFieldLastModified = big.NewInt(1 << 2)
)

type UserMeta struct {
	ResourceType string  `json:"resourceType" url:"resourceType"`
	Created      *string `json:"created,omitempty" url:"created,omitempty"`
	LastModified *string `json:"lastModified,omitempty" url:"lastModified,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (u *UserMeta) GetResourceType() string {
	if u == nil {
		return ""
	}
	return u.ResourceType
}

func (u *UserMeta) GetCreated() *string {
	if u == nil {
		return nil
	}
	return u.Created
}

func (u *UserMeta) GetLastModified() *string {
	if u == nil {
		return nil
	}
	return u.LastModified
}

func (u *UserMeta) GetExtraProperties() map[string]interface{} {
	return u.extraProperties
}

func (u *UserMeta) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.explicitFields, field)
}

// SetResourceType sets the ResourceType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UserMeta) SetResourceType(resourceType string) {
	u.ResourceType = resourceType
	u.require(userMetaFieldResourceType)
}

// SetCreated sets the Created field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UserMeta) SetCreated(created *string) {
	u.Created = created
	u.require(userMetaFieldCreated)
}

// SetLastModified sets the LastModified field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UserMeta) SetLastModified(lastModified *string) {
	u.LastModified = lastModified
	u.require(userMetaFieldLastModified)
}

func (u *UserMeta) UnmarshalJSON(data []byte) error {
	type unmarshaler UserMeta
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*u = UserMeta(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *u)
	if err != nil {
		return err
	}
	u.extraProperties = extraProperties
	u.rawJSON = json.RawMessage(data)
	return nil
}

func (u *UserMeta) MarshalJSON() ([]byte, error) {
	type embed UserMeta
	var marshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (u *UserMeta) String() string {
	if len(u.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(u.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(u); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", u)
}
