// 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 (
	getLogResponseContentFieldDate            = big.NewInt(1 << 0)
	getLogResponseContentFieldType            = big.NewInt(1 << 1)
	getLogResponseContentFieldDescription     = big.NewInt(1 << 2)
	getLogResponseContentFieldConnection      = big.NewInt(1 << 3)
	getLogResponseContentFieldConnectionID    = big.NewInt(1 << 4)
	getLogResponseContentFieldClientID        = big.NewInt(1 << 5)
	getLogResponseContentFieldClientName      = big.NewInt(1 << 6)
	getLogResponseContentFieldIP              = big.NewInt(1 << 7)
	getLogResponseContentFieldHostname        = big.NewInt(1 << 8)
	getLogResponseContentFieldUserID          = big.NewInt(1 << 9)
	getLogResponseContentFieldUserName        = big.NewInt(1 << 10)
	getLogResponseContentFieldAudience        = big.NewInt(1 << 11)
	getLogResponseContentFieldScope           = big.NewInt(1 << 12)
	getLogResponseContentFieldStrategy        = big.NewInt(1 << 13)
	getLogResponseContentFieldStrategyType    = big.NewInt(1 << 14)
	getLogResponseContentFieldLogID           = big.NewInt(1 << 15)
	getLogResponseContentFieldIsMobile        = big.NewInt(1 << 16)
	getLogResponseContentFieldDetails         = big.NewInt(1 << 17)
	getLogResponseContentFieldUserAgent       = big.NewInt(1 << 18)
	getLogResponseContentFieldSecurityContext = big.NewInt(1 << 19)
	getLogResponseContentFieldLocationInfo    = big.NewInt(1 << 20)
)

type GetLogResponseContent struct {
	Date *LogDate `json:"date,omitempty" url:"date,omitempty"`
	// Type of event.
	Type *string `json:"type,omitempty" url:"type,omitempty"`
	// Description of this event.
	Description *string `json:"description,omitempty" url:"description,omitempty"`
	// Name of the connection the event relates to.
	Connection *string `json:"connection,omitempty" url:"connection,omitempty"`
	// ID of the connection the event relates to.
	ConnectionID *string `json:"connection_id,omitempty" url:"connection_id,omitempty"`
	// ID of the client (application).
	ClientID *string `json:"client_id,omitempty" url:"client_id,omitempty"`
	// Name of the client (application).
	ClientName *string `json:"client_name,omitempty" url:"client_name,omitempty"`
	// IP address of the log event source.
	IP *string `json:"ip,omitempty" url:"ip,omitempty"`
	// Hostname the event applies to.
	Hostname *string `json:"hostname,omitempty" url:"hostname,omitempty"`
	// ID of the user involved in the event.
	UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
	// Name of the user involved in the event.
	UserName *string `json:"user_name,omitempty" url:"user_name,omitempty"`
	// API audience the event applies to.
	Audience *string `json:"audience,omitempty" url:"audience,omitempty"`
	// Scope permissions applied to the event.
	Scope *string `json:"scope,omitempty" url:"scope,omitempty"`
	// Name of the strategy involved in the event.
	Strategy *string `json:"strategy,omitempty" url:"strategy,omitempty"`
	// Type of strategy involved in the event.
	StrategyType *string `json:"strategy_type,omitempty" url:"strategy_type,omitempty"`
	// Unique ID of the event.
	LogID *string `json:"log_id,omitempty" url:"log_id,omitempty"`
	// Whether the client was a mobile device (true) or desktop/laptop/server (false).
	IsMobile *bool       `json:"isMobile,omitempty" url:"isMobile,omitempty"`
	Details  *LogDetails `json:"details,omitempty" url:"details,omitempty"`
	// User agent string from the client device that caused the event.
	UserAgent       *string             `json:"user_agent,omitempty" url:"user_agent,omitempty"`
	SecurityContext *LogSecurityContext `json:"security_context,omitempty" url:"security_context,omitempty"`
	LocationInfo    *LogLocationInfo    `json:"location_info,omitempty" url:"location_info,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 *GetLogResponseContent) GetDate() LogDate {
	if g == nil || g.Date == nil {
		return LogDate{}
	}
	return *g.Date
}

func (g *GetLogResponseContent) GetType() string {
	if g == nil || g.Type == nil {
		return ""
	}
	return *g.Type
}

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

func (g *GetLogResponseContent) GetConnection() string {
	if g == nil || g.Connection == nil {
		return ""
	}
	return *g.Connection
}

func (g *GetLogResponseContent) GetConnectionID() string {
	if g == nil || g.ConnectionID == nil {
		return ""
	}
	return *g.ConnectionID
}

func (g *GetLogResponseContent) GetClientID() string {
	if g == nil || g.ClientID == nil {
		return ""
	}
	return *g.ClientID
}

func (g *GetLogResponseContent) GetClientName() string {
	if g == nil || g.ClientName == nil {
		return ""
	}
	return *g.ClientName
}

func (g *GetLogResponseContent) GetIP() string {
	if g == nil || g.IP == nil {
		return ""
	}
	return *g.IP
}

func (g *GetLogResponseContent) GetHostname() string {
	if g == nil || g.Hostname == nil {
		return ""
	}
	return *g.Hostname
}

func (g *GetLogResponseContent) GetUserID() string {
	if g == nil || g.UserID == nil {
		return ""
	}
	return *g.UserID
}

func (g *GetLogResponseContent) GetUserName() string {
	if g == nil || g.UserName == nil {
		return ""
	}
	return *g.UserName
}

func (g *GetLogResponseContent) GetAudience() string {
	if g == nil || g.Audience == nil {
		return ""
	}
	return *g.Audience
}

func (g *GetLogResponseContent) GetScope() string {
	if g == nil || g.Scope == nil {
		return ""
	}
	return *g.Scope
}

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

func (g *GetLogResponseContent) GetStrategyType() string {
	if g == nil || g.StrategyType == nil {
		return ""
	}
	return *g.StrategyType
}

func (g *GetLogResponseContent) GetLogID() string {
	if g == nil || g.LogID == nil {
		return ""
	}
	return *g.LogID
}

func (g *GetLogResponseContent) GetIsMobile() bool {
	if g == nil || g.IsMobile == nil {
		return false
	}
	return *g.IsMobile
}

func (g *GetLogResponseContent) GetDetails() LogDetails {
	if g == nil || g.Details == nil {
		return nil
	}
	return *g.Details
}

func (g *GetLogResponseContent) GetUserAgent() string {
	if g == nil || g.UserAgent == nil {
		return ""
	}
	return *g.UserAgent
}

func (g *GetLogResponseContent) GetSecurityContext() LogSecurityContext {
	if g == nil || g.SecurityContext == nil {
		return LogSecurityContext{}
	}
	return *g.SecurityContext
}

func (g *GetLogResponseContent) GetLocationInfo() LogLocationInfo {
	if g == nil || g.LocationInfo == nil {
		return LogLocationInfo{}
	}
	return *g.LocationInfo
}

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

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

// SetDate sets the Date field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetDate(date *LogDate) {
	g.Date = date
	g.require(getLogResponseContentFieldDate)
}

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

// 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 *GetLogResponseContent) SetDescription(description *string) {
	g.Description = description
	g.require(getLogResponseContentFieldDescription)
}

// 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 (g *GetLogResponseContent) SetConnection(connection *string) {
	g.Connection = connection
	g.require(getLogResponseContentFieldConnection)
}

// 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 (g *GetLogResponseContent) SetConnectionID(connectionID *string) {
	g.ConnectionID = connectionID
	g.require(getLogResponseContentFieldConnectionID)
}

// SetClientID sets the ClientID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetClientID(clientID *string) {
	g.ClientID = clientID
	g.require(getLogResponseContentFieldClientID)
}

// SetClientName sets the ClientName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetClientName(clientName *string) {
	g.ClientName = clientName
	g.require(getLogResponseContentFieldClientName)
}

// SetIP sets the IP field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetIP(ip *string) {
	g.IP = ip
	g.require(getLogResponseContentFieldIP)
}

// SetHostname sets the Hostname field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetHostname(hostname *string) {
	g.Hostname = hostname
	g.require(getLogResponseContentFieldHostname)
}

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

// 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 (g *GetLogResponseContent) SetUserName(userName *string) {
	g.UserName = userName
	g.require(getLogResponseContentFieldUserName)
}

// 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 (g *GetLogResponseContent) SetAudience(audience *string) {
	g.Audience = audience
	g.require(getLogResponseContentFieldAudience)
}

// 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 (g *GetLogResponseContent) SetScope(scope *string) {
	g.Scope = scope
	g.require(getLogResponseContentFieldScope)
}

// 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 *GetLogResponseContent) SetStrategy(strategy *string) {
	g.Strategy = strategy
	g.require(getLogResponseContentFieldStrategy)
}

// SetStrategyType sets the StrategyType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetStrategyType(strategyType *string) {
	g.StrategyType = strategyType
	g.require(getLogResponseContentFieldStrategyType)
}

// SetLogID sets the LogID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetLogID(logID *string) {
	g.LogID = logID
	g.require(getLogResponseContentFieldLogID)
}

// SetIsMobile sets the IsMobile field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetIsMobile(isMobile *bool) {
	g.IsMobile = isMobile
	g.require(getLogResponseContentFieldIsMobile)
}

// SetDetails sets the Details field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetDetails(details *LogDetails) {
	g.Details = details
	g.require(getLogResponseContentFieldDetails)
}

// SetUserAgent sets the UserAgent field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetUserAgent(userAgent *string) {
	g.UserAgent = userAgent
	g.require(getLogResponseContentFieldUserAgent)
}

// SetSecurityContext sets the SecurityContext field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetSecurityContext(securityContext *LogSecurityContext) {
	g.SecurityContext = securityContext
	g.require(getLogResponseContentFieldSecurityContext)
}

// SetLocationInfo sets the LocationInfo field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetLogResponseContent) SetLocationInfo(locationInfo *LogLocationInfo) {
	g.LocationInfo = locationInfo
	g.require(getLogResponseContentFieldLocationInfo)
}

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

func (g *GetLogResponseContent) 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 (
	listLogOffsetPaginatedResponseContentFieldStart  = big.NewInt(1 << 0)
	listLogOffsetPaginatedResponseContentFieldLimit  = big.NewInt(1 << 1)
	listLogOffsetPaginatedResponseContentFieldLength = big.NewInt(1 << 2)
	listLogOffsetPaginatedResponseContentFieldTotal  = big.NewInt(1 << 3)
	listLogOffsetPaginatedResponseContentFieldLogs   = big.NewInt(1 << 4)
)

type ListLogOffsetPaginatedResponseContent struct {
	Start  *float64 `json:"start,omitempty" url:"start,omitempty"`
	Limit  *float64 `json:"limit,omitempty" url:"limit,omitempty"`
	Length *float64 `json:"length,omitempty" url:"length,omitempty"`
	Total  *float64 `json:"total,omitempty" url:"total,omitempty"`
	Logs   []*Log   `json:"logs,omitempty" url:"logs,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 *ListLogOffsetPaginatedResponseContent) GetStart() float64 {
	if l == nil || l.Start == nil {
		return 0
	}
	return *l.Start
}

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

func (l *ListLogOffsetPaginatedResponseContent) GetLength() float64 {
	if l == nil || l.Length == nil {
		return 0
	}
	return *l.Length
}

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

func (l *ListLogOffsetPaginatedResponseContent) GetLogs() []*Log {
	if l == nil || l.Logs == nil {
		return nil
	}
	return l.Logs
}

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

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

// 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 *ListLogOffsetPaginatedResponseContent) SetStart(start *float64) {
	l.Start = start
	l.require(listLogOffsetPaginatedResponseContentFieldStart)
}

// 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 *ListLogOffsetPaginatedResponseContent) SetLimit(limit *float64) {
	l.Limit = limit
	l.require(listLogOffsetPaginatedResponseContentFieldLimit)
}

// SetLength sets the Length field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListLogOffsetPaginatedResponseContent) SetLength(length *float64) {
	l.Length = length
	l.require(listLogOffsetPaginatedResponseContentFieldLength)
}

// 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 *ListLogOffsetPaginatedResponseContent) SetTotal(total *float64) {
	l.Total = total
	l.require(listLogOffsetPaginatedResponseContentFieldTotal)
}

// SetLogs sets the Logs field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListLogOffsetPaginatedResponseContent) SetLogs(logs []*Log) {
	l.Logs = logs
	l.require(listLogOffsetPaginatedResponseContentFieldLogs)
}

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

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

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