// 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 (
	createCustomDomainResponseContentFieldCustomDomainID       = big.NewInt(1 << 0)
	createCustomDomainResponseContentFieldDomain               = big.NewInt(1 << 1)
	createCustomDomainResponseContentFieldPrimary              = big.NewInt(1 << 2)
	createCustomDomainResponseContentFieldStatus               = big.NewInt(1 << 3)
	createCustomDomainResponseContentFieldType                 = big.NewInt(1 << 4)
	createCustomDomainResponseContentFieldVerification         = big.NewInt(1 << 5)
	createCustomDomainResponseContentFieldCustomClientIPHeader = big.NewInt(1 << 6)
	createCustomDomainResponseContentFieldTLSPolicy            = big.NewInt(1 << 7)
)

type CreateCustomDomainResponseContent struct {
	// ID of the custom domain.
	CustomDomainID string `json:"custom_domain_id" url:"custom_domain_id"`
	// Domain name.
	Domain string `json:"domain" url:"domain"`
	// Whether this is a primary domain (true) or not (false).
	Primary      bool                         `json:"primary" url:"primary"`
	Status       CustomDomainStatusFilterEnum `json:"status" url:"status"`
	Type         CustomDomainTypeEnum         `json:"type" url:"type"`
	Verification *DomainVerification          `json:"verification" url:"verification"`
	// The HTTP header to fetch the client's IP address
	CustomClientIPHeader *string `json:"custom_client_ip_header,omitempty" url:"custom_client_ip_header,omitempty"`
	// The TLS version policy
	TLSPolicy *string `json:"tls_policy,omitempty" url:"tls_policy,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 *CreateCustomDomainResponseContent) GetCustomDomainID() string {
	if c == nil {
		return ""
	}
	return c.CustomDomainID
}

func (c *CreateCustomDomainResponseContent) GetDomain() string {
	if c == nil {
		return ""
	}
	return c.Domain
}

func (c *CreateCustomDomainResponseContent) GetPrimary() bool {
	if c == nil {
		return false
	}
	return c.Primary
}

func (c *CreateCustomDomainResponseContent) GetStatus() CustomDomainStatusFilterEnum {
	if c == nil {
		return ""
	}
	return c.Status
}

func (c *CreateCustomDomainResponseContent) GetType() CustomDomainTypeEnum {
	if c == nil {
		return ""
	}
	return c.Type
}

func (c *CreateCustomDomainResponseContent) GetVerification() *DomainVerification {
	if c == nil {
		return nil
	}
	return c.Verification
}

func (c *CreateCustomDomainResponseContent) GetCustomClientIPHeader() string {
	if c == nil || c.CustomClientIPHeader == nil {
		return ""
	}
	return *c.CustomClientIPHeader
}

func (c *CreateCustomDomainResponseContent) GetTLSPolicy() string {
	if c == nil || c.TLSPolicy == nil {
		return ""
	}
	return *c.TLSPolicy
}

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

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

// SetCustomDomainID sets the CustomDomainID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateCustomDomainResponseContent) SetCustomDomainID(customDomainID string) {
	c.CustomDomainID = customDomainID
	c.require(createCustomDomainResponseContentFieldCustomDomainID)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateCustomDomainResponseContent) SetDomain(domain string) {
	c.Domain = domain
	c.require(createCustomDomainResponseContentFieldDomain)
}

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

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

// 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 (c *CreateCustomDomainResponseContent) SetType(type_ CustomDomainTypeEnum) {
	c.Type = type_
	c.require(createCustomDomainResponseContentFieldType)
}

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

// SetCustomClientIPHeader sets the CustomClientIPHeader field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateCustomDomainResponseContent) SetCustomClientIPHeader(customClientIPHeader *string) {
	c.CustomClientIPHeader = customClientIPHeader
	c.require(createCustomDomainResponseContentFieldCustomClientIPHeader)
}

// SetTLSPolicy sets the TLSPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateCustomDomainResponseContent) SetTLSPolicy(tlsPolicy *string) {
	c.TLSPolicy = tlsPolicy
	c.require(createCustomDomainResponseContentFieldTLSPolicy)
}

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

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

func (c *CreateCustomDomainResponseContent) 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 (
	customDomainFieldCustomDomainID       = big.NewInt(1 << 0)
	customDomainFieldDomain               = big.NewInt(1 << 1)
	customDomainFieldPrimary              = big.NewInt(1 << 2)
	customDomainFieldStatus               = big.NewInt(1 << 3)
	customDomainFieldType                 = big.NewInt(1 << 4)
	customDomainFieldOriginDomainName     = big.NewInt(1 << 5)
	customDomainFieldVerification         = big.NewInt(1 << 6)
	customDomainFieldCustomClientIPHeader = big.NewInt(1 << 7)
	customDomainFieldTLSPolicy            = big.NewInt(1 << 8)
)

type CustomDomain struct {
	// ID of the custom domain.
	CustomDomainID string `json:"custom_domain_id" url:"custom_domain_id"`
	// Domain name.
	Domain string `json:"domain" url:"domain"`
	// Whether this is a primary domain (true) or not (false).
	Primary bool                         `json:"primary" url:"primary"`
	Status  CustomDomainStatusFilterEnum `json:"status" url:"status"`
	Type    CustomDomainTypeEnum         `json:"type" url:"type"`
	// Intermediate address.
	OriginDomainName *string             `json:"origin_domain_name,omitempty" url:"origin_domain_name,omitempty"`
	Verification     *DomainVerification `json:"verification,omitempty" url:"verification,omitempty"`
	// The HTTP header to fetch the client's IP address
	CustomClientIPHeader *string `json:"custom_client_ip_header,omitempty" url:"custom_client_ip_header,omitempty"`
	// The TLS version policy
	TLSPolicy *string `json:"tls_policy,omitempty" url:"tls_policy,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 *CustomDomain) GetCustomDomainID() string {
	if c == nil {
		return ""
	}
	return c.CustomDomainID
}

func (c *CustomDomain) GetDomain() string {
	if c == nil {
		return ""
	}
	return c.Domain
}

func (c *CustomDomain) GetPrimary() bool {
	if c == nil {
		return false
	}
	return c.Primary
}

func (c *CustomDomain) GetStatus() CustomDomainStatusFilterEnum {
	if c == nil {
		return ""
	}
	return c.Status
}

func (c *CustomDomain) GetType() CustomDomainTypeEnum {
	if c == nil {
		return ""
	}
	return c.Type
}

func (c *CustomDomain) GetOriginDomainName() string {
	if c == nil || c.OriginDomainName == nil {
		return ""
	}
	return *c.OriginDomainName
}

func (c *CustomDomain) GetVerification() DomainVerification {
	if c == nil || c.Verification == nil {
		return DomainVerification{}
	}
	return *c.Verification
}

func (c *CustomDomain) GetCustomClientIPHeader() string {
	if c == nil || c.CustomClientIPHeader == nil {
		return ""
	}
	return *c.CustomClientIPHeader
}

func (c *CustomDomain) GetTLSPolicy() string {
	if c == nil || c.TLSPolicy == nil {
		return ""
	}
	return *c.TLSPolicy
}

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

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

// SetCustomDomainID sets the CustomDomainID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CustomDomain) SetCustomDomainID(customDomainID string) {
	c.CustomDomainID = customDomainID
	c.require(customDomainFieldCustomDomainID)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CustomDomain) SetDomain(domain string) {
	c.Domain = domain
	c.require(customDomainFieldDomain)
}

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

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

// 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 (c *CustomDomain) SetType(type_ CustomDomainTypeEnum) {
	c.Type = type_
	c.require(customDomainFieldType)
}

// SetOriginDomainName sets the OriginDomainName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CustomDomain) SetOriginDomainName(originDomainName *string) {
	c.OriginDomainName = originDomainName
	c.require(customDomainFieldOriginDomainName)
}

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

// SetCustomClientIPHeader sets the CustomClientIPHeader field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CustomDomain) SetCustomClientIPHeader(customClientIPHeader *string) {
	c.CustomClientIPHeader = customClientIPHeader
	c.require(customDomainFieldCustomClientIPHeader)
}

// SetTLSPolicy sets the TLSPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CustomDomain) SetTLSPolicy(tlsPolicy *string) {
	c.TLSPolicy = tlsPolicy
	c.require(customDomainFieldTLSPolicy)
}

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

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

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

type CustomDomainCustomClientIPHeader = *CustomDomainCustomClientIPHeaderEnum

// The HTTP header to fetch the client's IP address
type CustomDomainCustomClientIPHeaderEnum string

const (
	CustomDomainCustomClientIPHeaderEnumTrueClientIP   CustomDomainCustomClientIPHeaderEnum = "true-client-ip"
	CustomDomainCustomClientIPHeaderEnumCfConnectingIP CustomDomainCustomClientIPHeaderEnum = "cf-connecting-ip"
	CustomDomainCustomClientIPHeaderEnumXForwardedFor  CustomDomainCustomClientIPHeaderEnum = "x-forwarded-for"
	CustomDomainCustomClientIPHeaderEnumXAzureClientip CustomDomainCustomClientIPHeaderEnum = "x-azure-clientip"
	CustomDomainCustomClientIPHeaderEnumEmpty          CustomDomainCustomClientIPHeaderEnum = ""
)

func NewCustomDomainCustomClientIPHeaderEnumFromString(s string) (CustomDomainCustomClientIPHeaderEnum, error) {
	switch s {
	case "true-client-ip":
		return CustomDomainCustomClientIPHeaderEnumTrueClientIP, nil
	case "cf-connecting-ip":
		return CustomDomainCustomClientIPHeaderEnumCfConnectingIP, nil
	case "x-forwarded-for":
		return CustomDomainCustomClientIPHeaderEnumXForwardedFor, nil
	case "x-azure-clientip":
		return CustomDomainCustomClientIPHeaderEnumXAzureClientip, nil
	case "":
		return CustomDomainCustomClientIPHeaderEnumEmpty, nil
	}
	var t CustomDomainCustomClientIPHeaderEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

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

// Custom domain provisioning type. Must be `auth0_managed_certs` or `self_managed_certs`.
type CustomDomainProvisioningTypeEnum string

const (
	CustomDomainProvisioningTypeEnumAuth0ManagedCerts CustomDomainProvisioningTypeEnum = "auth0_managed_certs"
	CustomDomainProvisioningTypeEnumSelfManagedCerts  CustomDomainProvisioningTypeEnum = "self_managed_certs"
)

func NewCustomDomainProvisioningTypeEnumFromString(s string) (CustomDomainProvisioningTypeEnum, error) {
	switch s {
	case "auth0_managed_certs":
		return CustomDomainProvisioningTypeEnumAuth0ManagedCerts, nil
	case "self_managed_certs":
		return CustomDomainProvisioningTypeEnumSelfManagedCerts, nil
	}
	var t CustomDomainProvisioningTypeEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

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

// Custom domain configuration status. Can be `failed`, `pending_verification`, or `ready`.
type CustomDomainStatusFilterEnum string

const (
	CustomDomainStatusFilterEnumPendingVerification CustomDomainStatusFilterEnum = "pending_verification"
	CustomDomainStatusFilterEnumReady               CustomDomainStatusFilterEnum = "ready"
	CustomDomainStatusFilterEnumFailed              CustomDomainStatusFilterEnum = "failed"
)

func NewCustomDomainStatusFilterEnumFromString(s string) (CustomDomainStatusFilterEnum, error) {
	switch s {
	case "pending_verification":
		return CustomDomainStatusFilterEnumPendingVerification, nil
	case "ready":
		return CustomDomainStatusFilterEnumReady, nil
	case "failed":
		return CustomDomainStatusFilterEnumFailed, nil
	}
	var t CustomDomainStatusFilterEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

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

// Custom domain TLS policy. Must be `recommended`, includes TLS 1.2.
type CustomDomainTLSPolicyEnum = string

// Custom domain provisioning type. Can be `auth0_managed_certs` or `self_managed_certs`.
type CustomDomainTypeEnum string

const (
	CustomDomainTypeEnumAuth0ManagedCerts CustomDomainTypeEnum = "auth0_managed_certs"
	CustomDomainTypeEnumSelfManagedCerts  CustomDomainTypeEnum = "self_managed_certs"
)

func NewCustomDomainTypeEnumFromString(s string) (CustomDomainTypeEnum, error) {
	switch s {
	case "auth0_managed_certs":
		return CustomDomainTypeEnumAuth0ManagedCerts, nil
	case "self_managed_certs":
		return CustomDomainTypeEnumSelfManagedCerts, nil
	}
	var t CustomDomainTypeEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

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

// Custom domain verification method. Must be `txt`.
type CustomDomainVerificationMethodEnum = string

// Domain verification settings.
var (
	domainVerificationFieldMethods = big.NewInt(1 << 0)
)

type DomainVerification struct {
	// Domain verification methods.
	Methods []*DomainVerificationMethod `json:"methods,omitempty" url:"methods,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 (d *DomainVerification) GetMethods() []*DomainVerificationMethod {
	if d == nil || d.Methods == nil {
		return nil
	}
	return d.Methods
}

func (d *DomainVerification) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

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

// SetMethods sets the Methods field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DomainVerification) SetMethods(methods []*DomainVerificationMethod) {
	d.Methods = methods
	d.require(domainVerificationFieldMethods)
}

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

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

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

var (
	domainVerificationMethodFieldName   = big.NewInt(1 << 0)
	domainVerificationMethodFieldRecord = big.NewInt(1 << 1)
	domainVerificationMethodFieldDomain = big.NewInt(1 << 2)
)

type DomainVerificationMethod struct {
	Name DomainVerificationMethodNameEnum `json:"name" url:"name"`
	// Value used to verify the domain.
	Record string `json:"record" url:"record"`
	// The name of the txt record for verification
	Domain *string `json:"domain,omitempty" url:"domain,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 (d *DomainVerificationMethod) GetName() DomainVerificationMethodNameEnum {
	if d == nil {
		return ""
	}
	return d.Name
}

func (d *DomainVerificationMethod) GetRecord() string {
	if d == nil {
		return ""
	}
	return d.Record
}

func (d *DomainVerificationMethod) GetDomain() string {
	if d == nil || d.Domain == nil {
		return ""
	}
	return *d.Domain
}

func (d *DomainVerificationMethod) GetExtraProperties() map[string]interface{} {
	return d.extraProperties
}

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

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

// SetRecord sets the Record field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DomainVerificationMethod) SetRecord(record string) {
	d.Record = record
	d.require(domainVerificationMethodFieldRecord)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DomainVerificationMethod) SetDomain(domain *string) {
	d.Domain = domain
	d.require(domainVerificationMethodFieldDomain)
}

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

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

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

// Domain verification method.
type DomainVerificationMethodNameEnum string

const (
	DomainVerificationMethodNameEnumCname DomainVerificationMethodNameEnum = "cname"
	DomainVerificationMethodNameEnumTxt   DomainVerificationMethodNameEnum = "txt"
)

func NewDomainVerificationMethodNameEnumFromString(s string) (DomainVerificationMethodNameEnum, error) {
	switch s {
	case "cname":
		return DomainVerificationMethodNameEnumCname, nil
	case "txt":
		return DomainVerificationMethodNameEnumTxt, nil
	}
	var t DomainVerificationMethodNameEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (d DomainVerificationMethodNameEnum) Ptr() *DomainVerificationMethodNameEnum {
	return &d
}

var (
	getCustomDomainResponseContentFieldCustomDomainID       = big.NewInt(1 << 0)
	getCustomDomainResponseContentFieldDomain               = big.NewInt(1 << 1)
	getCustomDomainResponseContentFieldPrimary              = big.NewInt(1 << 2)
	getCustomDomainResponseContentFieldStatus               = big.NewInt(1 << 3)
	getCustomDomainResponseContentFieldType                 = big.NewInt(1 << 4)
	getCustomDomainResponseContentFieldOriginDomainName     = big.NewInt(1 << 5)
	getCustomDomainResponseContentFieldVerification         = big.NewInt(1 << 6)
	getCustomDomainResponseContentFieldCustomClientIPHeader = big.NewInt(1 << 7)
	getCustomDomainResponseContentFieldTLSPolicy            = big.NewInt(1 << 8)
)

type GetCustomDomainResponseContent struct {
	// ID of the custom domain.
	CustomDomainID string `json:"custom_domain_id" url:"custom_domain_id"`
	// Domain name.
	Domain string `json:"domain" url:"domain"`
	// Whether this is a primary domain (true) or not (false).
	Primary bool                         `json:"primary" url:"primary"`
	Status  CustomDomainStatusFilterEnum `json:"status" url:"status"`
	Type    CustomDomainTypeEnum         `json:"type" url:"type"`
	// Intermediate address.
	OriginDomainName *string             `json:"origin_domain_name,omitempty" url:"origin_domain_name,omitempty"`
	Verification     *DomainVerification `json:"verification,omitempty" url:"verification,omitempty"`
	// The HTTP header to fetch the client's IP address
	CustomClientIPHeader *string `json:"custom_client_ip_header,omitempty" url:"custom_client_ip_header,omitempty"`
	// The TLS version policy
	TLSPolicy *string `json:"tls_policy,omitempty" url:"tls_policy,omitempty"`

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

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

func (g *GetCustomDomainResponseContent) GetCustomDomainID() string {
	if g == nil {
		return ""
	}
	return g.CustomDomainID
}

func (g *GetCustomDomainResponseContent) GetDomain() string {
	if g == nil {
		return ""
	}
	return g.Domain
}

func (g *GetCustomDomainResponseContent) GetPrimary() bool {
	if g == nil {
		return false
	}
	return g.Primary
}

func (g *GetCustomDomainResponseContent) GetStatus() CustomDomainStatusFilterEnum {
	if g == nil {
		return ""
	}
	return g.Status
}

func (g *GetCustomDomainResponseContent) GetType() CustomDomainTypeEnum {
	if g == nil {
		return ""
	}
	return g.Type
}

func (g *GetCustomDomainResponseContent) GetOriginDomainName() string {
	if g == nil || g.OriginDomainName == nil {
		return ""
	}
	return *g.OriginDomainName
}

func (g *GetCustomDomainResponseContent) GetVerification() DomainVerification {
	if g == nil || g.Verification == nil {
		return DomainVerification{}
	}
	return *g.Verification
}

func (g *GetCustomDomainResponseContent) GetCustomClientIPHeader() string {
	if g == nil || g.CustomClientIPHeader == nil {
		return ""
	}
	return *g.CustomClientIPHeader
}

func (g *GetCustomDomainResponseContent) GetTLSPolicy() string {
	if g == nil || g.TLSPolicy == nil {
		return ""
	}
	return *g.TLSPolicy
}

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

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

// SetCustomDomainID sets the CustomDomainID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetCustomDomainResponseContent) SetCustomDomainID(customDomainID string) {
	g.CustomDomainID = customDomainID
	g.require(getCustomDomainResponseContentFieldCustomDomainID)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetCustomDomainResponseContent) SetDomain(domain string) {
	g.Domain = domain
	g.require(getCustomDomainResponseContentFieldDomain)
}

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

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

// 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 *GetCustomDomainResponseContent) SetType(type_ CustomDomainTypeEnum) {
	g.Type = type_
	g.require(getCustomDomainResponseContentFieldType)
}

// SetOriginDomainName sets the OriginDomainName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetCustomDomainResponseContent) SetOriginDomainName(originDomainName *string) {
	g.OriginDomainName = originDomainName
	g.require(getCustomDomainResponseContentFieldOriginDomainName)
}

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

// SetCustomClientIPHeader sets the CustomClientIPHeader field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetCustomDomainResponseContent) SetCustomClientIPHeader(customClientIPHeader *string) {
	g.CustomClientIPHeader = customClientIPHeader
	g.require(getCustomDomainResponseContentFieldCustomClientIPHeader)
}

// SetTLSPolicy sets the TLSPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetCustomDomainResponseContent) SetTLSPolicy(tlsPolicy *string) {
	g.TLSPolicy = tlsPolicy
	g.require(getCustomDomainResponseContentFieldTLSPolicy)
}

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

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

func (g *GetCustomDomainResponseContent) 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)
}

type ListCustomDomainsResponseContent = []*CustomDomain

var (
	testCustomDomainResponseContentFieldSuccess = big.NewInt(1 << 0)
	testCustomDomainResponseContentFieldMessage = big.NewInt(1 << 1)
)

type TestCustomDomainResponseContent struct {
	// Result of the operation.
	Success bool `json:"success" url:"success"`
	// Message describing the operation status.
	Message *string `json:"message,omitempty" url:"message,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 (t *TestCustomDomainResponseContent) GetSuccess() bool {
	if t == nil {
		return false
	}
	return t.Success
}

func (t *TestCustomDomainResponseContent) GetMessage() string {
	if t == nil || t.Message == nil {
		return ""
	}
	return *t.Message
}

func (t *TestCustomDomainResponseContent) GetExtraProperties() map[string]interface{} {
	return t.extraProperties
}

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

// SetSuccess sets the Success field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TestCustomDomainResponseContent) SetSuccess(success bool) {
	t.Success = success
	t.require(testCustomDomainResponseContentFieldSuccess)
}

// SetMessage sets the Message field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (t *TestCustomDomainResponseContent) SetMessage(message *string) {
	t.Message = message
	t.require(testCustomDomainResponseContentFieldMessage)
}

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

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

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

var (
	updateCustomDomainResponseContentFieldCustomDomainID       = big.NewInt(1 << 0)
	updateCustomDomainResponseContentFieldDomain               = big.NewInt(1 << 1)
	updateCustomDomainResponseContentFieldPrimary              = big.NewInt(1 << 2)
	updateCustomDomainResponseContentFieldStatus               = big.NewInt(1 << 3)
	updateCustomDomainResponseContentFieldType                 = big.NewInt(1 << 4)
	updateCustomDomainResponseContentFieldVerification         = big.NewInt(1 << 5)
	updateCustomDomainResponseContentFieldCustomClientIPHeader = big.NewInt(1 << 6)
	updateCustomDomainResponseContentFieldTLSPolicy            = big.NewInt(1 << 7)
)

type UpdateCustomDomainResponseContent struct {
	// ID of the custom domain.
	CustomDomainID string `json:"custom_domain_id" url:"custom_domain_id"`
	// Domain name.
	Domain string `json:"domain" url:"domain"`
	// Whether this is a primary domain (true) or not (false).
	Primary      bool                         `json:"primary" url:"primary"`
	Status       CustomDomainStatusFilterEnum `json:"status" url:"status"`
	Type         CustomDomainTypeEnum         `json:"type" url:"type"`
	Verification *DomainVerification          `json:"verification" url:"verification"`
	// The HTTP header to fetch the client's IP address
	CustomClientIPHeader *string `json:"custom_client_ip_header,omitempty" url:"custom_client_ip_header,omitempty"`
	// The TLS version policy
	TLSPolicy *string `json:"tls_policy,omitempty" url:"tls_policy,omitempty"`

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

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

func (u *UpdateCustomDomainResponseContent) GetCustomDomainID() string {
	if u == nil {
		return ""
	}
	return u.CustomDomainID
}

func (u *UpdateCustomDomainResponseContent) GetDomain() string {
	if u == nil {
		return ""
	}
	return u.Domain
}

func (u *UpdateCustomDomainResponseContent) GetPrimary() bool {
	if u == nil {
		return false
	}
	return u.Primary
}

func (u *UpdateCustomDomainResponseContent) GetStatus() CustomDomainStatusFilterEnum {
	if u == nil {
		return ""
	}
	return u.Status
}

func (u *UpdateCustomDomainResponseContent) GetType() CustomDomainTypeEnum {
	if u == nil {
		return ""
	}
	return u.Type
}

func (u *UpdateCustomDomainResponseContent) GetVerification() *DomainVerification {
	if u == nil {
		return nil
	}
	return u.Verification
}

func (u *UpdateCustomDomainResponseContent) GetCustomClientIPHeader() string {
	if u == nil || u.CustomClientIPHeader == nil {
		return ""
	}
	return *u.CustomClientIPHeader
}

func (u *UpdateCustomDomainResponseContent) GetTLSPolicy() string {
	if u == nil || u.TLSPolicy == nil {
		return ""
	}
	return *u.TLSPolicy
}

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

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

// SetCustomDomainID sets the CustomDomainID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateCustomDomainResponseContent) SetCustomDomainID(customDomainID string) {
	u.CustomDomainID = customDomainID
	u.require(updateCustomDomainResponseContentFieldCustomDomainID)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateCustomDomainResponseContent) SetDomain(domain string) {
	u.Domain = domain
	u.require(updateCustomDomainResponseContentFieldDomain)
}

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

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

// 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 (u *UpdateCustomDomainResponseContent) SetType(type_ CustomDomainTypeEnum) {
	u.Type = type_
	u.require(updateCustomDomainResponseContentFieldType)
}

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

// SetCustomClientIPHeader sets the CustomClientIPHeader field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateCustomDomainResponseContent) SetCustomClientIPHeader(customClientIPHeader *string) {
	u.CustomClientIPHeader = customClientIPHeader
	u.require(updateCustomDomainResponseContentFieldCustomClientIPHeader)
}

// SetTLSPolicy sets the TLSPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateCustomDomainResponseContent) SetTLSPolicy(tlsPolicy *string) {
	u.TLSPolicy = tlsPolicy
	u.require(updateCustomDomainResponseContentFieldTLSPolicy)
}

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

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

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

var (
	verifyCustomDomainResponseContentFieldCustomDomainID       = big.NewInt(1 << 0)
	verifyCustomDomainResponseContentFieldDomain               = big.NewInt(1 << 1)
	verifyCustomDomainResponseContentFieldPrimary              = big.NewInt(1 << 2)
	verifyCustomDomainResponseContentFieldStatus               = big.NewInt(1 << 3)
	verifyCustomDomainResponseContentFieldType                 = big.NewInt(1 << 4)
	verifyCustomDomainResponseContentFieldCnameAPIKey          = big.NewInt(1 << 5)
	verifyCustomDomainResponseContentFieldOriginDomainName     = big.NewInt(1 << 6)
	verifyCustomDomainResponseContentFieldVerification         = big.NewInt(1 << 7)
	verifyCustomDomainResponseContentFieldCustomClientIPHeader = big.NewInt(1 << 8)
	verifyCustomDomainResponseContentFieldTLSPolicy            = big.NewInt(1 << 9)
)

type VerifyCustomDomainResponseContent struct {
	// ID of the custom domain.
	CustomDomainID string `json:"custom_domain_id" url:"custom_domain_id"`
	// Domain name.
	Domain string `json:"domain" url:"domain"`
	// Whether this is a primary domain (true) or not (false).
	Primary bool                         `json:"primary" url:"primary"`
	Status  CustomDomainStatusFilterEnum `json:"status" url:"status"`
	Type    CustomDomainTypeEnum         `json:"type" url:"type"`
	// CNAME API key header.
	CnameAPIKey *string `json:"cname_api_key,omitempty" url:"cname_api_key,omitempty"`
	// Intermediate address.
	OriginDomainName *string             `json:"origin_domain_name,omitempty" url:"origin_domain_name,omitempty"`
	Verification     *DomainVerification `json:"verification,omitempty" url:"verification,omitempty"`
	// The HTTP header to fetch the client's IP address
	CustomClientIPHeader *string `json:"custom_client_ip_header,omitempty" url:"custom_client_ip_header,omitempty"`
	// The TLS version policy
	TLSPolicy *string `json:"tls_policy,omitempty" url:"tls_policy,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 (v *VerifyCustomDomainResponseContent) GetCustomDomainID() string {
	if v == nil {
		return ""
	}
	return v.CustomDomainID
}

func (v *VerifyCustomDomainResponseContent) GetDomain() string {
	if v == nil {
		return ""
	}
	return v.Domain
}

func (v *VerifyCustomDomainResponseContent) GetPrimary() bool {
	if v == nil {
		return false
	}
	return v.Primary
}

func (v *VerifyCustomDomainResponseContent) GetStatus() CustomDomainStatusFilterEnum {
	if v == nil {
		return ""
	}
	return v.Status
}

func (v *VerifyCustomDomainResponseContent) GetType() CustomDomainTypeEnum {
	if v == nil {
		return ""
	}
	return v.Type
}

func (v *VerifyCustomDomainResponseContent) GetCnameAPIKey() string {
	if v == nil || v.CnameAPIKey == nil {
		return ""
	}
	return *v.CnameAPIKey
}

func (v *VerifyCustomDomainResponseContent) GetOriginDomainName() string {
	if v == nil || v.OriginDomainName == nil {
		return ""
	}
	return *v.OriginDomainName
}

func (v *VerifyCustomDomainResponseContent) GetVerification() DomainVerification {
	if v == nil || v.Verification == nil {
		return DomainVerification{}
	}
	return *v.Verification
}

func (v *VerifyCustomDomainResponseContent) GetCustomClientIPHeader() string {
	if v == nil || v.CustomClientIPHeader == nil {
		return ""
	}
	return *v.CustomClientIPHeader
}

func (v *VerifyCustomDomainResponseContent) GetTLSPolicy() string {
	if v == nil || v.TLSPolicy == nil {
		return ""
	}
	return *v.TLSPolicy
}

func (v *VerifyCustomDomainResponseContent) GetExtraProperties() map[string]interface{} {
	return v.extraProperties
}

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

// SetCustomDomainID sets the CustomDomainID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetCustomDomainID(customDomainID string) {
	v.CustomDomainID = customDomainID
	v.require(verifyCustomDomainResponseContentFieldCustomDomainID)
}

// SetDomain sets the Domain field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetDomain(domain string) {
	v.Domain = domain
	v.require(verifyCustomDomainResponseContentFieldDomain)
}

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

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

// 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 (v *VerifyCustomDomainResponseContent) SetType(type_ CustomDomainTypeEnum) {
	v.Type = type_
	v.require(verifyCustomDomainResponseContentFieldType)
}

// SetCnameAPIKey sets the CnameAPIKey field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetCnameAPIKey(cnameAPIKey *string) {
	v.CnameAPIKey = cnameAPIKey
	v.require(verifyCustomDomainResponseContentFieldCnameAPIKey)
}

// SetOriginDomainName sets the OriginDomainName field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetOriginDomainName(originDomainName *string) {
	v.OriginDomainName = originDomainName
	v.require(verifyCustomDomainResponseContentFieldOriginDomainName)
}

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

// SetCustomClientIPHeader sets the CustomClientIPHeader field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetCustomClientIPHeader(customClientIPHeader *string) {
	v.CustomClientIPHeader = customClientIPHeader
	v.require(verifyCustomDomainResponseContentFieldCustomClientIPHeader)
}

// SetTLSPolicy sets the TLSPolicy field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (v *VerifyCustomDomainResponseContent) SetTLSPolicy(tlsPolicy *string) {
	v.TLSPolicy = tlsPolicy
	v.require(verifyCustomDomainResponseContentFieldTLSPolicy)
}

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

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

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