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

package shared

import (
	"encoding/json"
	"fmt"
	"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/internal/utils"
)

type Rentcast string

const (
	RentcastRentcast Rentcast = "rentcast"
)

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

type SourceRentcast struct {
	// The full address of the property, in the format of Street, City, State, Zip. Used to retrieve data for a specific property, or together with the radius parameter to search for listings in a specific area
	Address *string `json:"address,omitempty"`
	APIKey  string  `json:"api_key"`
	// The number of bathrooms, used to search for listings matching this criteria. Supports fractions to indicate partial bathrooms
	BathRooms *int64 `json:"bath_rooms,omitempty"`
	// The number of bedrooms, used to search for listings matching this criteria. Use 0 to indicate a studio layout
	Bedrooms *float64 `json:"bedrooms,omitempty"`
	// The name of the city, used to search for listings in a specific city. This parameter is case-sensitive
	City *string `json:"city,omitempty"`
	// The type of aggregate market data to return. Defaults to "All" if not provided : All , Sale , Rental
	DataType *string `json:"data_type_,omitempty"`
	// The maximum number of days since a property was listed on the market, with a minimum of 1 or The maximum number of days since a property was last sold, with a minimum of 1. Used to search for properties that were sold within the specified date range
	DaysOld *string `json:"days_old,omitempty"`
	// The time range for historical record entries, in months. Defaults to 12 if not provided
	HistoryRange *string `json:"history_range,omitempty"`
	// The latitude of the search area. Use the latitude/longitude and radius parameters to search for listings in a specific area
	Latitude *string `json:"latitude,omitempty"`
	// The longitude of the search area. Use the latitude/longitude and radius parameters to search for listings in a specific area
	Longitude *string `json:"longitude,omitempty"`
	// The type of the property, used to search for listings matching this criteria : Single Family , Condo , Townhouse , Manufactured ,  Multi-Family , Apartment , Land ,
	PropertyType *string `json:"property_type,omitempty"`
	// The radius of the search area in miles, with a maximum of 100. Use in combination with the latitude/longitude or address parameters to search for listings in a specific area
	Radius *string `json:"radius,omitempty"`
	// The 2-character state abbreviation, used to search for listings in a specific state. This parameter is case-sensitive
	State *string `json:"state,omitempty"`
	// The current listing status, used to search for listings matching this criteria : Active or Inactive
	Status *string `json:"status,omitempty"`
	// The 5-digit zip code, used to search for listings in a specific zip code
	Zipcode    *string  `json:"zipcode,omitempty"`
	sourceType Rentcast `const:"rentcast" json:"sourceType"`
}

func (s SourceRentcast) MarshalJSON() ([]byte, error) {
	return utils.MarshalJSON(s, "", false)
}

func (s *SourceRentcast) UnmarshalJSON(data []byte) error {
	if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
		return err
	}
	return nil
}

func (o *SourceRentcast) GetAddress() *string {
	if o == nil {
		return nil
	}
	return o.Address
}

func (o *SourceRentcast) GetAPIKey() string {
	if o == nil {
		return ""
	}
	return o.APIKey
}

func (o *SourceRentcast) GetBathRooms() *int64 {
	if o == nil {
		return nil
	}
	return o.BathRooms
}

func (o *SourceRentcast) GetBedrooms() *float64 {
	if o == nil {
		return nil
	}
	return o.Bedrooms
}

func (o *SourceRentcast) GetCity() *string {
	if o == nil {
		return nil
	}
	return o.City
}

func (o *SourceRentcast) GetDataType() *string {
	if o == nil {
		return nil
	}
	return o.DataType
}

func (o *SourceRentcast) GetDaysOld() *string {
	if o == nil {
		return nil
	}
	return o.DaysOld
}

func (o *SourceRentcast) GetHistoryRange() *string {
	if o == nil {
		return nil
	}
	return o.HistoryRange
}

func (o *SourceRentcast) GetLatitude() *string {
	if o == nil {
		return nil
	}
	return o.Latitude
}

func (o *SourceRentcast) GetLongitude() *string {
	if o == nil {
		return nil
	}
	return o.Longitude
}

func (o *SourceRentcast) GetPropertyType() *string {
	if o == nil {
		return nil
	}
	return o.PropertyType
}

func (o *SourceRentcast) GetRadius() *string {
	if o == nil {
		return nil
	}
	return o.Radius
}

func (o *SourceRentcast) GetState() *string {
	if o == nil {
		return nil
	}
	return o.State
}

func (o *SourceRentcast) GetStatus() *string {
	if o == nil {
		return nil
	}
	return o.Status
}

func (o *SourceRentcast) GetZipcode() *string {
	if o == nil {
		return nil
	}
	return o.Zipcode
}

func (o *SourceRentcast) GetSourceType() Rentcast {
	return RentcastRentcast
}
