// 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"
)

// Connection to be added to the organization.
var (
	connectionForOrganizationFieldConnectionID            = big.NewInt(1 << 0)
	connectionForOrganizationFieldAssignMembershipOnLogin = big.NewInt(1 << 1)
	connectionForOrganizationFieldShowAsButton            = big.NewInt(1 << 2)
	connectionForOrganizationFieldIsSignupEnabled         = big.NewInt(1 << 3)
)

type ConnectionForOrganization struct {
	// ID of the connection.
	ConnectionID string `json:"connection_id" url:"connection_id"`
	// When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
	AssignMembershipOnLogin *bool `json:"assign_membership_on_login,omitempty" url:"assign_membership_on_login,omitempty"`
	// Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.
	ShowAsButton *bool `json:"show_as_button,omitempty" url:"show_as_button,omitempty"`
	// Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.
	IsSignupEnabled *bool `json:"is_signup_enabled,omitempty" url:"is_signup_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 *ConnectionForOrganization) GetConnectionID() string {
	if c == nil {
		return ""
	}
	return c.ConnectionID
}

func (c *ConnectionForOrganization) GetAssignMembershipOnLogin() bool {
	if c == nil || c.AssignMembershipOnLogin == nil {
		return false
	}
	return *c.AssignMembershipOnLogin
}

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

func (c *ConnectionForOrganization) GetIsSignupEnabled() bool {
	if c == nil || c.IsSignupEnabled == nil {
		return false
	}
	return *c.IsSignupEnabled
}

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

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

// SetConnectionID sets the ConnectionID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionForOrganization) SetConnectionID(connectionID string) {
	c.ConnectionID = connectionID
	c.require(connectionForOrganizationFieldConnectionID)
}

// SetAssignMembershipOnLogin sets the AssignMembershipOnLogin field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionForOrganization) SetAssignMembershipOnLogin(assignMembershipOnLogin *bool) {
	c.AssignMembershipOnLogin = assignMembershipOnLogin
	c.require(connectionForOrganizationFieldAssignMembershipOnLogin)
}

// 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 *ConnectionForOrganization) SetShowAsButton(showAsButton *bool) {
	c.ShowAsButton = showAsButton
	c.require(connectionForOrganizationFieldShowAsButton)
}

// SetIsSignupEnabled sets the IsSignupEnabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *ConnectionForOrganization) SetIsSignupEnabled(isSignupEnabled *bool) {
	c.IsSignupEnabled = isSignupEnabled
	c.require(connectionForOrganizationFieldIsSignupEnabled)
}

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

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

func (c *ConnectionForOrganization) 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 (
	createOrganizationResponseContentFieldID                 = big.NewInt(1 << 0)
	createOrganizationResponseContentFieldName               = big.NewInt(1 << 1)
	createOrganizationResponseContentFieldDisplayName        = big.NewInt(1 << 2)
	createOrganizationResponseContentFieldBranding           = big.NewInt(1 << 3)
	createOrganizationResponseContentFieldMetadata           = big.NewInt(1 << 4)
	createOrganizationResponseContentFieldTokenQuota         = big.NewInt(1 << 5)
	createOrganizationResponseContentFieldEnabledConnections = big.NewInt(1 << 6)
)

type CreateOrganizationResponseContent struct {
	// Organization identifier.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The name of this organization.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Friendly name of this organization.
	DisplayName        *string                          `json:"display_name,omitempty" url:"display_name,omitempty"`
	Branding           *OrganizationBranding            `json:"branding,omitempty" url:"branding,omitempty"`
	Metadata           *OrganizationMetadata            `json:"metadata,omitempty" url:"metadata,omitempty"`
	TokenQuota         *TokenQuota                      `json:"token_quota,omitempty" url:"token_quota,omitempty"`
	EnabledConnections []*OrganizationEnabledConnection `json:"enabled_connections,omitempty" url:"enabled_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{} `json:"-" url:"-"`

	rawJSON json.RawMessage
}

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

func (c *CreateOrganizationResponseContent) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}

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

func (c *CreateOrganizationResponseContent) GetBranding() OrganizationBranding {
	if c == nil || c.Branding == nil {
		return OrganizationBranding{}
	}
	return *c.Branding
}

func (c *CreateOrganizationResponseContent) GetMetadata() OrganizationMetadata {
	if c == nil || c.Metadata == nil {
		return nil
	}
	return *c.Metadata
}

func (c *CreateOrganizationResponseContent) GetTokenQuota() TokenQuota {
	if c == nil || c.TokenQuota == nil {
		return TokenQuota{}
	}
	return *c.TokenQuota
}

func (c *CreateOrganizationResponseContent) GetEnabledConnections() []*OrganizationEnabledConnection {
	if c == nil || c.EnabledConnections == nil {
		return nil
	}
	return c.EnabledConnections
}

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

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

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

// 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 *CreateOrganizationResponseContent) SetName(name *string) {
	c.Name = name
	c.require(createOrganizationResponseContentFieldName)
}

// 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 *CreateOrganizationResponseContent) SetDisplayName(displayName *string) {
	c.DisplayName = displayName
	c.require(createOrganizationResponseContentFieldDisplayName)
}

// SetBranding sets the Branding field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateOrganizationResponseContent) SetBranding(branding *OrganizationBranding) {
	c.Branding = branding
	c.require(createOrganizationResponseContentFieldBranding)
}

// 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 *CreateOrganizationResponseContent) SetMetadata(metadata *OrganizationMetadata) {
	c.Metadata = metadata
	c.require(createOrganizationResponseContentFieldMetadata)
}

// SetTokenQuota sets the TokenQuota field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateOrganizationResponseContent) SetTokenQuota(tokenQuota *TokenQuota) {
	c.TokenQuota = tokenQuota
	c.require(createOrganizationResponseContentFieldTokenQuota)
}

// SetEnabledConnections sets the EnabledConnections field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateOrganizationResponseContent) SetEnabledConnections(enabledConnections []*OrganizationEnabledConnection) {
	c.EnabledConnections = enabledConnections
	c.require(createOrganizationResponseContentFieldEnabledConnections)
}

func (c *CreateOrganizationResponseContent) UnmarshalJSON(data []byte) error {
	type embed CreateOrganizationResponseContent
	var unmarshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*c = CreateOrganizationResponseContent(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 *CreateOrganizationResponseContent) MarshalJSON() ([]byte, error) {
	type embed CreateOrganizationResponseContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return internal.MarshalJSONWithExtraProperties(explicitMarshaler, c.ExtraProperties)
}

func (c *CreateOrganizationResponseContent) 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 (
	getOrganizationByNameResponseContentFieldID          = big.NewInt(1 << 0)
	getOrganizationByNameResponseContentFieldName        = big.NewInt(1 << 1)
	getOrganizationByNameResponseContentFieldDisplayName = big.NewInt(1 << 2)
	getOrganizationByNameResponseContentFieldBranding    = big.NewInt(1 << 3)
	getOrganizationByNameResponseContentFieldMetadata    = big.NewInt(1 << 4)
	getOrganizationByNameResponseContentFieldTokenQuota  = big.NewInt(1 << 5)
)

type GetOrganizationByNameResponseContent struct {
	// Organization identifier.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The name of this organization.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Friendly name of this organization.
	DisplayName *string               `json:"display_name,omitempty" url:"display_name,omitempty"`
	Branding    *OrganizationBranding `json:"branding,omitempty" url:"branding,omitempty"`
	Metadata    *OrganizationMetadata `json:"metadata,omitempty" url:"metadata,omitempty"`
	TokenQuota  *TokenQuota           `json:"token_quota,omitempty" url:"token_quota,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 (g *GetOrganizationByNameResponseContent) GetID() string {
	if g == nil || g.ID == nil {
		return ""
	}
	return *g.ID
}

func (g *GetOrganizationByNameResponseContent) GetName() string {
	if g == nil || g.Name == nil {
		return ""
	}
	return *g.Name
}

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

func (g *GetOrganizationByNameResponseContent) GetBranding() OrganizationBranding {
	if g == nil || g.Branding == nil {
		return OrganizationBranding{}
	}
	return *g.Branding
}

func (g *GetOrganizationByNameResponseContent) GetMetadata() OrganizationMetadata {
	if g == nil || g.Metadata == nil {
		return nil
	}
	return *g.Metadata
}

func (g *GetOrganizationByNameResponseContent) GetTokenQuota() TokenQuota {
	if g == nil || g.TokenQuota == nil {
		return TokenQuota{}
	}
	return *g.TokenQuota
}

func (g *GetOrganizationByNameResponseContent) GetExtraProperties() map[string]interface{} {
	return g.ExtraProperties
}

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

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

// 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 *GetOrganizationByNameResponseContent) SetName(name *string) {
	g.Name = name
	g.require(getOrganizationByNameResponseContentFieldName)
}

// 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 *GetOrganizationByNameResponseContent) SetDisplayName(displayName *string) {
	g.DisplayName = displayName
	g.require(getOrganizationByNameResponseContentFieldDisplayName)
}

// SetBranding sets the Branding field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetOrganizationByNameResponseContent) SetBranding(branding *OrganizationBranding) {
	g.Branding = branding
	g.require(getOrganizationByNameResponseContentFieldBranding)
}

// 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 *GetOrganizationByNameResponseContent) SetMetadata(metadata *OrganizationMetadata) {
	g.Metadata = metadata
	g.require(getOrganizationByNameResponseContentFieldMetadata)
}

// SetTokenQuota sets the TokenQuota field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetOrganizationByNameResponseContent) SetTokenQuota(tokenQuota *TokenQuota) {
	g.TokenQuota = tokenQuota
	g.require(getOrganizationByNameResponseContentFieldTokenQuota)
}

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

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

func (g *GetOrganizationByNameResponseContent) 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 (
	getOrganizationResponseContentFieldID          = big.NewInt(1 << 0)
	getOrganizationResponseContentFieldName        = big.NewInt(1 << 1)
	getOrganizationResponseContentFieldDisplayName = big.NewInt(1 << 2)
	getOrganizationResponseContentFieldBranding    = big.NewInt(1 << 3)
	getOrganizationResponseContentFieldMetadata    = big.NewInt(1 << 4)
	getOrganizationResponseContentFieldTokenQuota  = big.NewInt(1 << 5)
)

type GetOrganizationResponseContent struct {
	// Organization identifier.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The name of this organization.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Friendly name of this organization.
	DisplayName *string               `json:"display_name,omitempty" url:"display_name,omitempty"`
	Branding    *OrganizationBranding `json:"branding,omitempty" url:"branding,omitempty"`
	Metadata    *OrganizationMetadata `json:"metadata,omitempty" url:"metadata,omitempty"`
	TokenQuota  *TokenQuota           `json:"token_quota,omitempty" url:"token_quota,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 (g *GetOrganizationResponseContent) GetID() string {
	if g == nil || g.ID == nil {
		return ""
	}
	return *g.ID
}

func (g *GetOrganizationResponseContent) GetName() string {
	if g == nil || g.Name == nil {
		return ""
	}
	return *g.Name
}

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

func (g *GetOrganizationResponseContent) GetBranding() OrganizationBranding {
	if g == nil || g.Branding == nil {
		return OrganizationBranding{}
	}
	return *g.Branding
}

func (g *GetOrganizationResponseContent) GetMetadata() OrganizationMetadata {
	if g == nil || g.Metadata == nil {
		return nil
	}
	return *g.Metadata
}

func (g *GetOrganizationResponseContent) GetTokenQuota() TokenQuota {
	if g == nil || g.TokenQuota == nil {
		return TokenQuota{}
	}
	return *g.TokenQuota
}

func (g *GetOrganizationResponseContent) GetExtraProperties() map[string]interface{} {
	return g.ExtraProperties
}

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

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

// 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 *GetOrganizationResponseContent) SetName(name *string) {
	g.Name = name
	g.require(getOrganizationResponseContentFieldName)
}

// 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 *GetOrganizationResponseContent) SetDisplayName(displayName *string) {
	g.DisplayName = displayName
	g.require(getOrganizationResponseContentFieldDisplayName)
}

// SetBranding sets the Branding field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetOrganizationResponseContent) SetBranding(branding *OrganizationBranding) {
	g.Branding = branding
	g.require(getOrganizationResponseContentFieldBranding)
}

// 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 *GetOrganizationResponseContent) SetMetadata(metadata *OrganizationMetadata) {
	g.Metadata = metadata
	g.require(getOrganizationResponseContentFieldMetadata)
}

// SetTokenQuota sets the TokenQuota field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetOrganizationResponseContent) SetTokenQuota(tokenQuota *TokenQuota) {
	g.TokenQuota = tokenQuota
	g.require(getOrganizationResponseContentFieldTokenQuota)
}

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

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

func (g *GetOrganizationResponseContent) 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 (
	listOrganizationsPaginatedResponseContentFieldNext          = big.NewInt(1 << 0)
	listOrganizationsPaginatedResponseContentFieldOrganizations = big.NewInt(1 << 1)
)

type ListOrganizationsPaginatedResponseContent struct {
	Next          *string         `json:"next,omitempty" url:"next,omitempty"`
	Organizations []*Organization `json:"organizations,omitempty" url:"organizations,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 *ListOrganizationsPaginatedResponseContent) GetNext() string {
	if l == nil || l.Next == nil {
		return ""
	}
	return *l.Next
}

func (l *ListOrganizationsPaginatedResponseContent) GetOrganizations() []*Organization {
	if l == nil || l.Organizations == nil {
		return nil
	}
	return l.Organizations
}

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

func (l *ListOrganizationsPaginatedResponseContent) 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 *ListOrganizationsPaginatedResponseContent) SetNext(next *string) {
	l.Next = next
	l.require(listOrganizationsPaginatedResponseContentFieldNext)
}

// SetOrganizations sets the Organizations field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListOrganizationsPaginatedResponseContent) SetOrganizations(organizations []*Organization) {
	l.Organizations = organizations
	l.require(listOrganizationsPaginatedResponseContentFieldOrganizations)
}

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

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

func (l *ListOrganizationsPaginatedResponseContent) 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)
}

var (
	organizationEnabledConnectionFieldConnectionID            = big.NewInt(1 << 0)
	organizationEnabledConnectionFieldAssignMembershipOnLogin = big.NewInt(1 << 1)
	organizationEnabledConnectionFieldShowAsButton            = big.NewInt(1 << 2)
	organizationEnabledConnectionFieldIsSignupEnabled         = big.NewInt(1 << 3)
	organizationEnabledConnectionFieldConnection              = big.NewInt(1 << 4)
)

type OrganizationEnabledConnection struct {
	// ID of the connection.
	ConnectionID *string `json:"connection_id,omitempty" url:"connection_id,omitempty"`
	// When true, all users that log in with this connection will be automatically granted membership in the organization. When false, users must be granted membership in the organization before logging in with this connection.
	AssignMembershipOnLogin *bool `json:"assign_membership_on_login,omitempty" url:"assign_membership_on_login,omitempty"`
	// Determines whether a connection should be displayed on this organization’s login prompt. Only applicable for enterprise connections. Default: true.
	ShowAsButton *bool `json:"show_as_button,omitempty" url:"show_as_button,omitempty"`
	// Determines whether organization signup should be enabled for this organization connection. Only applicable for database connections. Default: false.
	IsSignupEnabled *bool                              `json:"is_signup_enabled,omitempty" url:"is_signup_enabled,omitempty"`
	Connection      *OrganizationConnectionInformation `json:"connection,omitempty" url:"connection,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 (o *OrganizationEnabledConnection) GetConnectionID() string {
	if o == nil || o.ConnectionID == nil {
		return ""
	}
	return *o.ConnectionID
}

func (o *OrganizationEnabledConnection) GetAssignMembershipOnLogin() bool {
	if o == nil || o.AssignMembershipOnLogin == nil {
		return false
	}
	return *o.AssignMembershipOnLogin
}

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

func (o *OrganizationEnabledConnection) GetIsSignupEnabled() bool {
	if o == nil || o.IsSignupEnabled == nil {
		return false
	}
	return *o.IsSignupEnabled
}

func (o *OrganizationEnabledConnection) GetConnection() OrganizationConnectionInformation {
	if o == nil || o.Connection == nil {
		return OrganizationConnectionInformation{}
	}
	return *o.Connection
}

func (o *OrganizationEnabledConnection) GetExtraProperties() map[string]interface{} {
	return o.ExtraProperties
}

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

// SetConnectionID sets the ConnectionID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OrganizationEnabledConnection) SetConnectionID(connectionID *string) {
	o.ConnectionID = connectionID
	o.require(organizationEnabledConnectionFieldConnectionID)
}

// SetAssignMembershipOnLogin sets the AssignMembershipOnLogin field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OrganizationEnabledConnection) SetAssignMembershipOnLogin(assignMembershipOnLogin *bool) {
	o.AssignMembershipOnLogin = assignMembershipOnLogin
	o.require(organizationEnabledConnectionFieldAssignMembershipOnLogin)
}

// 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 (o *OrganizationEnabledConnection) SetShowAsButton(showAsButton *bool) {
	o.ShowAsButton = showAsButton
	o.require(organizationEnabledConnectionFieldShowAsButton)
}

// SetIsSignupEnabled sets the IsSignupEnabled field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OrganizationEnabledConnection) SetIsSignupEnabled(isSignupEnabled *bool) {
	o.IsSignupEnabled = isSignupEnabled
	o.require(organizationEnabledConnectionFieldIsSignupEnabled)
}

// SetConnection sets the Connection field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (o *OrganizationEnabledConnection) SetConnection(connection *OrganizationConnectionInformation) {
	o.Connection = connection
	o.require(organizationEnabledConnectionFieldConnection)
}

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

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

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

var (
	updateOrganizationResponseContentFieldID          = big.NewInt(1 << 0)
	updateOrganizationResponseContentFieldName        = big.NewInt(1 << 1)
	updateOrganizationResponseContentFieldDisplayName = big.NewInt(1 << 2)
	updateOrganizationResponseContentFieldBranding    = big.NewInt(1 << 3)
	updateOrganizationResponseContentFieldMetadata    = big.NewInt(1 << 4)
	updateOrganizationResponseContentFieldTokenQuota  = big.NewInt(1 << 5)
)

type UpdateOrganizationResponseContent struct {
	// Organization identifier.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// The name of this organization.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Friendly name of this organization.
	DisplayName *string               `json:"display_name,omitempty" url:"display_name,omitempty"`
	Branding    *OrganizationBranding `json:"branding,omitempty" url:"branding,omitempty"`
	Metadata    *OrganizationMetadata `json:"metadata,omitempty" url:"metadata,omitempty"`
	TokenQuota  *TokenQuota           `json:"token_quota,omitempty" url:"token_quota,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 *UpdateOrganizationResponseContent) GetID() string {
	if u == nil || u.ID == nil {
		return ""
	}
	return *u.ID
}

func (u *UpdateOrganizationResponseContent) GetName() string {
	if u == nil || u.Name == nil {
		return ""
	}
	return *u.Name
}

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

func (u *UpdateOrganizationResponseContent) GetBranding() OrganizationBranding {
	if u == nil || u.Branding == nil {
		return OrganizationBranding{}
	}
	return *u.Branding
}

func (u *UpdateOrganizationResponseContent) GetMetadata() OrganizationMetadata {
	if u == nil || u.Metadata == nil {
		return nil
	}
	return *u.Metadata
}

func (u *UpdateOrganizationResponseContent) GetTokenQuota() TokenQuota {
	if u == nil || u.TokenQuota == nil {
		return TokenQuota{}
	}
	return *u.TokenQuota
}

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

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

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

// 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 *UpdateOrganizationResponseContent) SetName(name *string) {
	u.Name = name
	u.require(updateOrganizationResponseContentFieldName)
}

// 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 *UpdateOrganizationResponseContent) SetDisplayName(displayName *string) {
	u.DisplayName = displayName
	u.require(updateOrganizationResponseContentFieldDisplayName)
}

// SetBranding sets the Branding field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateOrganizationResponseContent) SetBranding(branding *OrganizationBranding) {
	u.Branding = branding
	u.require(updateOrganizationResponseContentFieldBranding)
}

// 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 *UpdateOrganizationResponseContent) SetMetadata(metadata *OrganizationMetadata) {
	u.Metadata = metadata
	u.require(updateOrganizationResponseContentFieldMetadata)
}

// SetTokenQuota sets the TokenQuota field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateOrganizationResponseContent) SetTokenQuota(tokenQuota *TokenQuota) {
	u.TokenQuota = tokenQuota
	u.require(updateOrganizationResponseContentFieldTokenQuota)
}

func (u *UpdateOrganizationResponseContent) UnmarshalJSON(data []byte) error {
	type embed UpdateOrganizationResponseContent
	var unmarshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*u = UpdateOrganizationResponseContent(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 *UpdateOrganizationResponseContent) MarshalJSON() ([]byte, error) {
	type embed UpdateOrganizationResponseContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*u),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
	return internal.MarshalJSONWithExtraProperties(explicitMarshaler, u.ExtraProperties)
}

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