// Code generated by Fern. DO NOT EDIT.

package management

import (
	json "encoding/json"
	fmt "fmt"
	internal "github.com/auth0/go-auth0/v2/management/internal"
	big "math/big"
)

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

type ConnectionAttributeIdentifier struct {
	// Determines if the attribute is used for identification
	Active *bool `json:"active,omitempty" url:"active,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 (c *ConnectionAttributeIdentifier) GetActive() bool {
	if c == nil || c.Active == nil {
		return false
	}
	return *c.Active
}

func (c *ConnectionAttributeIdentifier) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// 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 (c *ConnectionAttributeIdentifier) SetActive(active *bool) {
	c.Active = active
	c.require(connectionAttributeIdentifierFieldActive)
}

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

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

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

// Attribute configuration
var (
	connectionAttributesFieldEmail       = big.NewInt(1 << 0)
	connectionAttributesFieldPhoneNumber = big.NewInt(1 << 1)
	connectionAttributesFieldUsername    = big.NewInt(1 << 2)
)

type ConnectionAttributes struct {
	Email       *EmailAttribute    `json:"email,omitempty" url:"email,omitempty"`
	PhoneNumber *PhoneAttribute    `json:"phone_number,omitempty" url:"phone_number,omitempty"`
	Username    *UsernameAttribute `json:"username,omitempty" url:"username,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 (c *ConnectionAttributes) GetEmail() EmailAttribute {
	if c == nil || c.Email == nil {
		return EmailAttribute{}
	}
	return *c.Email
}

func (c *ConnectionAttributes) GetPhoneNumber() PhoneAttribute {
	if c == nil || c.PhoneNumber == nil {
		return PhoneAttribute{}
	}
	return *c.PhoneNumber
}

func (c *ConnectionAttributes) GetUsername() UsernameAttribute {
	if c == nil || c.Username == nil {
		return UsernameAttribute{}
	}
	return *c.Username
}

func (c *ConnectionAttributes) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEmail sets the Email field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionAttributes) SetEmail(email *EmailAttribute) {
	c.Email = email
	c.require(connectionAttributesFieldEmail)
}

// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionAttributes) SetPhoneNumber(phoneNumber *PhoneAttribute) {
	c.PhoneNumber = phoneNumber
	c.require(connectionAttributesFieldPhoneNumber)
}

// 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 (c *ConnectionAttributes) SetUsername(username *UsernameAttribute) {
	c.Username = username
	c.require(connectionAttributesFieldUsername)
}

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

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

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

// Options for enabling authentication methods.
var (
	connectionAuthenticationMethodsFieldPassword = big.NewInt(1 << 0)
	connectionAuthenticationMethodsFieldPasskey  = big.NewInt(1 << 1)
)

type ConnectionAuthenticationMethods struct {
	Password *ConnectionPasswordAuthenticationMethod `json:"password,omitempty" url:"password,omitempty"`
	Passkey  *ConnectionPasskeyAuthenticationMethod  `json:"passkey,omitempty" url:"passkey,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 (c *ConnectionAuthenticationMethods) GetPassword() ConnectionPasswordAuthenticationMethod {
	if c == nil || c.Password == nil {
		return ConnectionPasswordAuthenticationMethod{}
	}
	return *c.Password
}

func (c *ConnectionAuthenticationMethods) GetPasskey() ConnectionPasskeyAuthenticationMethod {
	if c == nil || c.Passkey == nil {
		return ConnectionPasskeyAuthenticationMethod{}
	}
	return *c.Passkey
}

func (c *ConnectionAuthenticationMethods) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// 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 (c *ConnectionAuthenticationMethods) SetPassword(password *ConnectionPasswordAuthenticationMethod) {
	c.Password = password
	c.require(connectionAuthenticationMethodsFieldPassword)
}

// SetPasskey sets the Passkey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionAuthenticationMethods) SetPasskey(passkey *ConnectionPasskeyAuthenticationMethod) {
	c.Passkey = passkey
	c.require(connectionAuthenticationMethodsFieldPasskey)
}

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

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

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

// A map of scripts used to integrate with a custom database.
var (
	connectionCustomScriptsFieldLogin             = big.NewInt(1 << 0)
	connectionCustomScriptsFieldGetUser           = big.NewInt(1 << 1)
	connectionCustomScriptsFieldDelete            = big.NewInt(1 << 2)
	connectionCustomScriptsFieldChangePassword    = big.NewInt(1 << 3)
	connectionCustomScriptsFieldVerify            = big.NewInt(1 << 4)
	connectionCustomScriptsFieldCreate            = big.NewInt(1 << 5)
	connectionCustomScriptsFieldChangeUsername    = big.NewInt(1 << 6)
	connectionCustomScriptsFieldChangeEmail       = big.NewInt(1 << 7)
	connectionCustomScriptsFieldChangePhoneNumber = big.NewInt(1 << 8)
)

type ConnectionCustomScripts struct {
	Login             *string `json:"login,omitempty" url:"login,omitempty"`
	GetUser           *string `json:"get_user,omitempty" url:"get_user,omitempty"`
	Delete            *string `json:"delete,omitempty" url:"delete,omitempty"`
	ChangePassword    *string `json:"change_password,omitempty" url:"change_password,omitempty"`
	Verify            *string `json:"verify,omitempty" url:"verify,omitempty"`
	Create            *string `json:"create,omitempty" url:"create,omitempty"`
	ChangeUsername    *string `json:"change_username,omitempty" url:"change_username,omitempty"`
	ChangeEmail       *string `json:"change_email,omitempty" url:"change_email,omitempty"`
	ChangePhoneNumber *string `json:"change_phone_number,omitempty" url:"change_phone_number,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{} `json:"-" url:"-"`

	rawJSON json.RawMessage
}

func (c *ConnectionCustomScripts) GetLogin() string {
	if c == nil || c.Login == nil {
		return ""
	}
	return *c.Login
}

func (c *ConnectionCustomScripts) GetGetUser() string {
	if c == nil || c.GetUser == nil {
		return ""
	}
	return *c.GetUser
}

func (c *ConnectionCustomScripts) GetDelete() string {
	if c == nil || c.Delete == nil {
		return ""
	}
	return *c.Delete
}

func (c *ConnectionCustomScripts) GetChangePassword() string {
	if c == nil || c.ChangePassword == nil {
		return ""
	}
	return *c.ChangePassword
}

func (c *ConnectionCustomScripts) GetVerify() string {
	if c == nil || c.Verify == nil {
		return ""
	}
	return *c.Verify
}

func (c *ConnectionCustomScripts) GetCreate() string {
	if c == nil || c.Create == nil {
		return ""
	}
	return *c.Create
}

func (c *ConnectionCustomScripts) GetChangeUsername() string {
	if c == nil || c.ChangeUsername == nil {
		return ""
	}
	return *c.ChangeUsername
}

func (c *ConnectionCustomScripts) GetChangeEmail() string {
	if c == nil || c.ChangeEmail == nil {
		return ""
	}
	return *c.ChangeEmail
}

func (c *ConnectionCustomScripts) GetChangePhoneNumber() string {
	if c == nil || c.ChangePhoneNumber == nil {
		return ""
	}
	return *c.ChangePhoneNumber
}

func (c *ConnectionCustomScripts) GetExtraProperties() map[string]interface{} {
	return c.ExtraProperties
}

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

// SetLogin sets the Login field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetLogin(login *string) {
	c.Login = login
	c.require(connectionCustomScriptsFieldLogin)
}

// SetGetUser sets the GetUser field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetGetUser(getUser *string) {
	c.GetUser = getUser
	c.require(connectionCustomScriptsFieldGetUser)
}

// SetDelete sets the Delete field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetDelete(delete *string) {
	c.Delete = delete
	c.require(connectionCustomScriptsFieldDelete)
}

// 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 (c *ConnectionCustomScripts) SetChangePassword(changePassword *string) {
	c.ChangePassword = changePassword
	c.require(connectionCustomScriptsFieldChangePassword)
}

// SetVerify sets the Verify field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetVerify(verify *string) {
	c.Verify = verify
	c.require(connectionCustomScriptsFieldVerify)
}

// SetCreate sets the Create field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetCreate(create *string) {
	c.Create = create
	c.require(connectionCustomScriptsFieldCreate)
}

// SetChangeUsername sets the ChangeUsername field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetChangeUsername(changeUsername *string) {
	c.ChangeUsername = changeUsername
	c.require(connectionCustomScriptsFieldChangeUsername)
}

// SetChangeEmail sets the ChangeEmail field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetChangeEmail(changeEmail *string) {
	c.ChangeEmail = changeEmail
	c.require(connectionCustomScriptsFieldChangeEmail)
}

// SetChangePhoneNumber sets the ChangePhoneNumber field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionCustomScripts) SetChangePhoneNumber(changePhoneNumber *string) {
	c.ChangePhoneNumber = changePhoneNumber
	c.require(connectionCustomScriptsFieldChangePhoneNumber)
}

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

func (c *ConnectionCustomScripts) MarshalJSON() ([]byte, error) {
	type embed ConnectionCustomScripts
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return internal.MarshalJSONWithExtraProperties(explicitMarshaler, c.ExtraProperties)
}

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

// Federated Connections Access Tokens
var (
	connectionFederatedConnectionsAccessTokensFieldActive = big.NewInt(1 << 0)
)

type ConnectionFederatedConnectionsAccessTokens struct {
	// Enables refresh tokens and access tokens collection for federated connections
	Active *bool `json:"active,omitempty" url:"active,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 (c *ConnectionFederatedConnectionsAccessTokens) GetActive() bool {
	if c == nil || c.Active == nil {
		return false
	}
	return *c.Active
}

func (c *ConnectionFederatedConnectionsAccessTokens) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// 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 (c *ConnectionFederatedConnectionsAccessTokens) SetActive(active *bool) {
	c.Active = active
	c.require(connectionFederatedConnectionsAccessTokensFieldActive)
}

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

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

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

// Token-based authentication settings to be applied when connection is using an sms strategy.
var (
	connectionGatewayAuthenticationFieldMethod              = big.NewInt(1 << 0)
	connectionGatewayAuthenticationFieldSubject             = big.NewInt(1 << 1)
	connectionGatewayAuthenticationFieldAudience            = big.NewInt(1 << 2)
	connectionGatewayAuthenticationFieldSecret              = big.NewInt(1 << 3)
	connectionGatewayAuthenticationFieldSecretBase64Encoded = big.NewInt(1 << 4)
)

type ConnectionGatewayAuthentication struct {
	// The Authorization header type.
	Method string `json:"method" url:"method"`
	// The subject to be added to the JWT payload.
	Subject *string `json:"subject,omitempty" url:"subject,omitempty"`
	// The audience to be added to the JWT payload.
	Audience string `json:"audience" url:"audience"`
	// The secret to be used for signing tokens.
	Secret string `json:"secret" url:"secret"`
	// Set to true if the provided secret is base64 encoded.
	SecretBase64Encoded *bool `json:"secret_base64_encoded,omitempty" url:"secret_base64_encoded,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{} `json:"-" url:"-"`

	rawJSON json.RawMessage
}

func (c *ConnectionGatewayAuthentication) GetMethod() string {
	if c == nil {
		return ""
	}
	return c.Method
}

func (c *ConnectionGatewayAuthentication) GetSubject() string {
	if c == nil || c.Subject == nil {
		return ""
	}
	return *c.Subject
}

func (c *ConnectionGatewayAuthentication) GetAudience() string {
	if c == nil {
		return ""
	}
	return c.Audience
}

func (c *ConnectionGatewayAuthentication) GetSecret() string {
	if c == nil {
		return ""
	}
	return c.Secret
}

func (c *ConnectionGatewayAuthentication) GetSecretBase64Encoded() bool {
	if c == nil || c.SecretBase64Encoded == nil {
		return false
	}
	return *c.SecretBase64Encoded
}

func (c *ConnectionGatewayAuthentication) GetExtraProperties() map[string]interface{} {
	return c.ExtraProperties
}

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

// SetMethod sets the Method field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionGatewayAuthentication) SetMethod(method string) {
	c.Method = method
	c.require(connectionGatewayAuthenticationFieldMethod)
}

// SetSubject sets the Subject field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionGatewayAuthentication) SetSubject(subject *string) {
	c.Subject = subject
	c.require(connectionGatewayAuthenticationFieldSubject)
}

// SetAudience sets the Audience field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionGatewayAuthentication) SetAudience(audience string) {
	c.Audience = audience
	c.require(connectionGatewayAuthenticationFieldAudience)
}

// SetSecret sets the Secret field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionGatewayAuthentication) SetSecret(secret string) {
	c.Secret = secret
	c.require(connectionGatewayAuthenticationFieldSecret)
}

// SetSecretBase64Encoded sets the SecretBase64Encoded field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionGatewayAuthentication) SetSecretBase64Encoded(secretBase64Encoded *bool) {
	c.SecretBase64Encoded = secretBase64Encoded
	c.require(connectionGatewayAuthenticationFieldSecretBase64Encoded)
}

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

func (c *ConnectionGatewayAuthentication) MarshalJSON() ([]byte, error) {
	type embed ConnectionGatewayAuthentication
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return internal.MarshalJSONWithExtraProperties(explicitMarshaler, c.ExtraProperties)
}

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

// Order of precedence for attribute types
type ConnectionIdentifierPrecedenceEnum string

const (
	ConnectionIdentifierPrecedenceEnumEmail       ConnectionIdentifierPrecedenceEnum = "email"
	ConnectionIdentifierPrecedenceEnumPhoneNumber ConnectionIdentifierPrecedenceEnum = "phone_number"
	ConnectionIdentifierPrecedenceEnumUsername    ConnectionIdentifierPrecedenceEnum = "username"
)

func NewConnectionIdentifierPrecedenceEnumFromString(s string) (ConnectionIdentifierPrecedenceEnum, error) {
	switch s {
	case "email":
		return ConnectionIdentifierPrecedenceEnumEmail, nil
	case "phone_number":
		return ConnectionIdentifierPrecedenceEnumPhoneNumber, nil
	case "username":
		return ConnectionIdentifierPrecedenceEnumUsername, nil
	}
	var t ConnectionIdentifierPrecedenceEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionIdentifierPrecedenceEnum) Ptr() *ConnectionIdentifierPrecedenceEnum {
	return &c
}

// The identity provider identifier for the connection
type ConnectionIdentityProviderEnum string

const (
	ConnectionIdentityProviderEnumAd                  ConnectionIdentityProviderEnum = "ad"
	ConnectionIdentityProviderEnumAdfs                ConnectionIdentityProviderEnum = "adfs"
	ConnectionIdentityProviderEnumAmazon              ConnectionIdentityProviderEnum = "amazon"
	ConnectionIdentityProviderEnumApple               ConnectionIdentityProviderEnum = "apple"
	ConnectionIdentityProviderEnumDropbox             ConnectionIdentityProviderEnum = "dropbox"
	ConnectionIdentityProviderEnumBitbucket           ConnectionIdentityProviderEnum = "bitbucket"
	ConnectionIdentityProviderEnumAol                 ConnectionIdentityProviderEnum = "aol"
	ConnectionIdentityProviderEnumAuth0Oidc           ConnectionIdentityProviderEnum = "auth0-oidc"
	ConnectionIdentityProviderEnumAuth0               ConnectionIdentityProviderEnum = "auth0"
	ConnectionIdentityProviderEnumBaidu               ConnectionIdentityProviderEnum = "baidu"
	ConnectionIdentityProviderEnumBitly               ConnectionIdentityProviderEnum = "bitly"
	ConnectionIdentityProviderEnumBox                 ConnectionIdentityProviderEnum = "box"
	ConnectionIdentityProviderEnumCustom              ConnectionIdentityProviderEnum = "custom"
	ConnectionIdentityProviderEnumDaccount            ConnectionIdentityProviderEnum = "daccount"
	ConnectionIdentityProviderEnumDwolla              ConnectionIdentityProviderEnum = "dwolla"
	ConnectionIdentityProviderEnumEmail               ConnectionIdentityProviderEnum = "email"
	ConnectionIdentityProviderEnumEvernoteSandbox     ConnectionIdentityProviderEnum = "evernote-sandbox"
	ConnectionIdentityProviderEnumEvernote            ConnectionIdentityProviderEnum = "evernote"
	ConnectionIdentityProviderEnumExact               ConnectionIdentityProviderEnum = "exact"
	ConnectionIdentityProviderEnumFacebook            ConnectionIdentityProviderEnum = "facebook"
	ConnectionIdentityProviderEnumFitbit              ConnectionIdentityProviderEnum = "fitbit"
	ConnectionIdentityProviderEnumFlickr              ConnectionIdentityProviderEnum = "flickr"
	ConnectionIdentityProviderEnumGithub              ConnectionIdentityProviderEnum = "github"
	ConnectionIdentityProviderEnumGoogleApps          ConnectionIdentityProviderEnum = "google-apps"
	ConnectionIdentityProviderEnumGoogleOauth2        ConnectionIdentityProviderEnum = "google-oauth2"
	ConnectionIdentityProviderEnumInstagram           ConnectionIdentityProviderEnum = "instagram"
	ConnectionIdentityProviderEnumIP                  ConnectionIdentityProviderEnum = "ip"
	ConnectionIdentityProviderEnumLine                ConnectionIdentityProviderEnum = "line"
	ConnectionIdentityProviderEnumLinkedin            ConnectionIdentityProviderEnum = "linkedin"
	ConnectionIdentityProviderEnumMiicard             ConnectionIdentityProviderEnum = "miicard"
	ConnectionIdentityProviderEnumOauth1              ConnectionIdentityProviderEnum = "oauth1"
	ConnectionIdentityProviderEnumOauth2              ConnectionIdentityProviderEnum = "oauth2"
	ConnectionIdentityProviderEnumOffice365           ConnectionIdentityProviderEnum = "office365"
	ConnectionIdentityProviderEnumOidc                ConnectionIdentityProviderEnum = "oidc"
	ConnectionIdentityProviderEnumOkta                ConnectionIdentityProviderEnum = "okta"
	ConnectionIdentityProviderEnumPaypal              ConnectionIdentityProviderEnum = "paypal"
	ConnectionIdentityProviderEnumPaypalSandbox       ConnectionIdentityProviderEnum = "paypal-sandbox"
	ConnectionIdentityProviderEnumPingfederate        ConnectionIdentityProviderEnum = "pingfederate"
	ConnectionIdentityProviderEnumPlanningcenter      ConnectionIdentityProviderEnum = "planningcenter"
	ConnectionIdentityProviderEnumRenren              ConnectionIdentityProviderEnum = "renren"
	ConnectionIdentityProviderEnumSalesforceCommunity ConnectionIdentityProviderEnum = "salesforce-community"
	ConnectionIdentityProviderEnumSalesforceSandbox   ConnectionIdentityProviderEnum = "salesforce-sandbox"
	ConnectionIdentityProviderEnumSalesforce          ConnectionIdentityProviderEnum = "salesforce"
	ConnectionIdentityProviderEnumSamlp               ConnectionIdentityProviderEnum = "samlp"
	ConnectionIdentityProviderEnumSharepoint          ConnectionIdentityProviderEnum = "sharepoint"
	ConnectionIdentityProviderEnumShopify             ConnectionIdentityProviderEnum = "shopify"
	ConnectionIdentityProviderEnumShop                ConnectionIdentityProviderEnum = "shop"
	ConnectionIdentityProviderEnumSms                 ConnectionIdentityProviderEnum = "sms"
	ConnectionIdentityProviderEnumSoundcloud          ConnectionIdentityProviderEnum = "soundcloud"
	ConnectionIdentityProviderEnumThecitySandbox      ConnectionIdentityProviderEnum = "thecity-sandbox"
	ConnectionIdentityProviderEnumThecity             ConnectionIdentityProviderEnum = "thecity"
	ConnectionIdentityProviderEnumThirtysevensignals  ConnectionIdentityProviderEnum = "thirtysevensignals"
	ConnectionIdentityProviderEnumTwitter             ConnectionIdentityProviderEnum = "twitter"
	ConnectionIdentityProviderEnumUntappd             ConnectionIdentityProviderEnum = "untappd"
	ConnectionIdentityProviderEnumVkontakte           ConnectionIdentityProviderEnum = "vkontakte"
	ConnectionIdentityProviderEnumWaad                ConnectionIdentityProviderEnum = "waad"
	ConnectionIdentityProviderEnumWeibo               ConnectionIdentityProviderEnum = "weibo"
	ConnectionIdentityProviderEnumWindowslive         ConnectionIdentityProviderEnum = "windowslive"
	ConnectionIdentityProviderEnumWordpress           ConnectionIdentityProviderEnum = "wordpress"
	ConnectionIdentityProviderEnumYahoo               ConnectionIdentityProviderEnum = "yahoo"
	ConnectionIdentityProviderEnumYammer              ConnectionIdentityProviderEnum = "yammer"
	ConnectionIdentityProviderEnumYandex              ConnectionIdentityProviderEnum = "yandex"
)

func NewConnectionIdentityProviderEnumFromString(s string) (ConnectionIdentityProviderEnum, error) {
	switch s {
	case "ad":
		return ConnectionIdentityProviderEnumAd, nil
	case "adfs":
		return ConnectionIdentityProviderEnumAdfs, nil
	case "amazon":
		return ConnectionIdentityProviderEnumAmazon, nil
	case "apple":
		return ConnectionIdentityProviderEnumApple, nil
	case "dropbox":
		return ConnectionIdentityProviderEnumDropbox, nil
	case "bitbucket":
		return ConnectionIdentityProviderEnumBitbucket, nil
	case "aol":
		return ConnectionIdentityProviderEnumAol, nil
	case "auth0-oidc":
		return ConnectionIdentityProviderEnumAuth0Oidc, nil
	case "auth0":
		return ConnectionIdentityProviderEnumAuth0, nil
	case "baidu":
		return ConnectionIdentityProviderEnumBaidu, nil
	case "bitly":
		return ConnectionIdentityProviderEnumBitly, nil
	case "box":
		return ConnectionIdentityProviderEnumBox, nil
	case "custom":
		return ConnectionIdentityProviderEnumCustom, nil
	case "daccount":
		return ConnectionIdentityProviderEnumDaccount, nil
	case "dwolla":
		return ConnectionIdentityProviderEnumDwolla, nil
	case "email":
		return ConnectionIdentityProviderEnumEmail, nil
	case "evernote-sandbox":
		return ConnectionIdentityProviderEnumEvernoteSandbox, nil
	case "evernote":
		return ConnectionIdentityProviderEnumEvernote, nil
	case "exact":
		return ConnectionIdentityProviderEnumExact, nil
	case "facebook":
		return ConnectionIdentityProviderEnumFacebook, nil
	case "fitbit":
		return ConnectionIdentityProviderEnumFitbit, nil
	case "flickr":
		return ConnectionIdentityProviderEnumFlickr, nil
	case "github":
		return ConnectionIdentityProviderEnumGithub, nil
	case "google-apps":
		return ConnectionIdentityProviderEnumGoogleApps, nil
	case "google-oauth2":
		return ConnectionIdentityProviderEnumGoogleOauth2, nil
	case "instagram":
		return ConnectionIdentityProviderEnumInstagram, nil
	case "ip":
		return ConnectionIdentityProviderEnumIP, nil
	case "line":
		return ConnectionIdentityProviderEnumLine, nil
	case "linkedin":
		return ConnectionIdentityProviderEnumLinkedin, nil
	case "miicard":
		return ConnectionIdentityProviderEnumMiicard, nil
	case "oauth1":
		return ConnectionIdentityProviderEnumOauth1, nil
	case "oauth2":
		return ConnectionIdentityProviderEnumOauth2, nil
	case "office365":
		return ConnectionIdentityProviderEnumOffice365, nil
	case "oidc":
		return ConnectionIdentityProviderEnumOidc, nil
	case "okta":
		return ConnectionIdentityProviderEnumOkta, nil
	case "paypal":
		return ConnectionIdentityProviderEnumPaypal, nil
	case "paypal-sandbox":
		return ConnectionIdentityProviderEnumPaypalSandbox, nil
	case "pingfederate":
		return ConnectionIdentityProviderEnumPingfederate, nil
	case "planningcenter":
		return ConnectionIdentityProviderEnumPlanningcenter, nil
	case "renren":
		return ConnectionIdentityProviderEnumRenren, nil
	case "salesforce-community":
		return ConnectionIdentityProviderEnumSalesforceCommunity, nil
	case "salesforce-sandbox":
		return ConnectionIdentityProviderEnumSalesforceSandbox, nil
	case "salesforce":
		return ConnectionIdentityProviderEnumSalesforce, nil
	case "samlp":
		return ConnectionIdentityProviderEnumSamlp, nil
	case "sharepoint":
		return ConnectionIdentityProviderEnumSharepoint, nil
	case "shopify":
		return ConnectionIdentityProviderEnumShopify, nil
	case "shop":
		return ConnectionIdentityProviderEnumShop, nil
	case "sms":
		return ConnectionIdentityProviderEnumSms, nil
	case "soundcloud":
		return ConnectionIdentityProviderEnumSoundcloud, nil
	case "thecity-sandbox":
		return ConnectionIdentityProviderEnumThecitySandbox, nil
	case "thecity":
		return ConnectionIdentityProviderEnumThecity, nil
	case "thirtysevensignals":
		return ConnectionIdentityProviderEnumThirtysevensignals, nil
	case "twitter":
		return ConnectionIdentityProviderEnumTwitter, nil
	case "untappd":
		return ConnectionIdentityProviderEnumUntappd, nil
	case "vkontakte":
		return ConnectionIdentityProviderEnumVkontakte, nil
	case "waad":
		return ConnectionIdentityProviderEnumWaad, nil
	case "weibo":
		return ConnectionIdentityProviderEnumWeibo, nil
	case "windowslive":
		return ConnectionIdentityProviderEnumWindowslive, nil
	case "wordpress":
		return ConnectionIdentityProviderEnumWordpress, nil
	case "yahoo":
		return ConnectionIdentityProviderEnumYahoo, nil
	case "yammer":
		return ConnectionIdentityProviderEnumYammer, nil
	case "yandex":
		return ConnectionIdentityProviderEnumYandex, nil
	}
	var t ConnectionIdentityProviderEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionIdentityProviderEnum) Ptr() *ConnectionIdentityProviderEnum {
	return &c
}

// Passkey authentication enablement
var (
	connectionPasskeyAuthenticationMethodFieldEnabled = big.NewInt(1 << 0)
)

type ConnectionPasskeyAuthenticationMethod struct {
	// Determines whether passkeys are enabled
	Enabled *bool `json:"enabled,omitempty" url:"enabled,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 (c *ConnectionPasskeyAuthenticationMethod) GetEnabled() bool {
	if c == nil || c.Enabled == nil {
		return false
	}
	return *c.Enabled
}

func (c *ConnectionPasskeyAuthenticationMethod) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEnabled sets the Enabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasskeyAuthenticationMethod) SetEnabled(enabled *bool) {
	c.Enabled = enabled
	c.require(connectionPasskeyAuthenticationMethodFieldEnabled)
}

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

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

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

// Controls the UI used to challenge the user for their passkey.
type ConnectionPasskeyChallengeUIEnum string

const (
	ConnectionPasskeyChallengeUIEnumBoth     ConnectionPasskeyChallengeUIEnum = "both"
	ConnectionPasskeyChallengeUIEnumAutofill ConnectionPasskeyChallengeUIEnum = "autofill"
	ConnectionPasskeyChallengeUIEnumButton   ConnectionPasskeyChallengeUIEnum = "button"
)

func NewConnectionPasskeyChallengeUIEnumFromString(s string) (ConnectionPasskeyChallengeUIEnum, error) {
	switch s {
	case "both":
		return ConnectionPasskeyChallengeUIEnumBoth, nil
	case "autofill":
		return ConnectionPasskeyChallengeUIEnumAutofill, nil
	case "button":
		return ConnectionPasskeyChallengeUIEnumButton, nil
	}
	var t ConnectionPasskeyChallengeUIEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionPasskeyChallengeUIEnum) Ptr() *ConnectionPasskeyChallengeUIEnum {
	return &c
}

// Options for the passkey authentication method
var (
	connectionPasskeyOptionsFieldChallengeUI                  = big.NewInt(1 << 0)
	connectionPasskeyOptionsFieldProgressiveEnrollmentEnabled = big.NewInt(1 << 1)
	connectionPasskeyOptionsFieldLocalEnrollmentEnabled       = big.NewInt(1 << 2)
)

type ConnectionPasskeyOptions struct {
	ChallengeUI *ConnectionPasskeyChallengeUIEnum `json:"challenge_ui,omitempty" url:"challenge_ui,omitempty"`
	// Enables or disables progressive enrollment of passkeys for the connection.
	ProgressiveEnrollmentEnabled *bool `json:"progressive_enrollment_enabled,omitempty" url:"progressive_enrollment_enabled,omitempty"`
	// Enables or disables enrollment prompt for local passkey when user authenticates using a cross-device passkey for the connection.
	LocalEnrollmentEnabled *bool `json:"local_enrollment_enabled,omitempty" url:"local_enrollment_enabled,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 (c *ConnectionPasskeyOptions) GetChallengeUI() ConnectionPasskeyChallengeUIEnum {
	if c == nil || c.ChallengeUI == nil {
		return ""
	}
	return *c.ChallengeUI
}

func (c *ConnectionPasskeyOptions) GetProgressiveEnrollmentEnabled() bool {
	if c == nil || c.ProgressiveEnrollmentEnabled == nil {
		return false
	}
	return *c.ProgressiveEnrollmentEnabled
}

func (c *ConnectionPasskeyOptions) GetLocalEnrollmentEnabled() bool {
	if c == nil || c.LocalEnrollmentEnabled == nil {
		return false
	}
	return *c.LocalEnrollmentEnabled
}

func (c *ConnectionPasskeyOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetChallengeUI sets the ChallengeUI field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasskeyOptions) SetChallengeUI(challengeUI *ConnectionPasskeyChallengeUIEnum) {
	c.ChallengeUI = challengeUI
	c.require(connectionPasskeyOptionsFieldChallengeUI)
}

// SetProgressiveEnrollmentEnabled sets the ProgressiveEnrollmentEnabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasskeyOptions) SetProgressiveEnrollmentEnabled(progressiveEnrollmentEnabled *bool) {
	c.ProgressiveEnrollmentEnabled = progressiveEnrollmentEnabled
	c.require(connectionPasskeyOptionsFieldProgressiveEnrollmentEnabled)
}

// SetLocalEnrollmentEnabled sets the LocalEnrollmentEnabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasskeyOptions) SetLocalEnrollmentEnabled(localEnrollmentEnabled *bool) {
	c.LocalEnrollmentEnabled = localEnrollmentEnabled
	c.require(connectionPasskeyOptionsFieldLocalEnrollmentEnabled)
}

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

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

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

// Password authentication enablement
var (
	connectionPasswordAuthenticationMethodFieldEnabled = big.NewInt(1 << 0)
)

type ConnectionPasswordAuthenticationMethod struct {
	// Determines whether passwords are enabled
	Enabled *bool `json:"enabled,omitempty" url:"enabled,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 (c *ConnectionPasswordAuthenticationMethod) GetEnabled() bool {
	if c == nil || c.Enabled == nil {
		return false
	}
	return *c.Enabled
}

func (c *ConnectionPasswordAuthenticationMethod) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEnabled sets the Enabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordAuthenticationMethod) SetEnabled(enabled *bool) {
	c.Enabled = enabled
	c.require(connectionPasswordAuthenticationMethodFieldEnabled)
}

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

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

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

// Password complexity options
var (
	connectionPasswordComplexityOptionsFieldMinLength = big.NewInt(1 << 0)
)

type ConnectionPasswordComplexityOptions struct {
	// Minimum password length
	MinLength *int `json:"min_length,omitempty" url:"min_length,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 (c *ConnectionPasswordComplexityOptions) GetMinLength() int {
	if c == nil || c.MinLength == nil {
		return 0
	}
	return *c.MinLength
}

func (c *ConnectionPasswordComplexityOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetMinLength sets the MinLength field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordComplexityOptions) SetMinLength(minLength *int) {
	c.MinLength = minLength
	c.require(connectionPasswordComplexityOptionsFieldMinLength)
}

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

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

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

// Options for password dictionary policy
var (
	connectionPasswordDictionaryOptionsFieldEnable     = big.NewInt(1 << 0)
	connectionPasswordDictionaryOptionsFieldDictionary = big.NewInt(1 << 1)
)

type ConnectionPasswordDictionaryOptions struct {
	Enable bool `json:"enable" url:"enable"`
	// Custom Password Dictionary. An array of up to 200 entries.
	Dictionary []string `json:"dictionary,omitempty" url:"dictionary,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 (c *ConnectionPasswordDictionaryOptions) GetEnable() bool {
	if c == nil {
		return false
	}
	return c.Enable
}

func (c *ConnectionPasswordDictionaryOptions) GetDictionary() []string {
	if c == nil || c.Dictionary == nil {
		return nil
	}
	return c.Dictionary
}

func (c *ConnectionPasswordDictionaryOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEnable sets the Enable field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordDictionaryOptions) SetEnable(enable bool) {
	c.Enable = enable
	c.require(connectionPasswordDictionaryOptionsFieldEnable)
}

// SetDictionary sets the Dictionary field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordDictionaryOptions) SetDictionary(dictionary []string) {
	c.Dictionary = dictionary
	c.require(connectionPasswordDictionaryOptionsFieldDictionary)
}

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

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

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

// Options for password history policy
var (
	connectionPasswordHistoryOptionsFieldEnable = big.NewInt(1 << 0)
	connectionPasswordHistoryOptionsFieldSize   = big.NewInt(1 << 1)
)

type ConnectionPasswordHistoryOptions struct {
	Enable bool `json:"enable" url:"enable"`
	Size   *int `json:"size,omitempty" url:"size,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 (c *ConnectionPasswordHistoryOptions) GetEnable() bool {
	if c == nil {
		return false
	}
	return c.Enable
}

func (c *ConnectionPasswordHistoryOptions) GetSize() int {
	if c == nil || c.Size == nil {
		return 0
	}
	return *c.Size
}

func (c *ConnectionPasswordHistoryOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEnable sets the Enable field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordHistoryOptions) SetEnable(enable bool) {
	c.Enable = enable
	c.require(connectionPasswordHistoryOptionsFieldEnable)
}

// SetSize sets the Size field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordHistoryOptions) SetSize(size *int) {
	c.Size = size
	c.require(connectionPasswordHistoryOptionsFieldSize)
}

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

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

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

// Options for personal info in passwords policy
var (
	connectionPasswordNoPersonalInfoOptionsFieldEnable = big.NewInt(1 << 0)
)

type ConnectionPasswordNoPersonalInfoOptions struct {
	Enable bool `json:"enable" url:"enable"`

	// 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 (c *ConnectionPasswordNoPersonalInfoOptions) GetEnable() bool {
	if c == nil {
		return false
	}
	return c.Enable
}

func (c *ConnectionPasswordNoPersonalInfoOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetEnable sets the Enable field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPasswordNoPersonalInfoOptions) SetEnable(enable bool) {
	c.Enable = enable
	c.require(connectionPasswordNoPersonalInfoOptionsFieldEnable)
}

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

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

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

// Password strength level
type ConnectionPasswordPolicyEnum string

const (
	ConnectionPasswordPolicyEnumNone      ConnectionPasswordPolicyEnum = "none"
	ConnectionPasswordPolicyEnumLow       ConnectionPasswordPolicyEnum = "low"
	ConnectionPasswordPolicyEnumFair      ConnectionPasswordPolicyEnum = "fair"
	ConnectionPasswordPolicyEnumGood      ConnectionPasswordPolicyEnum = "good"
	ConnectionPasswordPolicyEnumExcellent ConnectionPasswordPolicyEnum = "excellent"
)

func NewConnectionPasswordPolicyEnumFromString(s string) (ConnectionPasswordPolicyEnum, error) {
	switch s {
	case "none":
		return ConnectionPasswordPolicyEnumNone, nil
	case "low":
		return ConnectionPasswordPolicyEnumLow, nil
	case "fair":
		return ConnectionPasswordPolicyEnumFair, nil
	case "good":
		return ConnectionPasswordPolicyEnumGood, nil
	case "excellent":
		return ConnectionPasswordPolicyEnumExcellent, nil
	}
	var t ConnectionPasswordPolicyEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionPasswordPolicyEnum) Ptr() *ConnectionPasswordPolicyEnum {
	return &c
}

// The connection's options (depend on the connection strategy)
var (
	connectionPropertiesOptionsFieldValidation                       = big.NewInt(1 << 0)
	connectionPropertiesOptionsFieldNonPersistentAttrs               = big.NewInt(1 << 1)
	connectionPropertiesOptionsFieldPrecedence                       = big.NewInt(1 << 2)
	connectionPropertiesOptionsFieldAttributes                       = big.NewInt(1 << 3)
	connectionPropertiesOptionsFieldEnableScriptContext              = big.NewInt(1 << 4)
	connectionPropertiesOptionsFieldEnabledDatabaseCustomization     = big.NewInt(1 << 5)
	connectionPropertiesOptionsFieldImportMode                       = big.NewInt(1 << 6)
	connectionPropertiesOptionsFieldCustomScripts                    = big.NewInt(1 << 7)
	connectionPropertiesOptionsFieldAuthenticationMethods            = big.NewInt(1 << 8)
	connectionPropertiesOptionsFieldPasskeyOptions                   = big.NewInt(1 << 9)
	connectionPropertiesOptionsFieldPasswordPolicy                   = big.NewInt(1 << 10)
	connectionPropertiesOptionsFieldPasswordComplexityOptions        = big.NewInt(1 << 11)
	connectionPropertiesOptionsFieldPasswordHistory                  = big.NewInt(1 << 12)
	connectionPropertiesOptionsFieldPasswordNoPersonalInfo           = big.NewInt(1 << 13)
	connectionPropertiesOptionsFieldPasswordDictionary               = big.NewInt(1 << 14)
	connectionPropertiesOptionsFieldAPIEnableUsers                   = big.NewInt(1 << 15)
	connectionPropertiesOptionsFieldBasicProfile                     = big.NewInt(1 << 16)
	connectionPropertiesOptionsFieldExtAdmin                         = big.NewInt(1 << 17)
	connectionPropertiesOptionsFieldExtIsSuspended                   = big.NewInt(1 << 18)
	connectionPropertiesOptionsFieldExtAgreedTerms                   = big.NewInt(1 << 19)
	connectionPropertiesOptionsFieldExtGroups                        = big.NewInt(1 << 20)
	connectionPropertiesOptionsFieldExtAssignedPlans                 = big.NewInt(1 << 21)
	connectionPropertiesOptionsFieldExtProfile                       = big.NewInt(1 << 22)
	connectionPropertiesOptionsFieldDisableSelfServiceChangePassword = big.NewInt(1 << 23)
	connectionPropertiesOptionsFieldUpstreamParams                   = big.NewInt(1 << 24)
	connectionPropertiesOptionsFieldSetUserRootAttributes            = big.NewInt(1 << 25)
	connectionPropertiesOptionsFieldGatewayAuthentication            = big.NewInt(1 << 26)
	connectionPropertiesOptionsFieldFederatedConnectionsAccessTokens = big.NewInt(1 << 27)
)

type ConnectionPropertiesOptions struct {
	Validation *ConnectionValidationOptions `json:"validation,omitempty" url:"validation,omitempty"`
	// An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist)
	NonPersistentAttrs []string `json:"non_persistent_attrs,omitempty" url:"non_persistent_attrs,omitempty"`
	// Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used.
	Precedence          []ConnectionIdentifierPrecedenceEnum `json:"precedence,omitempty" url:"precedence,omitempty"`
	Attributes          *ConnectionAttributes                `json:"attributes,omitempty" url:"attributes,omitempty"`
	EnableScriptContext *bool                                `json:"enable_script_context,omitempty" url:"enable_script_context,omitempty"`
	// Set to true to use a legacy user store
	EnabledDatabaseCustomization *bool `json:"enabledDatabaseCustomization,omitempty" url:"enabledDatabaseCustomization,omitempty"`
	// Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store
	ImportMode                       *bool                                       `json:"import_mode,omitempty" url:"import_mode,omitempty"`
	CustomScripts                    *ConnectionCustomScripts                    `json:"customScripts,omitempty" url:"customScripts,omitempty"`
	AuthenticationMethods            *ConnectionAuthenticationMethods            `json:"authentication_methods,omitempty" url:"authentication_methods,omitempty"`
	PasskeyOptions                   *ConnectionPasskeyOptions                   `json:"passkey_options,omitempty" url:"passkey_options,omitempty"`
	PasswordPolicy                   *ConnectionPasswordPolicyEnum               `json:"passwordPolicy,omitempty" url:"passwordPolicy,omitempty"`
	PasswordComplexityOptions        *ConnectionPasswordComplexityOptions        `json:"password_complexity_options,omitempty" url:"password_complexity_options,omitempty"`
	PasswordHistory                  *ConnectionPasswordHistoryOptions           `json:"password_history,omitempty" url:"password_history,omitempty"`
	PasswordNoPersonalInfo           *ConnectionPasswordNoPersonalInfoOptions    `json:"password_no_personal_info,omitempty" url:"password_no_personal_info,omitempty"`
	PasswordDictionary               *ConnectionPasswordDictionaryOptions        `json:"password_dictionary,omitempty" url:"password_dictionary,omitempty"`
	APIEnableUsers                   *bool                                       `json:"api_enable_users,omitempty" url:"api_enable_users,omitempty"`
	BasicProfile                     *bool                                       `json:"basic_profile,omitempty" url:"basic_profile,omitempty"`
	ExtAdmin                         *bool                                       `json:"ext_admin,omitempty" url:"ext_admin,omitempty"`
	ExtIsSuspended                   *bool                                       `json:"ext_is_suspended,omitempty" url:"ext_is_suspended,omitempty"`
	ExtAgreedTerms                   *bool                                       `json:"ext_agreed_terms,omitempty" url:"ext_agreed_terms,omitempty"`
	ExtGroups                        *bool                                       `json:"ext_groups,omitempty" url:"ext_groups,omitempty"`
	ExtAssignedPlans                 *bool                                       `json:"ext_assigned_plans,omitempty" url:"ext_assigned_plans,omitempty"`
	ExtProfile                       *bool                                       `json:"ext_profile,omitempty" url:"ext_profile,omitempty"`
	DisableSelfServiceChangePassword *bool                                       `json:"disable_self_service_change_password,omitempty" url:"disable_self_service_change_password,omitempty"`
	UpstreamParams                   *ConnectionUpstreamParams                   `json:"upstream_params,omitempty" url:"upstream_params,omitempty"`
	SetUserRootAttributes            *ConnectionSetUserRootAttributesEnum        `json:"set_user_root_attributes,omitempty" url:"set_user_root_attributes,omitempty"`
	GatewayAuthentication            *ConnectionGatewayAuthentication            `json:"gateway_authentication,omitempty" url:"gateway_authentication,omitempty"`
	FederatedConnectionsAccessTokens *ConnectionFederatedConnectionsAccessTokens `json:"federated_connections_access_tokens,omitempty" url:"federated_connections_access_tokens,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{} `json:"-" url:"-"`

	rawJSON json.RawMessage
}

func (c *ConnectionPropertiesOptions) GetValidation() ConnectionValidationOptions {
	if c == nil || c.Validation == nil {
		return ConnectionValidationOptions{}
	}
	return *c.Validation
}

func (c *ConnectionPropertiesOptions) GetNonPersistentAttrs() []string {
	if c == nil || c.NonPersistentAttrs == nil {
		return nil
	}
	return c.NonPersistentAttrs
}

func (c *ConnectionPropertiesOptions) GetPrecedence() []ConnectionIdentifierPrecedenceEnum {
	if c == nil || c.Precedence == nil {
		return nil
	}
	return c.Precedence
}

func (c *ConnectionPropertiesOptions) GetAttributes() ConnectionAttributes {
	if c == nil || c.Attributes == nil {
		return ConnectionAttributes{}
	}
	return *c.Attributes
}

func (c *ConnectionPropertiesOptions) GetEnableScriptContext() bool {
	if c == nil || c.EnableScriptContext == nil {
		return false
	}
	return *c.EnableScriptContext
}

func (c *ConnectionPropertiesOptions) GetEnabledDatabaseCustomization() bool {
	if c == nil || c.EnabledDatabaseCustomization == nil {
		return false
	}
	return *c.EnabledDatabaseCustomization
}

func (c *ConnectionPropertiesOptions) GetImportMode() bool {
	if c == nil || c.ImportMode == nil {
		return false
	}
	return *c.ImportMode
}

func (c *ConnectionPropertiesOptions) GetCustomScripts() ConnectionCustomScripts {
	if c == nil || c.CustomScripts == nil {
		return ConnectionCustomScripts{}
	}
	return *c.CustomScripts
}

func (c *ConnectionPropertiesOptions) GetAuthenticationMethods() ConnectionAuthenticationMethods {
	if c == nil || c.AuthenticationMethods == nil {
		return ConnectionAuthenticationMethods{}
	}
	return *c.AuthenticationMethods
}

func (c *ConnectionPropertiesOptions) GetPasskeyOptions() ConnectionPasskeyOptions {
	if c == nil || c.PasskeyOptions == nil {
		return ConnectionPasskeyOptions{}
	}
	return *c.PasskeyOptions
}

func (c *ConnectionPropertiesOptions) GetPasswordPolicy() ConnectionPasswordPolicyEnum {
	if c == nil || c.PasswordPolicy == nil {
		return ""
	}
	return *c.PasswordPolicy
}

func (c *ConnectionPropertiesOptions) GetPasswordComplexityOptions() ConnectionPasswordComplexityOptions {
	if c == nil || c.PasswordComplexityOptions == nil {
		return ConnectionPasswordComplexityOptions{}
	}
	return *c.PasswordComplexityOptions
}

func (c *ConnectionPropertiesOptions) GetPasswordHistory() ConnectionPasswordHistoryOptions {
	if c == nil || c.PasswordHistory == nil {
		return ConnectionPasswordHistoryOptions{}
	}
	return *c.PasswordHistory
}

func (c *ConnectionPropertiesOptions) GetPasswordNoPersonalInfo() ConnectionPasswordNoPersonalInfoOptions {
	if c == nil || c.PasswordNoPersonalInfo == nil {
		return ConnectionPasswordNoPersonalInfoOptions{}
	}
	return *c.PasswordNoPersonalInfo
}

func (c *ConnectionPropertiesOptions) GetPasswordDictionary() ConnectionPasswordDictionaryOptions {
	if c == nil || c.PasswordDictionary == nil {
		return ConnectionPasswordDictionaryOptions{}
	}
	return *c.PasswordDictionary
}

func (c *ConnectionPropertiesOptions) GetAPIEnableUsers() bool {
	if c == nil || c.APIEnableUsers == nil {
		return false
	}
	return *c.APIEnableUsers
}

func (c *ConnectionPropertiesOptions) GetBasicProfile() bool {
	if c == nil || c.BasicProfile == nil {
		return false
	}
	return *c.BasicProfile
}

func (c *ConnectionPropertiesOptions) GetExtAdmin() bool {
	if c == nil || c.ExtAdmin == nil {
		return false
	}
	return *c.ExtAdmin
}

func (c *ConnectionPropertiesOptions) GetExtIsSuspended() bool {
	if c == nil || c.ExtIsSuspended == nil {
		return false
	}
	return *c.ExtIsSuspended
}

func (c *ConnectionPropertiesOptions) GetExtAgreedTerms() bool {
	if c == nil || c.ExtAgreedTerms == nil {
		return false
	}
	return *c.ExtAgreedTerms
}

func (c *ConnectionPropertiesOptions) GetExtGroups() bool {
	if c == nil || c.ExtGroups == nil {
		return false
	}
	return *c.ExtGroups
}

func (c *ConnectionPropertiesOptions) GetExtAssignedPlans() bool {
	if c == nil || c.ExtAssignedPlans == nil {
		return false
	}
	return *c.ExtAssignedPlans
}

func (c *ConnectionPropertiesOptions) GetExtProfile() bool {
	if c == nil || c.ExtProfile == nil {
		return false
	}
	return *c.ExtProfile
}

func (c *ConnectionPropertiesOptions) GetDisableSelfServiceChangePassword() bool {
	if c == nil || c.DisableSelfServiceChangePassword == nil {
		return false
	}
	return *c.DisableSelfServiceChangePassword
}

func (c *ConnectionPropertiesOptions) GetUpstreamParams() ConnectionUpstreamParams {
	if c == nil || c.UpstreamParams == nil {
		return nil
	}
	return *c.UpstreamParams
}

func (c *ConnectionPropertiesOptions) GetSetUserRootAttributes() ConnectionSetUserRootAttributesEnum {
	if c == nil || c.SetUserRootAttributes == nil {
		return ""
	}
	return *c.SetUserRootAttributes
}

func (c *ConnectionPropertiesOptions) GetGatewayAuthentication() ConnectionGatewayAuthentication {
	if c == nil || c.GatewayAuthentication == nil {
		return ConnectionGatewayAuthentication{}
	}
	return *c.GatewayAuthentication
}

func (c *ConnectionPropertiesOptions) GetFederatedConnectionsAccessTokens() ConnectionFederatedConnectionsAccessTokens {
	if c == nil || c.FederatedConnectionsAccessTokens == nil {
		return ConnectionFederatedConnectionsAccessTokens{}
	}
	return *c.FederatedConnectionsAccessTokens
}

func (c *ConnectionPropertiesOptions) GetExtraProperties() map[string]interface{} {
	return c.ExtraProperties
}

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

// SetValidation sets the Validation field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetValidation(validation *ConnectionValidationOptions) {
	c.Validation = validation
	c.require(connectionPropertiesOptionsFieldValidation)
}

// SetNonPersistentAttrs sets the NonPersistentAttrs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetNonPersistentAttrs(nonPersistentAttrs []string) {
	c.NonPersistentAttrs = nonPersistentAttrs
	c.require(connectionPropertiesOptionsFieldNonPersistentAttrs)
}

// SetPrecedence sets the Precedence field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPrecedence(precedence []ConnectionIdentifierPrecedenceEnum) {
	c.Precedence = precedence
	c.require(connectionPropertiesOptionsFieldPrecedence)
}

// 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 (c *ConnectionPropertiesOptions) SetAttributes(attributes *ConnectionAttributes) {
	c.Attributes = attributes
	c.require(connectionPropertiesOptionsFieldAttributes)
}

// SetEnableScriptContext sets the EnableScriptContext field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetEnableScriptContext(enableScriptContext *bool) {
	c.EnableScriptContext = enableScriptContext
	c.require(connectionPropertiesOptionsFieldEnableScriptContext)
}

// SetEnabledDatabaseCustomization sets the EnabledDatabaseCustomization field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetEnabledDatabaseCustomization(enabledDatabaseCustomization *bool) {
	c.EnabledDatabaseCustomization = enabledDatabaseCustomization
	c.require(connectionPropertiesOptionsFieldEnabledDatabaseCustomization)
}

// SetImportMode sets the ImportMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetImportMode(importMode *bool) {
	c.ImportMode = importMode
	c.require(connectionPropertiesOptionsFieldImportMode)
}

// SetCustomScripts sets the CustomScripts field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetCustomScripts(customScripts *ConnectionCustomScripts) {
	c.CustomScripts = customScripts
	c.require(connectionPropertiesOptionsFieldCustomScripts)
}

// SetAuthenticationMethods sets the AuthenticationMethods field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetAuthenticationMethods(authenticationMethods *ConnectionAuthenticationMethods) {
	c.AuthenticationMethods = authenticationMethods
	c.require(connectionPropertiesOptionsFieldAuthenticationMethods)
}

// SetPasskeyOptions sets the PasskeyOptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasskeyOptions(passkeyOptions *ConnectionPasskeyOptions) {
	c.PasskeyOptions = passkeyOptions
	c.require(connectionPropertiesOptionsFieldPasskeyOptions)
}

// SetPasswordPolicy sets the PasswordPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasswordPolicy(passwordPolicy *ConnectionPasswordPolicyEnum) {
	c.PasswordPolicy = passwordPolicy
	c.require(connectionPropertiesOptionsFieldPasswordPolicy)
}

// SetPasswordComplexityOptions sets the PasswordComplexityOptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasswordComplexityOptions(passwordComplexityOptions *ConnectionPasswordComplexityOptions) {
	c.PasswordComplexityOptions = passwordComplexityOptions
	c.require(connectionPropertiesOptionsFieldPasswordComplexityOptions)
}

// SetPasswordHistory sets the PasswordHistory field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasswordHistory(passwordHistory *ConnectionPasswordHistoryOptions) {
	c.PasswordHistory = passwordHistory
	c.require(connectionPropertiesOptionsFieldPasswordHistory)
}

// SetPasswordNoPersonalInfo sets the PasswordNoPersonalInfo field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasswordNoPersonalInfo(passwordNoPersonalInfo *ConnectionPasswordNoPersonalInfoOptions) {
	c.PasswordNoPersonalInfo = passwordNoPersonalInfo
	c.require(connectionPropertiesOptionsFieldPasswordNoPersonalInfo)
}

// SetPasswordDictionary sets the PasswordDictionary field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetPasswordDictionary(passwordDictionary *ConnectionPasswordDictionaryOptions) {
	c.PasswordDictionary = passwordDictionary
	c.require(connectionPropertiesOptionsFieldPasswordDictionary)
}

// SetAPIEnableUsers sets the APIEnableUsers field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetAPIEnableUsers(apiEnableUsers *bool) {
	c.APIEnableUsers = apiEnableUsers
	c.require(connectionPropertiesOptionsFieldAPIEnableUsers)
}

// SetBasicProfile sets the BasicProfile field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetBasicProfile(basicProfile *bool) {
	c.BasicProfile = basicProfile
	c.require(connectionPropertiesOptionsFieldBasicProfile)
}

// SetExtAdmin sets the ExtAdmin field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtAdmin(extAdmin *bool) {
	c.ExtAdmin = extAdmin
	c.require(connectionPropertiesOptionsFieldExtAdmin)
}

// SetExtIsSuspended sets the ExtIsSuspended field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtIsSuspended(extIsSuspended *bool) {
	c.ExtIsSuspended = extIsSuspended
	c.require(connectionPropertiesOptionsFieldExtIsSuspended)
}

// SetExtAgreedTerms sets the ExtAgreedTerms field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtAgreedTerms(extAgreedTerms *bool) {
	c.ExtAgreedTerms = extAgreedTerms
	c.require(connectionPropertiesOptionsFieldExtAgreedTerms)
}

// SetExtGroups sets the ExtGroups field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtGroups(extGroups *bool) {
	c.ExtGroups = extGroups
	c.require(connectionPropertiesOptionsFieldExtGroups)
}

// SetExtAssignedPlans sets the ExtAssignedPlans field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtAssignedPlans(extAssignedPlans *bool) {
	c.ExtAssignedPlans = extAssignedPlans
	c.require(connectionPropertiesOptionsFieldExtAssignedPlans)
}

// SetExtProfile sets the ExtProfile field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetExtProfile(extProfile *bool) {
	c.ExtProfile = extProfile
	c.require(connectionPropertiesOptionsFieldExtProfile)
}

// SetDisableSelfServiceChangePassword sets the DisableSelfServiceChangePassword field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetDisableSelfServiceChangePassword(disableSelfServiceChangePassword *bool) {
	c.DisableSelfServiceChangePassword = disableSelfServiceChangePassword
	c.require(connectionPropertiesOptionsFieldDisableSelfServiceChangePassword)
}

// SetUpstreamParams sets the UpstreamParams field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetUpstreamParams(upstreamParams *ConnectionUpstreamParams) {
	c.UpstreamParams = upstreamParams
	c.require(connectionPropertiesOptionsFieldUpstreamParams)
}

// SetSetUserRootAttributes sets the SetUserRootAttributes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetSetUserRootAttributes(setUserRootAttributes *ConnectionSetUserRootAttributesEnum) {
	c.SetUserRootAttributes = setUserRootAttributes
	c.require(connectionPropertiesOptionsFieldSetUserRootAttributes)
}

// SetGatewayAuthentication sets the GatewayAuthentication field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetGatewayAuthentication(gatewayAuthentication *ConnectionGatewayAuthentication) {
	c.GatewayAuthentication = gatewayAuthentication
	c.require(connectionPropertiesOptionsFieldGatewayAuthentication)
}

// SetFederatedConnectionsAccessTokens sets the FederatedConnectionsAccessTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionPropertiesOptions) SetFederatedConnectionsAccessTokens(federatedConnectionsAccessTokens *ConnectionFederatedConnectionsAccessTokens) {
	c.FederatedConnectionsAccessTokens = federatedConnectionsAccessTokens
	c.require(connectionPropertiesOptionsFieldFederatedConnectionsAccessTokens)
}

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

func (c *ConnectionPropertiesOptions) MarshalJSON() ([]byte, error) {
	type embed ConnectionPropertiesOptions
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return internal.MarshalJSONWithExtraProperties(explicitMarshaler, c.ExtraProperties)
}

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

// When using an external IdP, this flag determines  whether 'name', 'given_name', 'family_name', 'nickname', and 'picture' attributes are updated. In addition, it also determines whether the user is created when user doesnt exist previously. Possible values are 'on_each_login' (default value, it configures the connection to automatically create the user if necessary and update the root attributes from the external IdP with each user login. When this setting is used, root attributes cannot be independently updated), 'on_first_login' (configures the connection to create the user and set the root attributes on first login only, allowing them to be independently updated thereafter), and 'never_on_login' (configures the connection not to create the user and not to set the root attributes from the external IdP, allowing them to be independently updated).
type ConnectionSetUserRootAttributesEnum string

const (
	ConnectionSetUserRootAttributesEnumOnEachLogin  ConnectionSetUserRootAttributesEnum = "on_each_login"
	ConnectionSetUserRootAttributesEnumOnFirstLogin ConnectionSetUserRootAttributesEnum = "on_first_login"
	ConnectionSetUserRootAttributesEnumNeverOnLogin ConnectionSetUserRootAttributesEnum = "never_on_login"
)

func NewConnectionSetUserRootAttributesEnumFromString(s string) (ConnectionSetUserRootAttributesEnum, error) {
	switch s {
	case "on_each_login":
		return ConnectionSetUserRootAttributesEnumOnEachLogin, nil
	case "on_first_login":
		return ConnectionSetUserRootAttributesEnumOnFirstLogin, nil
	case "never_on_login":
		return ConnectionSetUserRootAttributesEnumNeverOnLogin, nil
	}
	var t ConnectionSetUserRootAttributesEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionSetUserRootAttributesEnum) Ptr() *ConnectionSetUserRootAttributesEnum {
	return &c
}

type ConnectionUpstreamAdditionalProperties struct {
	ConnectionUpstreamAlias *ConnectionUpstreamAlias
	ConnectionUpstreamValue *ConnectionUpstreamValue

	typ string
}

func (c *ConnectionUpstreamAdditionalProperties) GetConnectionUpstreamAlias() *ConnectionUpstreamAlias {
	if c == nil {
		return nil
	}
	return c.ConnectionUpstreamAlias
}

func (c *ConnectionUpstreamAdditionalProperties) GetConnectionUpstreamValue() *ConnectionUpstreamValue {
	if c == nil {
		return nil
	}
	return c.ConnectionUpstreamValue
}

func (c *ConnectionUpstreamAdditionalProperties) UnmarshalJSON(data []byte) error {
	valueConnectionUpstreamAlias := new(ConnectionUpstreamAlias)
	if err := json.Unmarshal(data, &valueConnectionUpstreamAlias); err == nil {
		c.typ = "ConnectionUpstreamAlias"
		c.ConnectionUpstreamAlias = valueConnectionUpstreamAlias
		return nil
	}
	valueConnectionUpstreamValue := new(ConnectionUpstreamValue)
	if err := json.Unmarshal(data, &valueConnectionUpstreamValue); err == nil {
		c.typ = "ConnectionUpstreamValue"
		c.ConnectionUpstreamValue = valueConnectionUpstreamValue
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, c)
}

func (c ConnectionUpstreamAdditionalProperties) MarshalJSON() ([]byte, error) {
	if c.typ == "ConnectionUpstreamAlias" || c.ConnectionUpstreamAlias != nil {
		return json.Marshal(c.ConnectionUpstreamAlias)
	}
	if c.typ == "ConnectionUpstreamValue" || c.ConnectionUpstreamValue != nil {
		return json.Marshal(c.ConnectionUpstreamValue)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", c)
}

type ConnectionUpstreamAdditionalPropertiesVisitor interface {
	VisitConnectionUpstreamAlias(*ConnectionUpstreamAlias) error
	VisitConnectionUpstreamValue(*ConnectionUpstreamValue) error
}

func (c *ConnectionUpstreamAdditionalProperties) Accept(visitor ConnectionUpstreamAdditionalPropertiesVisitor) error {
	if c.typ == "ConnectionUpstreamAlias" || c.ConnectionUpstreamAlias != nil {
		return visitor.VisitConnectionUpstreamAlias(c.ConnectionUpstreamAlias)
	}
	if c.typ == "ConnectionUpstreamValue" || c.ConnectionUpstreamValue != nil {
		return visitor.VisitConnectionUpstreamValue(c.ConnectionUpstreamValue)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", c)
}

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

type ConnectionUpstreamAlias struct {
	Alias *ConnectionUpstreamAliasEnum `json:"alias,omitempty" url:"alias,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 (c *ConnectionUpstreamAlias) GetAlias() ConnectionUpstreamAliasEnum {
	if c == nil || c.Alias == nil {
		return ""
	}
	return *c.Alias
}

func (c *ConnectionUpstreamAlias) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetAlias sets the Alias field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionUpstreamAlias) SetAlias(alias *ConnectionUpstreamAliasEnum) {
	c.Alias = alias
	c.require(connectionUpstreamAliasFieldAlias)
}

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

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

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

type ConnectionUpstreamAliasEnum string

const (
	ConnectionUpstreamAliasEnumAcrValues    ConnectionUpstreamAliasEnum = "acr_values"
	ConnectionUpstreamAliasEnumAudience     ConnectionUpstreamAliasEnum = "audience"
	ConnectionUpstreamAliasEnumClientID     ConnectionUpstreamAliasEnum = "client_id"
	ConnectionUpstreamAliasEnumDisplay      ConnectionUpstreamAliasEnum = "display"
	ConnectionUpstreamAliasEnumIDTokenHint  ConnectionUpstreamAliasEnum = "id_token_hint"
	ConnectionUpstreamAliasEnumLoginHint    ConnectionUpstreamAliasEnum = "login_hint"
	ConnectionUpstreamAliasEnumMaxAge       ConnectionUpstreamAliasEnum = "max_age"
	ConnectionUpstreamAliasEnumPrompt       ConnectionUpstreamAliasEnum = "prompt"
	ConnectionUpstreamAliasEnumResource     ConnectionUpstreamAliasEnum = "resource"
	ConnectionUpstreamAliasEnumResponseMode ConnectionUpstreamAliasEnum = "response_mode"
	ConnectionUpstreamAliasEnumResponseType ConnectionUpstreamAliasEnum = "response_type"
	ConnectionUpstreamAliasEnumUILocales    ConnectionUpstreamAliasEnum = "ui_locales"
)

func NewConnectionUpstreamAliasEnumFromString(s string) (ConnectionUpstreamAliasEnum, error) {
	switch s {
	case "acr_values":
		return ConnectionUpstreamAliasEnumAcrValues, nil
	case "audience":
		return ConnectionUpstreamAliasEnumAudience, nil
	case "client_id":
		return ConnectionUpstreamAliasEnumClientID, nil
	case "display":
		return ConnectionUpstreamAliasEnumDisplay, nil
	case "id_token_hint":
		return ConnectionUpstreamAliasEnumIDTokenHint, nil
	case "login_hint":
		return ConnectionUpstreamAliasEnumLoginHint, nil
	case "max_age":
		return ConnectionUpstreamAliasEnumMaxAge, nil
	case "prompt":
		return ConnectionUpstreamAliasEnumPrompt, nil
	case "resource":
		return ConnectionUpstreamAliasEnumResource, nil
	case "response_mode":
		return ConnectionUpstreamAliasEnumResponseMode, nil
	case "response_type":
		return ConnectionUpstreamAliasEnumResponseType, nil
	case "ui_locales":
		return ConnectionUpstreamAliasEnumUILocales, nil
	}
	var t ConnectionUpstreamAliasEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (c ConnectionUpstreamAliasEnum) Ptr() *ConnectionUpstreamAliasEnum {
	return &c
}

// Options for adding parameters in the request to the upstream IdP
type ConnectionUpstreamParams = map[string]*ConnectionUpstreamAdditionalProperties

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

type ConnectionUpstreamValue struct {
	Value *string `json:"value,omitempty" url:"value,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 (c *ConnectionUpstreamValue) GetValue() string {
	if c == nil || c.Value == nil {
		return ""
	}
	return *c.Value
}

func (c *ConnectionUpstreamValue) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// 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 (c *ConnectionUpstreamValue) SetValue(value *string) {
	c.Value = value
	c.require(connectionUpstreamValueFieldValue)
}

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

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

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

var (
	connectionUsernameValidationOptionsFieldMin = big.NewInt(1 << 0)
	connectionUsernameValidationOptionsFieldMax = big.NewInt(1 << 1)
)

type ConnectionUsernameValidationOptions struct {
	Min int `json:"min" url:"min"`
	Max int `json:"max" url:"max"`

	// 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 (c *ConnectionUsernameValidationOptions) GetMin() int {
	if c == nil {
		return 0
	}
	return c.Min
}

func (c *ConnectionUsernameValidationOptions) GetMax() int {
	if c == nil {
		return 0
	}
	return c.Max
}

func (c *ConnectionUsernameValidationOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

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

// SetMin sets the Min field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionUsernameValidationOptions) SetMin(min int) {
	c.Min = min
	c.require(connectionUsernameValidationOptionsFieldMin)
}

// SetMax sets the Max field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionUsernameValidationOptions) SetMax(max int) {
	c.Max = max
	c.require(connectionUsernameValidationOptionsFieldMax)
}

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

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

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

// Options for validation
var (
	connectionValidationOptionsFieldUsername = big.NewInt(1 << 0)
)

type ConnectionValidationOptions struct {
	Username *ConnectionUsernameValidationOptions `json:"username,omitempty" url:"username,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 (c *ConnectionValidationOptions) GetUsername() ConnectionUsernameValidationOptions {
	if c == nil || c.Username == nil {
		return ConnectionUsernameValidationOptions{}
	}
	return *c.Username
}

func (c *ConnectionValidationOptions) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *ConnectionValidationOptions) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.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 (c *ConnectionValidationOptions) SetUsername(username *ConnectionUsernameValidationOptions) {
	c.Username = username
	c.require(connectionValidationOptionsFieldUsername)
}

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

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

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

var (
	createConnectionResponseContentFieldName               = big.NewInt(1 << 0)
	createConnectionResponseContentFieldDisplayName        = big.NewInt(1 << 1)
	createConnectionResponseContentFieldOptions            = big.NewInt(1 << 2)
	createConnectionResponseContentFieldID                 = big.NewInt(1 << 3)
	createConnectionResponseContentFieldStrategy           = big.NewInt(1 << 4)
	createConnectionResponseContentFieldRealms             = big.NewInt(1 << 5)
	createConnectionResponseContentFieldEnabledClients     = big.NewInt(1 << 6)
	createConnectionResponseContentFieldIsDomainConnection = big.NewInt(1 << 7)
	createConnectionResponseContentFieldShowAsButton       = big.NewInt(1 << 8)
	createConnectionResponseContentFieldMetadata           = big.NewInt(1 << 9)
)

type CreateConnectionResponseContent struct {
	// The name of the connection
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Connection name used in login screen
	DisplayName *string            `json:"display_name,omitempty" url:"display_name,omitempty"`
	Options     *ConnectionOptions `json:"options,omitempty" url:"options,omitempty"`
	// The connection's identifier
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The type of the connection, related to the identity provider
	Strategy *string `json:"strategy,omitempty" url:"strategy,omitempty"`
	// Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
	Realms []string `json:"realms,omitempty" url:"realms,omitempty"`
	// DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled
	EnabledClients []string `json:"enabled_clients,omitempty" url:"enabled_clients,omitempty"`
	// True if the connection is domain level
	IsDomainConnection *bool `json:"is_domain_connection,omitempty" url:"is_domain_connection,omitempty"`
	// Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
	ShowAsButton *bool                `json:"show_as_button,omitempty" url:"show_as_button,omitempty"`
	Metadata     *ConnectionsMetadata `json:"metadata,omitempty" url:"metadata,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 (c *CreateConnectionResponseContent) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}

func (c *CreateConnectionResponseContent) GetDisplayName() string {
	if c == nil || c.DisplayName == nil {
		return ""
	}
	return *c.DisplayName
}

func (c *CreateConnectionResponseContent) GetOptions() ConnectionOptions {
	if c == nil || c.Options == nil {
		return nil
	}
	return *c.Options
}

func (c *CreateConnectionResponseContent) GetID() string {
	if c == nil || c.ID == nil {
		return ""
	}
	return *c.ID
}

func (c *CreateConnectionResponseContent) GetStrategy() string {
	if c == nil || c.Strategy == nil {
		return ""
	}
	return *c.Strategy
}

func (c *CreateConnectionResponseContent) GetRealms() []string {
	if c == nil || c.Realms == nil {
		return nil
	}
	return c.Realms
}

func (c *CreateConnectionResponseContent) GetEnabledClients() []string {
	if c == nil || c.EnabledClients == nil {
		return nil
	}
	return c.EnabledClients
}

func (c *CreateConnectionResponseContent) GetIsDomainConnection() bool {
	if c == nil || c.IsDomainConnection == nil {
		return false
	}
	return *c.IsDomainConnection
}

func (c *CreateConnectionResponseContent) GetShowAsButton() bool {
	if c == nil || c.ShowAsButton == nil {
		return false
	}
	return *c.ShowAsButton
}

func (c *CreateConnectionResponseContent) GetMetadata() ConnectionsMetadata {
	if c == nil || c.Metadata == nil {
		return nil
	}
	return *c.Metadata
}

func (c *CreateConnectionResponseContent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateConnectionResponseContent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.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 (c *CreateConnectionResponseContent) SetName(name *string) {
	c.Name = name
	c.require(createConnectionResponseContentFieldName)
}

// SetDisplayName sets the DisplayName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetDisplayName(displayName *string) {
	c.DisplayName = displayName
	c.require(createConnectionResponseContentFieldDisplayName)
}

// SetOptions sets the Options field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetOptions(options *ConnectionOptions) {
	c.Options = options
	c.require(createConnectionResponseContentFieldOptions)
}

// 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 (c *CreateConnectionResponseContent) SetID(id *string) {
	c.ID = id
	c.require(createConnectionResponseContentFieldID)
}

// SetStrategy sets the Strategy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetStrategy(strategy *string) {
	c.Strategy = strategy
	c.require(createConnectionResponseContentFieldStrategy)
}

// SetRealms sets the Realms field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetRealms(realms []string) {
	c.Realms = realms
	c.require(createConnectionResponseContentFieldRealms)
}

// SetEnabledClients sets the EnabledClients field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetEnabledClients(enabledClients []string) {
	c.EnabledClients = enabledClients
	c.require(createConnectionResponseContentFieldEnabledClients)
}

// SetIsDomainConnection sets the IsDomainConnection field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetIsDomainConnection(isDomainConnection *bool) {
	c.IsDomainConnection = isDomainConnection
	c.require(createConnectionResponseContentFieldIsDomainConnection)
}

// SetShowAsButton sets the ShowAsButton field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetShowAsButton(showAsButton *bool) {
	c.ShowAsButton = showAsButton
	c.require(createConnectionResponseContentFieldShowAsButton)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateConnectionResponseContent) SetMetadata(metadata *ConnectionsMetadata) {
	c.Metadata = metadata
	c.require(createConnectionResponseContentFieldMetadata)
}

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

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

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

// Configuration for the email attribute for users.
var (
	emailAttributeFieldIdentifier         = big.NewInt(1 << 0)
	emailAttributeFieldProfileRequired    = big.NewInt(1 << 1)
	emailAttributeFieldVerificationMethod = big.NewInt(1 << 2)
	emailAttributeFieldSignup             = big.NewInt(1 << 3)
)

type EmailAttribute struct {
	Identifier *ConnectionAttributeIdentifier `json:"identifier,omitempty" url:"identifier,omitempty"`
	// Determines if property should be required for users
	ProfileRequired    *bool                   `json:"profile_required,omitempty" url:"profile_required,omitempty"`
	VerificationMethod *VerificationMethodEnum `json:"verification_method,omitempty" url:"verification_method,omitempty"`
	Signup             *SignupVerified         `json:"signup,omitempty" url:"signup,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 (e *EmailAttribute) GetIdentifier() ConnectionAttributeIdentifier {
	if e == nil || e.Identifier == nil {
		return ConnectionAttributeIdentifier{}
	}
	return *e.Identifier
}

func (e *EmailAttribute) GetProfileRequired() bool {
	if e == nil || e.ProfileRequired == nil {
		return false
	}
	return *e.ProfileRequired
}

func (e *EmailAttribute) GetVerificationMethod() VerificationMethodEnum {
	if e == nil || e.VerificationMethod == nil {
		return ""
	}
	return *e.VerificationMethod
}

func (e *EmailAttribute) GetSignup() SignupVerified {
	if e == nil || e.Signup == nil {
		return SignupVerified{}
	}
	return *e.Signup
}

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

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

// SetIdentifier sets the Identifier field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EmailAttribute) SetIdentifier(identifier *ConnectionAttributeIdentifier) {
	e.Identifier = identifier
	e.require(emailAttributeFieldIdentifier)
}

// SetProfileRequired sets the ProfileRequired field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EmailAttribute) SetProfileRequired(profileRequired *bool) {
	e.ProfileRequired = profileRequired
	e.require(emailAttributeFieldProfileRequired)
}

// SetVerificationMethod sets the VerificationMethod field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EmailAttribute) SetVerificationMethod(verificationMethod *VerificationMethodEnum) {
	e.VerificationMethod = verificationMethod
	e.require(emailAttributeFieldVerificationMethod)
}

// SetSignup sets the Signup field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EmailAttribute) SetSignup(signup *SignupVerified) {
	e.Signup = signup
	e.require(emailAttributeFieldSignup)
}

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

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

func (e *EmailAttribute) 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 (
	getConnectionResponseContentFieldName               = big.NewInt(1 << 0)
	getConnectionResponseContentFieldDisplayName        = big.NewInt(1 << 1)
	getConnectionResponseContentFieldOptions            = big.NewInt(1 << 2)
	getConnectionResponseContentFieldID                 = big.NewInt(1 << 3)
	getConnectionResponseContentFieldStrategy           = big.NewInt(1 << 4)
	getConnectionResponseContentFieldRealms             = big.NewInt(1 << 5)
	getConnectionResponseContentFieldEnabledClients     = big.NewInt(1 << 6)
	getConnectionResponseContentFieldIsDomainConnection = big.NewInt(1 << 7)
	getConnectionResponseContentFieldShowAsButton       = big.NewInt(1 << 8)
	getConnectionResponseContentFieldMetadata           = big.NewInt(1 << 9)
)

type GetConnectionResponseContent struct {
	// The name of the connection
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Connection name used in login screen
	DisplayName *string            `json:"display_name,omitempty" url:"display_name,omitempty"`
	Options     *ConnectionOptions `json:"options,omitempty" url:"options,omitempty"`
	// The connection's identifier
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The type of the connection, related to the identity provider
	Strategy *string `json:"strategy,omitempty" url:"strategy,omitempty"`
	// Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
	Realms []string `json:"realms,omitempty" url:"realms,omitempty"`
	// DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled
	EnabledClients []string `json:"enabled_clients,omitempty" url:"enabled_clients,omitempty"`
	// True if the connection is domain level
	IsDomainConnection *bool `json:"is_domain_connection,omitempty" url:"is_domain_connection,omitempty"`
	// Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
	ShowAsButton *bool                `json:"show_as_button,omitempty" url:"show_as_button,omitempty"`
	Metadata     *ConnectionsMetadata `json:"metadata,omitempty" url:"metadata,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 (g *GetConnectionResponseContent) GetName() string {
	if g == nil || g.Name == nil {
		return ""
	}
	return *g.Name
}

func (g *GetConnectionResponseContent) GetDisplayName() string {
	if g == nil || g.DisplayName == nil {
		return ""
	}
	return *g.DisplayName
}

func (g *GetConnectionResponseContent) GetOptions() ConnectionOptions {
	if g == nil || g.Options == nil {
		return nil
	}
	return *g.Options
}

func (g *GetConnectionResponseContent) GetID() string {
	if g == nil || g.ID == nil {
		return ""
	}
	return *g.ID
}

func (g *GetConnectionResponseContent) GetStrategy() string {
	if g == nil || g.Strategy == nil {
		return ""
	}
	return *g.Strategy
}

func (g *GetConnectionResponseContent) GetRealms() []string {
	if g == nil || g.Realms == nil {
		return nil
	}
	return g.Realms
}

func (g *GetConnectionResponseContent) GetEnabledClients() []string {
	if g == nil || g.EnabledClients == nil {
		return nil
	}
	return g.EnabledClients
}

func (g *GetConnectionResponseContent) GetIsDomainConnection() bool {
	if g == nil || g.IsDomainConnection == nil {
		return false
	}
	return *g.IsDomainConnection
}

func (g *GetConnectionResponseContent) GetShowAsButton() bool {
	if g == nil || g.ShowAsButton == nil {
		return false
	}
	return *g.ShowAsButton
}

func (g *GetConnectionResponseContent) GetMetadata() ConnectionsMetadata {
	if g == nil || g.Metadata == nil {
		return nil
	}
	return *g.Metadata
}

func (g *GetConnectionResponseContent) GetExtraProperties() map[string]interface{} {
	return g.extraProperties
}

func (g *GetConnectionResponseContent) require(field *big.Int) {
	if g.explicitFields == nil {
		g.explicitFields = big.NewInt(0)
	}
	g.explicitFields.Or(g.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 (g *GetConnectionResponseContent) SetName(name *string) {
	g.Name = name
	g.require(getConnectionResponseContentFieldName)
}

// SetDisplayName sets the DisplayName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetDisplayName(displayName *string) {
	g.DisplayName = displayName
	g.require(getConnectionResponseContentFieldDisplayName)
}

// SetOptions sets the Options field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetOptions(options *ConnectionOptions) {
	g.Options = options
	g.require(getConnectionResponseContentFieldOptions)
}

// 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 (g *GetConnectionResponseContent) SetID(id *string) {
	g.ID = id
	g.require(getConnectionResponseContentFieldID)
}

// SetStrategy sets the Strategy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetStrategy(strategy *string) {
	g.Strategy = strategy
	g.require(getConnectionResponseContentFieldStrategy)
}

// SetRealms sets the Realms field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetRealms(realms []string) {
	g.Realms = realms
	g.require(getConnectionResponseContentFieldRealms)
}

// SetEnabledClients sets the EnabledClients field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetEnabledClients(enabledClients []string) {
	g.EnabledClients = enabledClients
	g.require(getConnectionResponseContentFieldEnabledClients)
}

// SetIsDomainConnection sets the IsDomainConnection field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetIsDomainConnection(isDomainConnection *bool) {
	g.IsDomainConnection = isDomainConnection
	g.require(getConnectionResponseContentFieldIsDomainConnection)
}

// SetShowAsButton sets the ShowAsButton field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetShowAsButton(showAsButton *bool) {
	g.ShowAsButton = showAsButton
	g.require(getConnectionResponseContentFieldShowAsButton)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetConnectionResponseContent) SetMetadata(metadata *ConnectionsMetadata) {
	g.Metadata = metadata
	g.require(getConnectionResponseContentFieldMetadata)
}

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

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

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

var (
	listConnectionsCheckpointPaginatedResponseContentFieldNext        = big.NewInt(1 << 0)
	listConnectionsCheckpointPaginatedResponseContentFieldConnections = big.NewInt(1 << 1)
)

type ListConnectionsCheckpointPaginatedResponseContent struct {
	// Opaque identifier for use with the <i>from</i> query parameter for the next page of results.
	Next        *string              `json:"next,omitempty" url:"next,omitempty"`
	Connections []*ConnectionForList `json:"connections,omitempty" url:"connections,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 (l *ListConnectionsCheckpointPaginatedResponseContent) GetNext() string {
	if l == nil || l.Next == nil {
		return ""
	}
	return *l.Next
}

func (l *ListConnectionsCheckpointPaginatedResponseContent) GetConnections() []*ConnectionForList {
	if l == nil || l.Connections == nil {
		return nil
	}
	return l.Connections
}

func (l *ListConnectionsCheckpointPaginatedResponseContent) GetExtraProperties() map[string]interface{} {
	return l.extraProperties
}

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

// SetNext sets the Next field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListConnectionsCheckpointPaginatedResponseContent) SetNext(next *string) {
	l.Next = next
	l.require(listConnectionsCheckpointPaginatedResponseContentFieldNext)
}

// SetConnections sets the Connections field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListConnectionsCheckpointPaginatedResponseContent) SetConnections(connections []*ConnectionForList) {
	l.Connections = connections
	l.require(listConnectionsCheckpointPaginatedResponseContentFieldConnections)
}

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

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

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

// Configuration for the phone number attribute for users.
var (
	phoneAttributeFieldIdentifier      = big.NewInt(1 << 0)
	phoneAttributeFieldProfileRequired = big.NewInt(1 << 1)
	phoneAttributeFieldSignup          = big.NewInt(1 << 2)
)

type PhoneAttribute struct {
	Identifier *ConnectionAttributeIdentifier `json:"identifier,omitempty" url:"identifier,omitempty"`
	// Determines if property should be required for users
	ProfileRequired *bool           `json:"profile_required,omitempty" url:"profile_required,omitempty"`
	Signup          *SignupVerified `json:"signup,omitempty" url:"signup,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 (p *PhoneAttribute) GetIdentifier() ConnectionAttributeIdentifier {
	if p == nil || p.Identifier == nil {
		return ConnectionAttributeIdentifier{}
	}
	return *p.Identifier
}

func (p *PhoneAttribute) GetProfileRequired() bool {
	if p == nil || p.ProfileRequired == nil {
		return false
	}
	return *p.ProfileRequired
}

func (p *PhoneAttribute) GetSignup() SignupVerified {
	if p == nil || p.Signup == nil {
		return SignupVerified{}
	}
	return *p.Signup
}

func (p *PhoneAttribute) GetExtraProperties() map[string]interface{} {
	return p.extraProperties
}

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

// SetIdentifier sets the Identifier field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PhoneAttribute) SetIdentifier(identifier *ConnectionAttributeIdentifier) {
	p.Identifier = identifier
	p.require(phoneAttributeFieldIdentifier)
}

// SetProfileRequired sets the ProfileRequired field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PhoneAttribute) SetProfileRequired(profileRequired *bool) {
	p.ProfileRequired = profileRequired
	p.require(phoneAttributeFieldProfileRequired)
}

// SetSignup sets the Signup field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (p *PhoneAttribute) SetSignup(signup *SignupVerified) {
	p.Signup = signup
	p.require(phoneAttributeFieldSignup)
}

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

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

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

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

type SignupSchema struct {
	Status *SignupStatusEnum `json:"status,omitempty" url:"status,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 *SignupSchema) GetStatus() SignupStatusEnum {
	if s == nil || s.Status == nil {
		return ""
	}
	return *s.Status
}

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

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

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SignupSchema) SetStatus(status *SignupStatusEnum) {
	s.Status = status
	s.require(signupSchemaFieldStatus)
}

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

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

func (s *SignupSchema) 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)
}

type SignupStatusEnum string

const (
	SignupStatusEnumRequired SignupStatusEnum = "required"
	SignupStatusEnumOptional SignupStatusEnum = "optional"
	SignupStatusEnumInactive SignupStatusEnum = "inactive"
)

func NewSignupStatusEnumFromString(s string) (SignupStatusEnum, error) {
	switch s {
	case "required":
		return SignupStatusEnumRequired, nil
	case "optional":
		return SignupStatusEnumOptional, nil
	case "inactive":
		return SignupStatusEnumInactive, nil
	}
	var t SignupStatusEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (s SignupStatusEnum) Ptr() *SignupStatusEnum {
	return &s
}

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

type SignupVerification struct {
	Active *bool `json:"active,omitempty" url:"active,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 *SignupVerification) GetActive() bool {
	if s == nil || s.Active == nil {
		return false
	}
	return *s.Active
}

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

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

// 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 *SignupVerification) SetActive(active *bool) {
	s.Active = active
	s.require(signupVerificationFieldActive)
}

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

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

func (s *SignupVerification) 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 (
	signupVerifiedFieldStatus       = big.NewInt(1 << 0)
	signupVerifiedFieldVerification = big.NewInt(1 << 1)
)

type SignupVerified struct {
	Status       *SignupStatusEnum   `json:"status,omitempty" url:"status,omitempty"`
	Verification *SignupVerification `json:"verification,omitempty" url:"verification,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 *SignupVerified) GetStatus() SignupStatusEnum {
	if s == nil || s.Status == nil {
		return ""
	}
	return *s.Status
}

func (s *SignupVerified) GetVerification() SignupVerification {
	if s == nil || s.Verification == nil {
		return SignupVerification{}
	}
	return *s.Verification
}

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

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

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SignupVerified) SetStatus(status *SignupStatusEnum) {
	s.Status = status
	s.require(signupVerifiedFieldStatus)
}

// SetVerification sets the Verification field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SignupVerified) SetVerification(verification *SignupVerification) {
	s.Verification = verification
	s.require(signupVerifiedFieldVerification)
}

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

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

func (s *SignupVerified) 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)
}

// The connection's options (depend on the connection strategy). To update these options, the `update:connections_options` scope must be present. To verify your changes, also include the `read:connections_options` scope. If this scope is not specified, you will not be able to review the updated object.
var (
	updateConnectionOptionsFieldValidation                       = big.NewInt(1 << 0)
	updateConnectionOptionsFieldNonPersistentAttrs               = big.NewInt(1 << 1)
	updateConnectionOptionsFieldPrecedence                       = big.NewInt(1 << 2)
	updateConnectionOptionsFieldAttributes                       = big.NewInt(1 << 3)
	updateConnectionOptionsFieldEnableScriptContext              = big.NewInt(1 << 4)
	updateConnectionOptionsFieldEnabledDatabaseCustomization     = big.NewInt(1 << 5)
	updateConnectionOptionsFieldImportMode                       = big.NewInt(1 << 6)
	updateConnectionOptionsFieldCustomScripts                    = big.NewInt(1 << 7)
	updateConnectionOptionsFieldAuthenticationMethods            = big.NewInt(1 << 8)
	updateConnectionOptionsFieldPasskeyOptions                   = big.NewInt(1 << 9)
	updateConnectionOptionsFieldPasswordPolicy                   = big.NewInt(1 << 10)
	updateConnectionOptionsFieldPasswordComplexityOptions        = big.NewInt(1 << 11)
	updateConnectionOptionsFieldPasswordHistory                  = big.NewInt(1 << 12)
	updateConnectionOptionsFieldPasswordNoPersonalInfo           = big.NewInt(1 << 13)
	updateConnectionOptionsFieldPasswordDictionary               = big.NewInt(1 << 14)
	updateConnectionOptionsFieldAPIEnableUsers                   = big.NewInt(1 << 15)
	updateConnectionOptionsFieldBasicProfile                     = big.NewInt(1 << 16)
	updateConnectionOptionsFieldExtAdmin                         = big.NewInt(1 << 17)
	updateConnectionOptionsFieldExtIsSuspended                   = big.NewInt(1 << 18)
	updateConnectionOptionsFieldExtAgreedTerms                   = big.NewInt(1 << 19)
	updateConnectionOptionsFieldExtGroups                        = big.NewInt(1 << 20)
	updateConnectionOptionsFieldExtAssignedPlans                 = big.NewInt(1 << 21)
	updateConnectionOptionsFieldExtProfile                       = big.NewInt(1 << 22)
	updateConnectionOptionsFieldDisableSelfServiceChangePassword = big.NewInt(1 << 23)
	updateConnectionOptionsFieldUpstreamParams                   = big.NewInt(1 << 24)
	updateConnectionOptionsFieldSetUserRootAttributes            = big.NewInt(1 << 25)
	updateConnectionOptionsFieldGatewayAuthentication            = big.NewInt(1 << 26)
	updateConnectionOptionsFieldFederatedConnectionsAccessTokens = big.NewInt(1 << 27)
)

type UpdateConnectionOptions struct {
	Validation *ConnectionValidationOptions `json:"validation,omitempty" url:"validation,omitempty"`
	// An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist)
	NonPersistentAttrs []string `json:"non_persistent_attrs,omitempty" url:"non_persistent_attrs,omitempty"`
	// Order of precedence for attribute types. If the property is not specified, the default precedence of attributes will be used.
	Precedence          []ConnectionIdentifierPrecedenceEnum `json:"precedence,omitempty" url:"precedence,omitempty"`
	Attributes          *ConnectionAttributes                `json:"attributes,omitempty" url:"attributes,omitempty"`
	EnableScriptContext *bool                                `json:"enable_script_context,omitempty" url:"enable_script_context,omitempty"`
	// Set to true to use a legacy user store
	EnabledDatabaseCustomization *bool `json:"enabledDatabaseCustomization,omitempty" url:"enabledDatabaseCustomization,omitempty"`
	// Enable this if you have a legacy user store and you want to gradually migrate those users to the Auth0 user store
	ImportMode                       *bool                                       `json:"import_mode,omitempty" url:"import_mode,omitempty"`
	CustomScripts                    *ConnectionCustomScripts                    `json:"customScripts,omitempty" url:"customScripts,omitempty"`
	AuthenticationMethods            *ConnectionAuthenticationMethods            `json:"authentication_methods,omitempty" url:"authentication_methods,omitempty"`
	PasskeyOptions                   *ConnectionPasskeyOptions                   `json:"passkey_options,omitempty" url:"passkey_options,omitempty"`
	PasswordPolicy                   *ConnectionPasswordPolicyEnum               `json:"passwordPolicy,omitempty" url:"passwordPolicy,omitempty"`
	PasswordComplexityOptions        *ConnectionPasswordComplexityOptions        `json:"password_complexity_options,omitempty" url:"password_complexity_options,omitempty"`
	PasswordHistory                  *ConnectionPasswordHistoryOptions           `json:"password_history,omitempty" url:"password_history,omitempty"`
	PasswordNoPersonalInfo           *ConnectionPasswordNoPersonalInfoOptions    `json:"password_no_personal_info,omitempty" url:"password_no_personal_info,omitempty"`
	PasswordDictionary               *ConnectionPasswordDictionaryOptions        `json:"password_dictionary,omitempty" url:"password_dictionary,omitempty"`
	APIEnableUsers                   *bool                                       `json:"api_enable_users,omitempty" url:"api_enable_users,omitempty"`
	BasicProfile                     *bool                                       `json:"basic_profile,omitempty" url:"basic_profile,omitempty"`
	ExtAdmin                         *bool                                       `json:"ext_admin,omitempty" url:"ext_admin,omitempty"`
	ExtIsSuspended                   *bool                                       `json:"ext_is_suspended,omitempty" url:"ext_is_suspended,omitempty"`
	ExtAgreedTerms                   *bool                                       `json:"ext_agreed_terms,omitempty" url:"ext_agreed_terms,omitempty"`
	ExtGroups                        *bool                                       `json:"ext_groups,omitempty" url:"ext_groups,omitempty"`
	ExtAssignedPlans                 *bool                                       `json:"ext_assigned_plans,omitempty" url:"ext_assigned_plans,omitempty"`
	ExtProfile                       *bool                                       `json:"ext_profile,omitempty" url:"ext_profile,omitempty"`
	DisableSelfServiceChangePassword *bool                                       `json:"disable_self_service_change_password,omitempty" url:"disable_self_service_change_password,omitempty"`
	UpstreamParams                   *ConnectionUpstreamParams                   `json:"upstream_params,omitempty" url:"upstream_params,omitempty"`
	SetUserRootAttributes            *ConnectionSetUserRootAttributesEnum        `json:"set_user_root_attributes,omitempty" url:"set_user_root_attributes,omitempty"`
	GatewayAuthentication            *ConnectionGatewayAuthentication            `json:"gateway_authentication,omitempty" url:"gateway_authentication,omitempty"`
	FederatedConnectionsAccessTokens *ConnectionFederatedConnectionsAccessTokens `json:"federated_connections_access_tokens,omitempty" url:"federated_connections_access_tokens,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{} `json:"-" url:"-"`

	rawJSON json.RawMessage
}

func (u *UpdateConnectionOptions) GetValidation() ConnectionValidationOptions {
	if u == nil || u.Validation == nil {
		return ConnectionValidationOptions{}
	}
	return *u.Validation
}

func (u *UpdateConnectionOptions) GetNonPersistentAttrs() []string {
	if u == nil || u.NonPersistentAttrs == nil {
		return nil
	}
	return u.NonPersistentAttrs
}

func (u *UpdateConnectionOptions) GetPrecedence() []ConnectionIdentifierPrecedenceEnum {
	if u == nil || u.Precedence == nil {
		return nil
	}
	return u.Precedence
}

func (u *UpdateConnectionOptions) GetAttributes() ConnectionAttributes {
	if u == nil || u.Attributes == nil {
		return ConnectionAttributes{}
	}
	return *u.Attributes
}

func (u *UpdateConnectionOptions) GetEnableScriptContext() bool {
	if u == nil || u.EnableScriptContext == nil {
		return false
	}
	return *u.EnableScriptContext
}

func (u *UpdateConnectionOptions) GetEnabledDatabaseCustomization() bool {
	if u == nil || u.EnabledDatabaseCustomization == nil {
		return false
	}
	return *u.EnabledDatabaseCustomization
}

func (u *UpdateConnectionOptions) GetImportMode() bool {
	if u == nil || u.ImportMode == nil {
		return false
	}
	return *u.ImportMode
}

func (u *UpdateConnectionOptions) GetCustomScripts() ConnectionCustomScripts {
	if u == nil || u.CustomScripts == nil {
		return ConnectionCustomScripts{}
	}
	return *u.CustomScripts
}

func (u *UpdateConnectionOptions) GetAuthenticationMethods() ConnectionAuthenticationMethods {
	if u == nil || u.AuthenticationMethods == nil {
		return ConnectionAuthenticationMethods{}
	}
	return *u.AuthenticationMethods
}

func (u *UpdateConnectionOptions) GetPasskeyOptions() ConnectionPasskeyOptions {
	if u == nil || u.PasskeyOptions == nil {
		return ConnectionPasskeyOptions{}
	}
	return *u.PasskeyOptions
}

func (u *UpdateConnectionOptions) GetPasswordPolicy() ConnectionPasswordPolicyEnum {
	if u == nil || u.PasswordPolicy == nil {
		return ""
	}
	return *u.PasswordPolicy
}

func (u *UpdateConnectionOptions) GetPasswordComplexityOptions() ConnectionPasswordComplexityOptions {
	if u == nil || u.PasswordComplexityOptions == nil {
		return ConnectionPasswordComplexityOptions{}
	}
	return *u.PasswordComplexityOptions
}

func (u *UpdateConnectionOptions) GetPasswordHistory() ConnectionPasswordHistoryOptions {
	if u == nil || u.PasswordHistory == nil {
		return ConnectionPasswordHistoryOptions{}
	}
	return *u.PasswordHistory
}

func (u *UpdateConnectionOptions) GetPasswordNoPersonalInfo() ConnectionPasswordNoPersonalInfoOptions {
	if u == nil || u.PasswordNoPersonalInfo == nil {
		return ConnectionPasswordNoPersonalInfoOptions{}
	}
	return *u.PasswordNoPersonalInfo
}

func (u *UpdateConnectionOptions) GetPasswordDictionary() ConnectionPasswordDictionaryOptions {
	if u == nil || u.PasswordDictionary == nil {
		return ConnectionPasswordDictionaryOptions{}
	}
	return *u.PasswordDictionary
}

func (u *UpdateConnectionOptions) GetAPIEnableUsers() bool {
	if u == nil || u.APIEnableUsers == nil {
		return false
	}
	return *u.APIEnableUsers
}

func (u *UpdateConnectionOptions) GetBasicProfile() bool {
	if u == nil || u.BasicProfile == nil {
		return false
	}
	return *u.BasicProfile
}

func (u *UpdateConnectionOptions) GetExtAdmin() bool {
	if u == nil || u.ExtAdmin == nil {
		return false
	}
	return *u.ExtAdmin
}

func (u *UpdateConnectionOptions) GetExtIsSuspended() bool {
	if u == nil || u.ExtIsSuspended == nil {
		return false
	}
	return *u.ExtIsSuspended
}

func (u *UpdateConnectionOptions) GetExtAgreedTerms() bool {
	if u == nil || u.ExtAgreedTerms == nil {
		return false
	}
	return *u.ExtAgreedTerms
}

func (u *UpdateConnectionOptions) GetExtGroups() bool {
	if u == nil || u.ExtGroups == nil {
		return false
	}
	return *u.ExtGroups
}

func (u *UpdateConnectionOptions) GetExtAssignedPlans() bool {
	if u == nil || u.ExtAssignedPlans == nil {
		return false
	}
	return *u.ExtAssignedPlans
}

func (u *UpdateConnectionOptions) GetExtProfile() bool {
	if u == nil || u.ExtProfile == nil {
		return false
	}
	return *u.ExtProfile
}

func (u *UpdateConnectionOptions) GetDisableSelfServiceChangePassword() bool {
	if u == nil || u.DisableSelfServiceChangePassword == nil {
		return false
	}
	return *u.DisableSelfServiceChangePassword
}

func (u *UpdateConnectionOptions) GetUpstreamParams() ConnectionUpstreamParams {
	if u == nil || u.UpstreamParams == nil {
		return nil
	}
	return *u.UpstreamParams
}

func (u *UpdateConnectionOptions) GetSetUserRootAttributes() ConnectionSetUserRootAttributesEnum {
	if u == nil || u.SetUserRootAttributes == nil {
		return ""
	}
	return *u.SetUserRootAttributes
}

func (u *UpdateConnectionOptions) GetGatewayAuthentication() ConnectionGatewayAuthentication {
	if u == nil || u.GatewayAuthentication == nil {
		return ConnectionGatewayAuthentication{}
	}
	return *u.GatewayAuthentication
}

func (u *UpdateConnectionOptions) GetFederatedConnectionsAccessTokens() ConnectionFederatedConnectionsAccessTokens {
	if u == nil || u.FederatedConnectionsAccessTokens == nil {
		return ConnectionFederatedConnectionsAccessTokens{}
	}
	return *u.FederatedConnectionsAccessTokens
}

func (u *UpdateConnectionOptions) GetExtraProperties() map[string]interface{} {
	return u.ExtraProperties
}

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

// SetValidation sets the Validation field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetValidation(validation *ConnectionValidationOptions) {
	u.Validation = validation
	u.require(updateConnectionOptionsFieldValidation)
}

// SetNonPersistentAttrs sets the NonPersistentAttrs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetNonPersistentAttrs(nonPersistentAttrs []string) {
	u.NonPersistentAttrs = nonPersistentAttrs
	u.require(updateConnectionOptionsFieldNonPersistentAttrs)
}

// SetPrecedence sets the Precedence field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPrecedence(precedence []ConnectionIdentifierPrecedenceEnum) {
	u.Precedence = precedence
	u.require(updateConnectionOptionsFieldPrecedence)
}

// 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 (u *UpdateConnectionOptions) SetAttributes(attributes *ConnectionAttributes) {
	u.Attributes = attributes
	u.require(updateConnectionOptionsFieldAttributes)
}

// SetEnableScriptContext sets the EnableScriptContext field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetEnableScriptContext(enableScriptContext *bool) {
	u.EnableScriptContext = enableScriptContext
	u.require(updateConnectionOptionsFieldEnableScriptContext)
}

// SetEnabledDatabaseCustomization sets the EnabledDatabaseCustomization field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetEnabledDatabaseCustomization(enabledDatabaseCustomization *bool) {
	u.EnabledDatabaseCustomization = enabledDatabaseCustomization
	u.require(updateConnectionOptionsFieldEnabledDatabaseCustomization)
}

// SetImportMode sets the ImportMode field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetImportMode(importMode *bool) {
	u.ImportMode = importMode
	u.require(updateConnectionOptionsFieldImportMode)
}

// SetCustomScripts sets the CustomScripts field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetCustomScripts(customScripts *ConnectionCustomScripts) {
	u.CustomScripts = customScripts
	u.require(updateConnectionOptionsFieldCustomScripts)
}

// SetAuthenticationMethods sets the AuthenticationMethods field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetAuthenticationMethods(authenticationMethods *ConnectionAuthenticationMethods) {
	u.AuthenticationMethods = authenticationMethods
	u.require(updateConnectionOptionsFieldAuthenticationMethods)
}

// SetPasskeyOptions sets the PasskeyOptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasskeyOptions(passkeyOptions *ConnectionPasskeyOptions) {
	u.PasskeyOptions = passkeyOptions
	u.require(updateConnectionOptionsFieldPasskeyOptions)
}

// SetPasswordPolicy sets the PasswordPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasswordPolicy(passwordPolicy *ConnectionPasswordPolicyEnum) {
	u.PasswordPolicy = passwordPolicy
	u.require(updateConnectionOptionsFieldPasswordPolicy)
}

// SetPasswordComplexityOptions sets the PasswordComplexityOptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasswordComplexityOptions(passwordComplexityOptions *ConnectionPasswordComplexityOptions) {
	u.PasswordComplexityOptions = passwordComplexityOptions
	u.require(updateConnectionOptionsFieldPasswordComplexityOptions)
}

// SetPasswordHistory sets the PasswordHistory field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasswordHistory(passwordHistory *ConnectionPasswordHistoryOptions) {
	u.PasswordHistory = passwordHistory
	u.require(updateConnectionOptionsFieldPasswordHistory)
}

// SetPasswordNoPersonalInfo sets the PasswordNoPersonalInfo field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasswordNoPersonalInfo(passwordNoPersonalInfo *ConnectionPasswordNoPersonalInfoOptions) {
	u.PasswordNoPersonalInfo = passwordNoPersonalInfo
	u.require(updateConnectionOptionsFieldPasswordNoPersonalInfo)
}

// SetPasswordDictionary sets the PasswordDictionary field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetPasswordDictionary(passwordDictionary *ConnectionPasswordDictionaryOptions) {
	u.PasswordDictionary = passwordDictionary
	u.require(updateConnectionOptionsFieldPasswordDictionary)
}

// SetAPIEnableUsers sets the APIEnableUsers field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetAPIEnableUsers(apiEnableUsers *bool) {
	u.APIEnableUsers = apiEnableUsers
	u.require(updateConnectionOptionsFieldAPIEnableUsers)
}

// SetBasicProfile sets the BasicProfile field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetBasicProfile(basicProfile *bool) {
	u.BasicProfile = basicProfile
	u.require(updateConnectionOptionsFieldBasicProfile)
}

// SetExtAdmin sets the ExtAdmin field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtAdmin(extAdmin *bool) {
	u.ExtAdmin = extAdmin
	u.require(updateConnectionOptionsFieldExtAdmin)
}

// SetExtIsSuspended sets the ExtIsSuspended field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtIsSuspended(extIsSuspended *bool) {
	u.ExtIsSuspended = extIsSuspended
	u.require(updateConnectionOptionsFieldExtIsSuspended)
}

// SetExtAgreedTerms sets the ExtAgreedTerms field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtAgreedTerms(extAgreedTerms *bool) {
	u.ExtAgreedTerms = extAgreedTerms
	u.require(updateConnectionOptionsFieldExtAgreedTerms)
}

// SetExtGroups sets the ExtGroups field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtGroups(extGroups *bool) {
	u.ExtGroups = extGroups
	u.require(updateConnectionOptionsFieldExtGroups)
}

// SetExtAssignedPlans sets the ExtAssignedPlans field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtAssignedPlans(extAssignedPlans *bool) {
	u.ExtAssignedPlans = extAssignedPlans
	u.require(updateConnectionOptionsFieldExtAssignedPlans)
}

// SetExtProfile sets the ExtProfile field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetExtProfile(extProfile *bool) {
	u.ExtProfile = extProfile
	u.require(updateConnectionOptionsFieldExtProfile)
}

// SetDisableSelfServiceChangePassword sets the DisableSelfServiceChangePassword field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetDisableSelfServiceChangePassword(disableSelfServiceChangePassword *bool) {
	u.DisableSelfServiceChangePassword = disableSelfServiceChangePassword
	u.require(updateConnectionOptionsFieldDisableSelfServiceChangePassword)
}

// SetUpstreamParams sets the UpstreamParams field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetUpstreamParams(upstreamParams *ConnectionUpstreamParams) {
	u.UpstreamParams = upstreamParams
	u.require(updateConnectionOptionsFieldUpstreamParams)
}

// SetSetUserRootAttributes sets the SetUserRootAttributes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetSetUserRootAttributes(setUserRootAttributes *ConnectionSetUserRootAttributesEnum) {
	u.SetUserRootAttributes = setUserRootAttributes
	u.require(updateConnectionOptionsFieldSetUserRootAttributes)
}

// SetGatewayAuthentication sets the GatewayAuthentication field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetGatewayAuthentication(gatewayAuthentication *ConnectionGatewayAuthentication) {
	u.GatewayAuthentication = gatewayAuthentication
	u.require(updateConnectionOptionsFieldGatewayAuthentication)
}

// SetFederatedConnectionsAccessTokens sets the FederatedConnectionsAccessTokens field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionOptions) SetFederatedConnectionsAccessTokens(federatedConnectionsAccessTokens *ConnectionFederatedConnectionsAccessTokens) {
	u.FederatedConnectionsAccessTokens = federatedConnectionsAccessTokens
	u.require(updateConnectionOptionsFieldFederatedConnectionsAccessTokens)
}

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

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

func (u *UpdateConnectionOptions) 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)
}

var (
	updateConnectionResponseContentFieldName               = big.NewInt(1 << 0)
	updateConnectionResponseContentFieldDisplayName        = big.NewInt(1 << 1)
	updateConnectionResponseContentFieldOptions            = big.NewInt(1 << 2)
	updateConnectionResponseContentFieldID                 = big.NewInt(1 << 3)
	updateConnectionResponseContentFieldStrategy           = big.NewInt(1 << 4)
	updateConnectionResponseContentFieldRealms             = big.NewInt(1 << 5)
	updateConnectionResponseContentFieldEnabledClients     = big.NewInt(1 << 6)
	updateConnectionResponseContentFieldIsDomainConnection = big.NewInt(1 << 7)
	updateConnectionResponseContentFieldShowAsButton       = big.NewInt(1 << 8)
	updateConnectionResponseContentFieldMetadata           = big.NewInt(1 << 9)
)

type UpdateConnectionResponseContent struct {
	// The name of the connection
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Connection name used in login screen
	DisplayName *string            `json:"display_name,omitempty" url:"display_name,omitempty"`
	Options     *ConnectionOptions `json:"options,omitempty" url:"options,omitempty"`
	// The connection's identifier
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The type of the connection, related to the identity provider
	Strategy *string `json:"strategy,omitempty" url:"strategy,omitempty"`
	// Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
	Realms []string `json:"realms,omitempty" url:"realms,omitempty"`
	// DEPRECATED property. Use the GET /connections/:id/clients endpoint to get the ids of the clients for which the connection is enabled
	EnabledClients []string `json:"enabled_clients,omitempty" url:"enabled_clients,omitempty"`
	// True if the connection is domain level
	IsDomainConnection *bool `json:"is_domain_connection,omitempty" url:"is_domain_connection,omitempty"`
	// Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD.
	ShowAsButton *bool                `json:"show_as_button,omitempty" url:"show_as_button,omitempty"`
	Metadata     *ConnectionsMetadata `json:"metadata,omitempty" url:"metadata,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 *UpdateConnectionResponseContent) GetName() string {
	if u == nil || u.Name == nil {
		return ""
	}
	return *u.Name
}

func (u *UpdateConnectionResponseContent) GetDisplayName() string {
	if u == nil || u.DisplayName == nil {
		return ""
	}
	return *u.DisplayName
}

func (u *UpdateConnectionResponseContent) GetOptions() ConnectionOptions {
	if u == nil || u.Options == nil {
		return nil
	}
	return *u.Options
}

func (u *UpdateConnectionResponseContent) GetID() string {
	if u == nil || u.ID == nil {
		return ""
	}
	return *u.ID
}

func (u *UpdateConnectionResponseContent) GetStrategy() string {
	if u == nil || u.Strategy == nil {
		return ""
	}
	return *u.Strategy
}

func (u *UpdateConnectionResponseContent) GetRealms() []string {
	if u == nil || u.Realms == nil {
		return nil
	}
	return u.Realms
}

func (u *UpdateConnectionResponseContent) GetEnabledClients() []string {
	if u == nil || u.EnabledClients == nil {
		return nil
	}
	return u.EnabledClients
}

func (u *UpdateConnectionResponseContent) GetIsDomainConnection() bool {
	if u == nil || u.IsDomainConnection == nil {
		return false
	}
	return *u.IsDomainConnection
}

func (u *UpdateConnectionResponseContent) GetShowAsButton() bool {
	if u == nil || u.ShowAsButton == nil {
		return false
	}
	return *u.ShowAsButton
}

func (u *UpdateConnectionResponseContent) GetMetadata() ConnectionsMetadata {
	if u == nil || u.Metadata == nil {
		return nil
	}
	return *u.Metadata
}

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

func (u *UpdateConnectionResponseContent) require(field *big.Int) {
	if u.explicitFields == nil {
		u.explicitFields = big.NewInt(0)
	}
	u.explicitFields.Or(u.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 (u *UpdateConnectionResponseContent) SetName(name *string) {
	u.Name = name
	u.require(updateConnectionResponseContentFieldName)
}

// SetDisplayName sets the DisplayName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetDisplayName(displayName *string) {
	u.DisplayName = displayName
	u.require(updateConnectionResponseContentFieldDisplayName)
}

// SetOptions sets the Options field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetOptions(options *ConnectionOptions) {
	u.Options = options
	u.require(updateConnectionResponseContentFieldOptions)
}

// 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 (u *UpdateConnectionResponseContent) SetID(id *string) {
	u.ID = id
	u.require(updateConnectionResponseContentFieldID)
}

// SetStrategy sets the Strategy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetStrategy(strategy *string) {
	u.Strategy = strategy
	u.require(updateConnectionResponseContentFieldStrategy)
}

// SetRealms sets the Realms field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetRealms(realms []string) {
	u.Realms = realms
	u.require(updateConnectionResponseContentFieldRealms)
}

// SetEnabledClients sets the EnabledClients field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetEnabledClients(enabledClients []string) {
	u.EnabledClients = enabledClients
	u.require(updateConnectionResponseContentFieldEnabledClients)
}

// SetIsDomainConnection sets the IsDomainConnection field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetIsDomainConnection(isDomainConnection *bool) {
	u.IsDomainConnection = isDomainConnection
	u.require(updateConnectionResponseContentFieldIsDomainConnection)
}

// SetShowAsButton sets the ShowAsButton field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetShowAsButton(showAsButton *bool) {
	u.ShowAsButton = showAsButton
	u.require(updateConnectionResponseContentFieldShowAsButton)
}

// SetMetadata sets the Metadata field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateConnectionResponseContent) SetMetadata(metadata *ConnectionsMetadata) {
	u.Metadata = metadata
	u.require(updateConnectionResponseContentFieldMetadata)
}

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

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

func (u *UpdateConnectionResponseContent) 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)
}

var (
	usernameAllowedTypesFieldEmail       = big.NewInt(1 << 0)
	usernameAllowedTypesFieldPhoneNumber = big.NewInt(1 << 1)
)

type UsernameAllowedTypes struct {
	Email       *bool `json:"email,omitempty" url:"email,omitempty"`
	PhoneNumber *bool `json:"phone_number,omitempty" url:"phone_number,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 *UsernameAllowedTypes) GetEmail() bool {
	if u == nil || u.Email == nil {
		return false
	}
	return *u.Email
}

func (u *UsernameAllowedTypes) GetPhoneNumber() bool {
	if u == nil || u.PhoneNumber == nil {
		return false
	}
	return *u.PhoneNumber
}

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

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

// SetEmail sets the Email field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAllowedTypes) SetEmail(email *bool) {
	u.Email = email
	u.require(usernameAllowedTypesFieldEmail)
}

// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAllowedTypes) SetPhoneNumber(phoneNumber *bool) {
	u.PhoneNumber = phoneNumber
	u.require(usernameAllowedTypesFieldPhoneNumber)
}

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

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

func (u *UsernameAllowedTypes) 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)
}

// Configuration for the username attribute for users.
var (
	usernameAttributeFieldIdentifier      = big.NewInt(1 << 0)
	usernameAttributeFieldProfileRequired = big.NewInt(1 << 1)
	usernameAttributeFieldSignup          = big.NewInt(1 << 2)
	usernameAttributeFieldValidation      = big.NewInt(1 << 3)
)

type UsernameAttribute struct {
	Identifier *ConnectionAttributeIdentifier `json:"identifier,omitempty" url:"identifier,omitempty"`
	// Determines if property should be required for users
	ProfileRequired *bool               `json:"profile_required,omitempty" url:"profile_required,omitempty"`
	Signup          *SignupSchema       `json:"signup,omitempty" url:"signup,omitempty"`
	Validation      *UsernameValidation `json:"validation,omitempty" url:"validation,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 *UsernameAttribute) GetIdentifier() ConnectionAttributeIdentifier {
	if u == nil || u.Identifier == nil {
		return ConnectionAttributeIdentifier{}
	}
	return *u.Identifier
}

func (u *UsernameAttribute) GetProfileRequired() bool {
	if u == nil || u.ProfileRequired == nil {
		return false
	}
	return *u.ProfileRequired
}

func (u *UsernameAttribute) GetSignup() SignupSchema {
	if u == nil || u.Signup == nil {
		return SignupSchema{}
	}
	return *u.Signup
}

func (u *UsernameAttribute) GetValidation() UsernameValidation {
	if u == nil || u.Validation == nil {
		return UsernameValidation{}
	}
	return *u.Validation
}

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

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

// SetIdentifier sets the Identifier field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAttribute) SetIdentifier(identifier *ConnectionAttributeIdentifier) {
	u.Identifier = identifier
	u.require(usernameAttributeFieldIdentifier)
}

// SetProfileRequired sets the ProfileRequired field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAttribute) SetProfileRequired(profileRequired *bool) {
	u.ProfileRequired = profileRequired
	u.require(usernameAttributeFieldProfileRequired)
}

// SetSignup sets the Signup field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAttribute) SetSignup(signup *SignupSchema) {
	u.Signup = signup
	u.require(usernameAttributeFieldSignup)
}

// SetValidation sets the Validation field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameAttribute) SetValidation(validation *UsernameValidation) {
	u.Validation = validation
	u.require(usernameAttributeFieldValidation)
}

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

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

func (u *UsernameAttribute) 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)
}

var (
	usernameValidationFieldMinLength    = big.NewInt(1 << 0)
	usernameValidationFieldMaxLength    = big.NewInt(1 << 1)
	usernameValidationFieldAllowedTypes = big.NewInt(1 << 2)
)

type UsernameValidation struct {
	// Minimum allowed length
	MinLength *float64 `json:"min_length,omitempty" url:"min_length,omitempty"`
	// Maximum allowed length
	MaxLength    *float64              `json:"max_length,omitempty" url:"max_length,omitempty"`
	AllowedTypes *UsernameAllowedTypes `json:"allowed_types,omitempty" url:"allowed_types,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 *UsernameValidation) GetMinLength() float64 {
	if u == nil || u.MinLength == nil {
		return 0
	}
	return *u.MinLength
}

func (u *UsernameValidation) GetMaxLength() float64 {
	if u == nil || u.MaxLength == nil {
		return 0
	}
	return *u.MaxLength
}

func (u *UsernameValidation) GetAllowedTypes() UsernameAllowedTypes {
	if u == nil || u.AllowedTypes == nil {
		return UsernameAllowedTypes{}
	}
	return *u.AllowedTypes
}

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

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

// SetMinLength sets the MinLength field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameValidation) SetMinLength(minLength *float64) {
	u.MinLength = minLength
	u.require(usernameValidationFieldMinLength)
}

// SetMaxLength sets the MaxLength field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameValidation) SetMaxLength(maxLength *float64) {
	u.MaxLength = maxLength
	u.require(usernameValidationFieldMaxLength)
}

// SetAllowedTypes sets the AllowedTypes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UsernameValidation) SetAllowedTypes(allowedTypes *UsernameAllowedTypes) {
	u.AllowedTypes = allowedTypes
	u.require(usernameValidationFieldAllowedTypes)
}

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

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

func (u *UsernameValidation) 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)
}

type VerificationMethodEnum string

const (
	VerificationMethodEnumLink VerificationMethodEnum = "link"
	VerificationMethodEnumOtp  VerificationMethodEnum = "otp"
)

func NewVerificationMethodEnumFromString(s string) (VerificationMethodEnum, error) {
	switch s {
	case "link":
		return VerificationMethodEnumLink, nil
	case "otp":
		return VerificationMethodEnumOtp, nil
	}
	var t VerificationMethodEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (v VerificationMethodEnum) Ptr() *VerificationMethodEnum {
	return &v
}
