// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.

package components

import (
	"encoding/json"
	"fmt"
)

type RecordType string

const (
	RecordTypeUnknown RecordType = ""
	RecordTypeA       RecordType = "a"
	RecordTypeAaaa    RecordType = "aaaa"
)

func (e RecordType) ToPointer() *RecordType {
	return &e
}
func (e *RecordType) UnmarshalJSON(data []byte) error {
	var v string
	if err := json.Unmarshal(data, &v); err != nil {
		return err
	}
	switch v {
	case "":
		fallthrough
	case "a":
		fallthrough
	case "aaaa":
		*e = RecordType(v)
		return nil
	default:
		return fmt.Errorf("invalid value for RecordType: %v", v)
	}
}

type HostDNSForwardResolution struct {
	Name        *string     `json:"name,omitempty"`
	RecordType  *RecordType `json:"record_type,omitempty"`
	ResolveTime *string     `json:"resolve_time,omitempty"`
	Server      *string     `json:"server,omitempty"`
}

func (o *HostDNSForwardResolution) GetName() *string {
	if o == nil {
		return nil
	}
	return o.Name
}

func (o *HostDNSForwardResolution) GetRecordType() *RecordType {
	if o == nil {
		return nil
	}
	return o.RecordType
}

func (o *HostDNSForwardResolution) GetResolveTime() *string {
	if o == nil {
		return nil
	}
	return o.ResolveTime
}

func (o *HostDNSForwardResolution) GetServer() *string {
	if o == nil {
		return nil
	}
	return o.Server
}
