// 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 (
	getNetworkACLsResponseContentFieldID          = big.NewInt(1 << 0)
	getNetworkACLsResponseContentFieldDescription = big.NewInt(1 << 1)
	getNetworkACLsResponseContentFieldActive      = big.NewInt(1 << 2)
	getNetworkACLsResponseContentFieldPriority    = big.NewInt(1 << 3)
	getNetworkACLsResponseContentFieldRule        = big.NewInt(1 << 4)
	getNetworkACLsResponseContentFieldCreatedAt   = big.NewInt(1 << 5)
	getNetworkACLsResponseContentFieldUpdatedAt   = big.NewInt(1 << 6)
)

type GetNetworkACLsResponseContent struct {
	ID          *string         `json:"id,omitempty" url:"id,omitempty"`
	Description *string         `json:"description,omitempty" url:"description,omitempty"`
	Active      *bool           `json:"active,omitempty" url:"active,omitempty"`
	Priority    *float64        `json:"priority,omitempty" url:"priority,omitempty"`
	Rule        *NetworkACLRule `json:"rule,omitempty" url:"rule,omitempty"`
	// The timestamp when the Network ACL Configuration was created
	CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	// The timestamp when the Network ACL Configuration was last updated
	UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,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 *GetNetworkACLsResponseContent) GetID() string {
	if g == nil || g.ID == nil {
		return ""
	}
	return *g.ID
}

func (g *GetNetworkACLsResponseContent) GetDescription() string {
	if g == nil || g.Description == nil {
		return ""
	}
	return *g.Description
}

func (g *GetNetworkACLsResponseContent) GetActive() bool {
	if g == nil || g.Active == nil {
		return false
	}
	return *g.Active
}

func (g *GetNetworkACLsResponseContent) GetPriority() float64 {
	if g == nil || g.Priority == nil {
		return 0
	}
	return *g.Priority
}

func (g *GetNetworkACLsResponseContent) GetRule() NetworkACLRule {
	if g == nil || g.Rule == nil {
		return NetworkACLRule{}
	}
	return *g.Rule
}

func (g *GetNetworkACLsResponseContent) GetCreatedAt() string {
	if g == nil || g.CreatedAt == nil {
		return ""
	}
	return *g.CreatedAt
}

func (g *GetNetworkACLsResponseContent) GetUpdatedAt() string {
	if g == nil || g.UpdatedAt == nil {
		return ""
	}
	return *g.UpdatedAt
}

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

func (g *GetNetworkACLsResponseContent) 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 *GetNetworkACLsResponseContent) SetID(id *string) {
	g.ID = id
	g.require(getNetworkACLsResponseContentFieldID)
}

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

// 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 (g *GetNetworkACLsResponseContent) SetActive(active *bool) {
	g.Active = active
	g.require(getNetworkACLsResponseContentFieldActive)
}

// SetPriority sets the Priority field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetNetworkACLsResponseContent) SetPriority(priority *float64) {
	g.Priority = priority
	g.require(getNetworkACLsResponseContentFieldPriority)
}

// SetRule sets the Rule field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetNetworkACLsResponseContent) SetRule(rule *NetworkACLRule) {
	g.Rule = rule
	g.require(getNetworkACLsResponseContentFieldRule)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetNetworkACLsResponseContent) SetCreatedAt(createdAt *string) {
	g.CreatedAt = createdAt
	g.require(getNetworkACLsResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetNetworkACLsResponseContent) SetUpdatedAt(updatedAt *string) {
	g.UpdatedAt = updatedAt
	g.require(getNetworkACLsResponseContentFieldUpdatedAt)
}

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

func (g *GetNetworkACLsResponseContent) 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 (
	listNetworkACLsOffsetPaginatedResponseContentFieldNetworkACLs = big.NewInt(1 << 0)
	listNetworkACLsOffsetPaginatedResponseContentFieldStart       = big.NewInt(1 << 1)
	listNetworkACLsOffsetPaginatedResponseContentFieldLimit       = big.NewInt(1 << 2)
	listNetworkACLsOffsetPaginatedResponseContentFieldTotal       = big.NewInt(1 << 3)
)

type ListNetworkACLsOffsetPaginatedResponseContent struct {
	NetworkACLs []*NetworkACLsResponseContent `json:"network_acls,omitempty" url:"network_acls,omitempty"`
	Start       *float64                      `json:"start,omitempty" url:"start,omitempty"`
	Limit       *float64                      `json:"limit,omitempty" url:"limit,omitempty"`
	Total       *float64                      `json:"total,omitempty" url:"total,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 *ListNetworkACLsOffsetPaginatedResponseContent) GetNetworkACLs() []*NetworkACLsResponseContent {
	if l == nil || l.NetworkACLs == nil {
		return nil
	}
	return l.NetworkACLs
}

func (l *ListNetworkACLsOffsetPaginatedResponseContent) GetStart() float64 {
	if l == nil || l.Start == nil {
		return 0
	}
	return *l.Start
}

func (l *ListNetworkACLsOffsetPaginatedResponseContent) GetLimit() float64 {
	if l == nil || l.Limit == nil {
		return 0
	}
	return *l.Limit
}

func (l *ListNetworkACLsOffsetPaginatedResponseContent) GetTotal() float64 {
	if l == nil || l.Total == nil {
		return 0
	}
	return *l.Total
}

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

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

// SetNetworkACLs sets the NetworkACLs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListNetworkACLsOffsetPaginatedResponseContent) SetNetworkACLs(networkACLs []*NetworkACLsResponseContent) {
	l.NetworkACLs = networkACLs
	l.require(listNetworkACLsOffsetPaginatedResponseContentFieldNetworkACLs)
}

// SetStart sets the Start field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListNetworkACLsOffsetPaginatedResponseContent) SetStart(start *float64) {
	l.Start = start
	l.require(listNetworkACLsOffsetPaginatedResponseContentFieldStart)
}

// SetLimit sets the Limit field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListNetworkACLsOffsetPaginatedResponseContent) SetLimit(limit *float64) {
	l.Limit = limit
	l.require(listNetworkACLsOffsetPaginatedResponseContentFieldLimit)
}

// SetTotal sets the Total field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListNetworkACLsOffsetPaginatedResponseContent) SetTotal(total *float64) {
	l.Total = total
	l.require(listNetworkACLsOffsetPaginatedResponseContentFieldTotal)
}

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

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

func (l *ListNetworkACLsOffsetPaginatedResponseContent) 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 (
	networkACLActionFieldBlock       = big.NewInt(1 << 0)
	networkACLActionFieldAllow       = big.NewInt(1 << 1)
	networkACLActionFieldLog         = big.NewInt(1 << 2)
	networkACLActionFieldRedirect    = big.NewInt(1 << 3)
	networkACLActionFieldRedirectURI = big.NewInt(1 << 4)
)

type NetworkACLAction struct {
	Block    *NetworkACLActionBlockEnum    `json:"block,omitempty" url:"block,omitempty"`
	Allow    *NetworkACLActionAllowEnum    `json:"allow,omitempty" url:"allow,omitempty"`
	Log      *NetworkACLActionLogEnum      `json:"log,omitempty" url:"log,omitempty"`
	Redirect *NetworkACLActionRedirectEnum `json:"redirect,omitempty" url:"redirect,omitempty"`
	// The URI to which the match or not_match requests will be routed
	RedirectURI *string `json:"redirect_uri,omitempty" url:"redirect_uri,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 (n *NetworkACLAction) GetBlock() NetworkACLActionBlockEnum {
	if n == nil || n.Block == nil {
		return false
	}
	return *n.Block
}

func (n *NetworkACLAction) GetAllow() NetworkACLActionAllowEnum {
	if n == nil || n.Allow == nil {
		return false
	}
	return *n.Allow
}

func (n *NetworkACLAction) GetLog() NetworkACLActionLogEnum {
	if n == nil || n.Log == nil {
		return false
	}
	return *n.Log
}

func (n *NetworkACLAction) GetRedirect() NetworkACLActionRedirectEnum {
	if n == nil || n.Redirect == nil {
		return false
	}
	return *n.Redirect
}

func (n *NetworkACLAction) GetRedirectURI() string {
	if n == nil || n.RedirectURI == nil {
		return ""
	}
	return *n.RedirectURI
}

func (n *NetworkACLAction) GetExtraProperties() map[string]interface{} {
	return n.extraProperties
}

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

// SetBlock sets the Block field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLAction) SetBlock(block *NetworkACLActionBlockEnum) {
	n.Block = block
	n.require(networkACLActionFieldBlock)
}

// SetAllow sets the Allow field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLAction) SetAllow(allow *NetworkACLActionAllowEnum) {
	n.Allow = allow
	n.require(networkACLActionFieldAllow)
}

// SetLog sets the Log field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLAction) SetLog(log *NetworkACLActionLogEnum) {
	n.Log = log
	n.require(networkACLActionFieldLog)
}

// SetRedirect sets the Redirect field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLAction) SetRedirect(redirect *NetworkACLActionRedirectEnum) {
	n.Redirect = redirect
	n.require(networkACLActionFieldRedirect)
}

// SetRedirectURI sets the RedirectURI field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLAction) SetRedirectURI(redirectURI *string) {
	n.RedirectURI = redirectURI
	n.require(networkACLActionFieldRedirectURI)
}

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

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

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

// Indicates the rule will allow requests that either match or not_match specific criteria
type NetworkACLActionAllowEnum = bool

// Indicates the rule will block requests that either match or not_match specific criteria
type NetworkACLActionBlockEnum = bool

// Indicates the rule will log requests that either match or not_match specific criteria
type NetworkACLActionLogEnum = bool

// Indicates the rule will redirect requests that either match or not_match specific criteria
type NetworkACLActionRedirectEnum = bool

var (
	networkACLMatchFieldAsns                = big.NewInt(1 << 0)
	networkACLMatchFieldGeoCountryCodes     = big.NewInt(1 << 1)
	networkACLMatchFieldGeoSubdivisionCodes = big.NewInt(1 << 2)
	networkACLMatchFieldIpv4Cidrs           = big.NewInt(1 << 3)
	networkACLMatchFieldIpv6Cidrs           = big.NewInt(1 << 4)
	networkACLMatchFieldJa3Fingerprints     = big.NewInt(1 << 5)
	networkACLMatchFieldJa4Fingerprints     = big.NewInt(1 << 6)
	networkACLMatchFieldUserAgents          = big.NewInt(1 << 7)
)

type NetworkACLMatch struct {
	Asns                []int                     `json:"asns,omitempty" url:"asns,omitempty"`
	GeoCountryCodes     []string                  `json:"geo_country_codes,omitempty" url:"geo_country_codes,omitempty"`
	GeoSubdivisionCodes []string                  `json:"geo_subdivision_codes,omitempty" url:"geo_subdivision_codes,omitempty"`
	Ipv4Cidrs           []NetworkACLMatchIpv4Cidr `json:"ipv4_cidrs,omitempty" url:"ipv4_cidrs,omitempty"`
	Ipv6Cidrs           []NetworkACLMatchIpv6Cidr `json:"ipv6_cidrs,omitempty" url:"ipv6_cidrs,omitempty"`
	Ja3Fingerprints     []string                  `json:"ja3_fingerprints,omitempty" url:"ja3_fingerprints,omitempty"`
	Ja4Fingerprints     []string                  `json:"ja4_fingerprints,omitempty" url:"ja4_fingerprints,omitempty"`
	UserAgents          []string                  `json:"user_agents,omitempty" url:"user_agents,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 (n *NetworkACLMatch) GetAsns() []int {
	if n == nil || n.Asns == nil {
		return nil
	}
	return n.Asns
}

func (n *NetworkACLMatch) GetGeoCountryCodes() []string {
	if n == nil || n.GeoCountryCodes == nil {
		return nil
	}
	return n.GeoCountryCodes
}

func (n *NetworkACLMatch) GetGeoSubdivisionCodes() []string {
	if n == nil || n.GeoSubdivisionCodes == nil {
		return nil
	}
	return n.GeoSubdivisionCodes
}

func (n *NetworkACLMatch) GetIpv4Cidrs() []NetworkACLMatchIpv4Cidr {
	if n == nil || n.Ipv4Cidrs == nil {
		return nil
	}
	return n.Ipv4Cidrs
}

func (n *NetworkACLMatch) GetIpv6Cidrs() []NetworkACLMatchIpv6Cidr {
	if n == nil || n.Ipv6Cidrs == nil {
		return nil
	}
	return n.Ipv6Cidrs
}

func (n *NetworkACLMatch) GetJa3Fingerprints() []string {
	if n == nil || n.Ja3Fingerprints == nil {
		return nil
	}
	return n.Ja3Fingerprints
}

func (n *NetworkACLMatch) GetJa4Fingerprints() []string {
	if n == nil || n.Ja4Fingerprints == nil {
		return nil
	}
	return n.Ja4Fingerprints
}

func (n *NetworkACLMatch) GetUserAgents() []string {
	if n == nil || n.UserAgents == nil {
		return nil
	}
	return n.UserAgents
}

func (n *NetworkACLMatch) GetExtraProperties() map[string]interface{} {
	return n.extraProperties
}

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

// SetAsns sets the Asns field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetAsns(asns []int) {
	n.Asns = asns
	n.require(networkACLMatchFieldAsns)
}

// SetGeoCountryCodes sets the GeoCountryCodes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetGeoCountryCodes(geoCountryCodes []string) {
	n.GeoCountryCodes = geoCountryCodes
	n.require(networkACLMatchFieldGeoCountryCodes)
}

// SetGeoSubdivisionCodes sets the GeoSubdivisionCodes field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetGeoSubdivisionCodes(geoSubdivisionCodes []string) {
	n.GeoSubdivisionCodes = geoSubdivisionCodes
	n.require(networkACLMatchFieldGeoSubdivisionCodes)
}

// SetIpv4Cidrs sets the Ipv4Cidrs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetIpv4Cidrs(ipv4Cidrs []NetworkACLMatchIpv4Cidr) {
	n.Ipv4Cidrs = ipv4Cidrs
	n.require(networkACLMatchFieldIpv4Cidrs)
}

// SetIpv6Cidrs sets the Ipv6Cidrs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetIpv6Cidrs(ipv6Cidrs []NetworkACLMatchIpv6Cidr) {
	n.Ipv6Cidrs = ipv6Cidrs
	n.require(networkACLMatchFieldIpv6Cidrs)
}

// SetJa3Fingerprints sets the Ja3Fingerprints field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetJa3Fingerprints(ja3Fingerprints []string) {
	n.Ja3Fingerprints = ja3Fingerprints
	n.require(networkACLMatchFieldJa3Fingerprints)
}

// SetJa4Fingerprints sets the Ja4Fingerprints field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetJa4Fingerprints(ja4Fingerprints []string) {
	n.Ja4Fingerprints = ja4Fingerprints
	n.require(networkACLMatchFieldJa4Fingerprints)
}

// SetUserAgents sets the UserAgents field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLMatch) SetUserAgents(userAgents []string) {
	n.UserAgents = userAgents
	n.require(networkACLMatchFieldUserAgents)
}

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

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

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

type NetworkACLMatchIpv4Cidr = string

type NetworkACLMatchIpv6Cidr = string

var (
	networkACLRuleFieldAction   = big.NewInt(1 << 0)
	networkACLRuleFieldMatch    = big.NewInt(1 << 1)
	networkACLRuleFieldNotMatch = big.NewInt(1 << 2)
	networkACLRuleFieldScope    = big.NewInt(1 << 3)
)

type NetworkACLRule struct {
	Action   *NetworkACLAction       `json:"action" url:"action"`
	Match    *NetworkACLMatch        `json:"match,omitempty" url:"match,omitempty"`
	NotMatch *NetworkACLMatch        `json:"not_match,omitempty" url:"not_match,omitempty"`
	Scope    NetworkACLRuleScopeEnum `json:"scope" url:"scope"`

	// 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 (n *NetworkACLRule) GetAction() *NetworkACLAction {
	if n == nil {
		return nil
	}
	return n.Action
}

func (n *NetworkACLRule) GetMatch() NetworkACLMatch {
	if n == nil || n.Match == nil {
		return NetworkACLMatch{}
	}
	return *n.Match
}

func (n *NetworkACLRule) GetNotMatch() NetworkACLMatch {
	if n == nil || n.NotMatch == nil {
		return NetworkACLMatch{}
	}
	return *n.NotMatch
}

func (n *NetworkACLRule) GetScope() NetworkACLRuleScopeEnum {
	if n == nil {
		return ""
	}
	return n.Scope
}

func (n *NetworkACLRule) GetExtraProperties() map[string]interface{} {
	return n.extraProperties
}

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

// SetAction sets the Action field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLRule) SetAction(action *NetworkACLAction) {
	n.Action = action
	n.require(networkACLRuleFieldAction)
}

// SetMatch sets the Match field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLRule) SetMatch(match *NetworkACLMatch) {
	n.Match = match
	n.require(networkACLRuleFieldMatch)
}

// SetNotMatch sets the NotMatch field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLRule) SetNotMatch(notMatch *NetworkACLMatch) {
	n.NotMatch = notMatch
	n.require(networkACLRuleFieldNotMatch)
}

// SetScope sets the Scope field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLRule) SetScope(scope NetworkACLRuleScopeEnum) {
	n.Scope = scope
	n.require(networkACLRuleFieldScope)
}

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

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

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

// Identifies the origin of the request as the Management API (management), Authentication API (authentication), or either (tenant)
type NetworkACLRuleScopeEnum string

const (
	NetworkACLRuleScopeEnumManagement     NetworkACLRuleScopeEnum = "management"
	NetworkACLRuleScopeEnumAuthentication NetworkACLRuleScopeEnum = "authentication"
	NetworkACLRuleScopeEnumTenant         NetworkACLRuleScopeEnum = "tenant"
)

func NewNetworkACLRuleScopeEnumFromString(s string) (NetworkACLRuleScopeEnum, error) {
	switch s {
	case "management":
		return NetworkACLRuleScopeEnumManagement, nil
	case "authentication":
		return NetworkACLRuleScopeEnumAuthentication, nil
	case "tenant":
		return NetworkACLRuleScopeEnumTenant, nil
	}
	var t NetworkACLRuleScopeEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (n NetworkACLRuleScopeEnum) Ptr() *NetworkACLRuleScopeEnum {
	return &n
}

var (
	networkACLsResponseContentFieldID          = big.NewInt(1 << 0)
	networkACLsResponseContentFieldDescription = big.NewInt(1 << 1)
	networkACLsResponseContentFieldActive      = big.NewInt(1 << 2)
	networkACLsResponseContentFieldPriority    = big.NewInt(1 << 3)
	networkACLsResponseContentFieldRule        = big.NewInt(1 << 4)
	networkACLsResponseContentFieldCreatedAt   = big.NewInt(1 << 5)
	networkACLsResponseContentFieldUpdatedAt   = big.NewInt(1 << 6)
)

type NetworkACLsResponseContent struct {
	ID          *string         `json:"id,omitempty" url:"id,omitempty"`
	Description *string         `json:"description,omitempty" url:"description,omitempty"`
	Active      *bool           `json:"active,omitempty" url:"active,omitempty"`
	Priority    *float64        `json:"priority,omitempty" url:"priority,omitempty"`
	Rule        *NetworkACLRule `json:"rule,omitempty" url:"rule,omitempty"`
	// The timestamp when the Network ACL Configuration was created
	CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	// The timestamp when the Network ACL Configuration was last updated
	UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,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 (n *NetworkACLsResponseContent) GetID() string {
	if n == nil || n.ID == nil {
		return ""
	}
	return *n.ID
}

func (n *NetworkACLsResponseContent) GetDescription() string {
	if n == nil || n.Description == nil {
		return ""
	}
	return *n.Description
}

func (n *NetworkACLsResponseContent) GetActive() bool {
	if n == nil || n.Active == nil {
		return false
	}
	return *n.Active
}

func (n *NetworkACLsResponseContent) GetPriority() float64 {
	if n == nil || n.Priority == nil {
		return 0
	}
	return *n.Priority
}

func (n *NetworkACLsResponseContent) GetRule() NetworkACLRule {
	if n == nil || n.Rule == nil {
		return NetworkACLRule{}
	}
	return *n.Rule
}

func (n *NetworkACLsResponseContent) GetCreatedAt() string {
	if n == nil || n.CreatedAt == nil {
		return ""
	}
	return *n.CreatedAt
}

func (n *NetworkACLsResponseContent) GetUpdatedAt() string {
	if n == nil || n.UpdatedAt == nil {
		return ""
	}
	return *n.UpdatedAt
}

func (n *NetworkACLsResponseContent) GetExtraProperties() map[string]interface{} {
	return n.ExtraProperties
}

func (n *NetworkACLsResponseContent) require(field *big.Int) {
	if n.explicitFields == nil {
		n.explicitFields = big.NewInt(0)
	}
	n.explicitFields.Or(n.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 (n *NetworkACLsResponseContent) SetID(id *string) {
	n.ID = id
	n.require(networkACLsResponseContentFieldID)
}

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

// 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 (n *NetworkACLsResponseContent) SetActive(active *bool) {
	n.Active = active
	n.require(networkACLsResponseContentFieldActive)
}

// SetPriority sets the Priority field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLsResponseContent) SetPriority(priority *float64) {
	n.Priority = priority
	n.require(networkACLsResponseContentFieldPriority)
}

// SetRule sets the Rule field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLsResponseContent) SetRule(rule *NetworkACLRule) {
	n.Rule = rule
	n.require(networkACLsResponseContentFieldRule)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLsResponseContent) SetCreatedAt(createdAt *string) {
	n.CreatedAt = createdAt
	n.require(networkACLsResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (n *NetworkACLsResponseContent) SetUpdatedAt(updatedAt *string) {
	n.UpdatedAt = updatedAt
	n.require(networkACLsResponseContentFieldUpdatedAt)
}

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

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

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

var (
	setNetworkACLsResponseContentFieldID          = big.NewInt(1 << 0)
	setNetworkACLsResponseContentFieldDescription = big.NewInt(1 << 1)
	setNetworkACLsResponseContentFieldActive      = big.NewInt(1 << 2)
	setNetworkACLsResponseContentFieldPriority    = big.NewInt(1 << 3)
	setNetworkACLsResponseContentFieldRule        = big.NewInt(1 << 4)
	setNetworkACLsResponseContentFieldCreatedAt   = big.NewInt(1 << 5)
	setNetworkACLsResponseContentFieldUpdatedAt   = big.NewInt(1 << 6)
)

type SetNetworkACLsResponseContent struct {
	ID          *string         `json:"id,omitempty" url:"id,omitempty"`
	Description *string         `json:"description,omitempty" url:"description,omitempty"`
	Active      *bool           `json:"active,omitempty" url:"active,omitempty"`
	Priority    *float64        `json:"priority,omitempty" url:"priority,omitempty"`
	Rule        *NetworkACLRule `json:"rule,omitempty" url:"rule,omitempty"`
	// The timestamp when the Network ACL Configuration was created
	CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	// The timestamp when the Network ACL Configuration was last updated
	UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,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 (s *SetNetworkACLsResponseContent) GetID() string {
	if s == nil || s.ID == nil {
		return ""
	}
	return *s.ID
}

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

func (s *SetNetworkACLsResponseContent) GetActive() bool {
	if s == nil || s.Active == nil {
		return false
	}
	return *s.Active
}

func (s *SetNetworkACLsResponseContent) GetPriority() float64 {
	if s == nil || s.Priority == nil {
		return 0
	}
	return *s.Priority
}

func (s *SetNetworkACLsResponseContent) GetRule() NetworkACLRule {
	if s == nil || s.Rule == nil {
		return NetworkACLRule{}
	}
	return *s.Rule
}

func (s *SetNetworkACLsResponseContent) GetCreatedAt() string {
	if s == nil || s.CreatedAt == nil {
		return ""
	}
	return *s.CreatedAt
}

func (s *SetNetworkACLsResponseContent) GetUpdatedAt() string {
	if s == nil || s.UpdatedAt == nil {
		return ""
	}
	return *s.UpdatedAt
}

func (s *SetNetworkACLsResponseContent) GetExtraProperties() map[string]interface{} {
	return s.ExtraProperties
}

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

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

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

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

// SetPriority sets the Priority field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SetNetworkACLsResponseContent) SetPriority(priority *float64) {
	s.Priority = priority
	s.require(setNetworkACLsResponseContentFieldPriority)
}

// SetRule sets the Rule field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *SetNetworkACLsResponseContent) SetRule(rule *NetworkACLRule) {
	s.Rule = rule
	s.require(setNetworkACLsResponseContentFieldRule)
}

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

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

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

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

func (s *SetNetworkACLsResponseContent) 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 (
	updateNetworkACLResponseContentFieldID          = big.NewInt(1 << 0)
	updateNetworkACLResponseContentFieldDescription = big.NewInt(1 << 1)
	updateNetworkACLResponseContentFieldActive      = big.NewInt(1 << 2)
	updateNetworkACLResponseContentFieldPriority    = big.NewInt(1 << 3)
	updateNetworkACLResponseContentFieldRule        = big.NewInt(1 << 4)
	updateNetworkACLResponseContentFieldCreatedAt   = big.NewInt(1 << 5)
	updateNetworkACLResponseContentFieldUpdatedAt   = big.NewInt(1 << 6)
)

type UpdateNetworkACLResponseContent struct {
	ID          *string         `json:"id,omitempty" url:"id,omitempty"`
	Description *string         `json:"description,omitempty" url:"description,omitempty"`
	Active      *bool           `json:"active,omitempty" url:"active,omitempty"`
	Priority    *float64        `json:"priority,omitempty" url:"priority,omitempty"`
	Rule        *NetworkACLRule `json:"rule,omitempty" url:"rule,omitempty"`
	// The timestamp when the Network ACL Configuration was created
	CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	// The timestamp when the Network ACL Configuration was last updated
	UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,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 *UpdateNetworkACLResponseContent) GetID() string {
	if u == nil || u.ID == nil {
		return ""
	}
	return *u.ID
}

func (u *UpdateNetworkACLResponseContent) GetDescription() string {
	if u == nil || u.Description == nil {
		return ""
	}
	return *u.Description
}

func (u *UpdateNetworkACLResponseContent) GetActive() bool {
	if u == nil || u.Active == nil {
		return false
	}
	return *u.Active
}

func (u *UpdateNetworkACLResponseContent) GetPriority() float64 {
	if u == nil || u.Priority == nil {
		return 0
	}
	return *u.Priority
}

func (u *UpdateNetworkACLResponseContent) GetRule() NetworkACLRule {
	if u == nil || u.Rule == nil {
		return NetworkACLRule{}
	}
	return *u.Rule
}

func (u *UpdateNetworkACLResponseContent) GetCreatedAt() string {
	if u == nil || u.CreatedAt == nil {
		return ""
	}
	return *u.CreatedAt
}

func (u *UpdateNetworkACLResponseContent) GetUpdatedAt() string {
	if u == nil || u.UpdatedAt == nil {
		return ""
	}
	return *u.UpdatedAt
}

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

func (u *UpdateNetworkACLResponseContent) 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 *UpdateNetworkACLResponseContent) SetID(id *string) {
	u.ID = id
	u.require(updateNetworkACLResponseContentFieldID)
}

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

// 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 (u *UpdateNetworkACLResponseContent) SetActive(active *bool) {
	u.Active = active
	u.require(updateNetworkACLResponseContentFieldActive)
}

// SetPriority sets the Priority field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateNetworkACLResponseContent) SetPriority(priority *float64) {
	u.Priority = priority
	u.require(updateNetworkACLResponseContentFieldPriority)
}

// SetRule sets the Rule field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateNetworkACLResponseContent) SetRule(rule *NetworkACLRule) {
	u.Rule = rule
	u.require(updateNetworkACLResponseContentFieldRule)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateNetworkACLResponseContent) SetCreatedAt(createdAt *string) {
	u.CreatedAt = createdAt
	u.require(updateNetworkACLResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateNetworkACLResponseContent) SetUpdatedAt(updatedAt *string) {
	u.UpdatedAt = updatedAt
	u.require(updateNetworkACLResponseContentFieldUpdatedAt)
}

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

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