models

package
v0.0.0-...-2e3e994 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIENT_PRINCIPAL_KEY      = "X-MS-CLIENT-PRINCIPAL"
	CLIENT_PRINCIPAL_ID_KEY   = "X-MS-CLIENT-PRINCIPAL-ID"
	CLIENT_PRINCIPAL_NAME_KEY = "X-MS-CLIENT-PRINCIPAL-NAME"
)
View Source
const (
	EnergyClassAplusplus EnergyClass = "A++"
	EnergyClassAplus     EnergyClass = "A+"
	EnergyClassA         EnergyClass = "A"
	EnergyClassB         EnergyClass = "B"
	EnergyClassC         EnergyClass = "C"
	EnergyClassD         EnergyClass = "D"
	EnergyClassE         EnergyClass = "E"
	EnergyClassF         EnergyClass = "F"
	EnergyClassG         EnergyClass = "G"

	ListingTypeRent ListingType = "rent"
	ListingTypeSale ListingType = "sale"
	ListingTypeBoth ListingType = "both"

	SortTypeAsc  SortType = "ASC"
	SortTypeDesc SortType = "DESC"
)
View Source
const ScraperResultListingSchema = `` /* 4063-byte string literal not displayed */

Variables

This section is empty.

Functions

func UnmarshalAndValidate

func UnmarshalAndValidate[T interface{}](body io.ReadCloser) (s T, err error)

Types

type Claim

type Claim struct {
	Typ string `json:"typ"`
	Val string `json:"val"`
}

type CosmosBindingInput

type CosmosBindingInput struct {
	Data     Data     `json:"Data"`
	Metadata Metadata `json:"Metadata"`
}

type Data

type Data struct {
	Documents string   `json:"documents"`
	Metadata  Metadata `json:"Metadata"`
}

type EnergyClass

type EnergyClass string

func GetEnergyClasses

func GetEnergyClasses() []EnergyClass

func (EnergyClass) GetIndex

func (c EnergyClass) GetIndex() int

func (EnergyClass) IsEnumValue

func (c EnergyClass) IsEnumValue() bool

type Error

type Error struct {
	Message string `json:"message"`
}

Holds any form of error (either from Azure or some internal error)

type GetListingsResponse

type GetListingsResponse struct {
	Results           []Listing `json:"results"`
	ContinuationToken *string   `json:"continuationToken"`
}

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
}

type HttpResponse

type HttpResponse struct {
	Body       string            `json:"body"`
	StatusCode int               `json:"statusCode"`
	Headers    map[string]string `json:"headers"`
}

type Identity

type Identity struct {
	AuthenticationType *string `json:"AuthenticationType"`
	IsAuthenticated    bool    `json:"IsAuthenticated"`
	Actor              *string `json:"Actor"`
	BootstrapContext   *string `json:"BootstrapContext"`
	Label              *string `json:"Label"`
	Name               *string `json:"Name"`
	NameClaimType      string  `json:"NameClaimType"`
	RoleClaimType      string  `json:"RoleClaimType"`
}

type InvokeRequest

type InvokeRequest[Q any] struct {
	Data struct {
		Req struct {
			Url        string
			Method     string
			Query      Q
			Headers    map[string][]string
			Host       []string
			UserAgent  []string `json:"User-Agent"`
			Params     map[string]string
			Identities []Identity
			Body       string
		} `json:"req"`
	}
	Metadata map[string]interface{}
}

type InvokeResponse

type InvokeResponse struct {
	Outputs     map[string]interface{}
	Logs        []string
	ReturnValue interface{}
}

func NewHttpInvokeResponse

func NewHttpInvokeResponse(statusCode int, body interface{}, logs []string) (ir InvokeResponse)

func NewHttpInvokeResponseWithHeaders

func NewHttpInvokeResponseWithHeaders(statusCode int, body interface{}, headers map[string]string, logs []string) (ir InvokeResponse)

type Listing

type Listing struct {
	ID                 string    `json:"id"`
	PartitionKey       string    `json:"_partitionKey"`
	Title              string    `json:"title"`
	HousingCooperative string    `json:"housingCooperative"`
	ProjectID          string    `json:"projectId"`
	ListingID          string    `json:"listingId"`
	Country            string    `json:"country"`
	City               string    `json:"city"`
	PostalCode         string    `json:"postalCode"`
	Address            string    `json:"address"`
	RoomCount          *float32  `json:"roomCount"`
	SquareMeters       float32   `json:"squareMeters"`
	AvailabilityDate   string    `json:"availabilityDate"`
	YearBuilt          *int      `json:"yearBuilt"`
	HwgEnergyClass     *string   `json:"hwgEnergyClass"`
	FgeeEnergyClass    *string   `json:"fgeeEnergyClass"`
	ListingType        string    `json:"listingType"`
	RentPricePerMonth  *float32  `json:"rentPricePerMonth"`
	CooperativeShare   *float32  `json:"cooperativeShare"`
	SalePrice          *float32  `json:"salePrice"`
	AdditionalFees     *float32  `json:"additionalFees"`
	DetailsURL         string    `json:"detailsUrl"`
	PreviewImageURL    string    `json:"previewImageUrl"`
	ScraperID          string    `json:"scraperId"`
	CreatedAt          time.Time `json:"createdAt"`
	LastModifiedAt     time.Time `json:"lastModifiedAt"`
}

type ListingType

type ListingType string

func (ListingType) IsEnumValue

func (t ListingType) IsEnumValue() bool

type ListingsQuery

type ListingsQuery struct {
	Id                   string       `json:"id"`
	Email                string       `json:"email"`
	Title                *string      `json:"title" validate:"omitempty"`
	HousingCooperative   *string      `json:"housingCooperative" validate:"omitempty"`
	ProjectId            *string      `json:"projectId" validate:"omitempty"`
	PostalCode           *string      `json:"postalCode" validate:"omitempty"`
	RoomCount            *float32     `json:"roomCount,string" validate:"omitempty,gt=0"`
	MinRoomCount         *float32     `json:"minRoomCount,string" validate:"omitempty,gt=0"`
	MaxRoomCount         *float32     `json:"maxRoomCount,string" validate:"omitempty,gt=0,gtfieldcustom=MinRoomCount"`
	MinSquareMeters      *float32     `json:"minSqm,string" validate:"omitempty,gt=0"`
	MaxSquareMeters      *float32     `json:"maxSqm,string" validate:"omitempty,gt=0,gtfieldcustom=MinSquareMeters"`
	AvailableFrom        *string      `json:"availableFrom" validate:"omitempty,datecustom"`
	MinYearBuilt         *int         `json:"minYearBuilt,string" validate:"omitempty,gt=1900"`
	MaxYearBuilt         *int         `json:"maxYearBuilt,string" validate:"omitempty,gt=1900,gtfieldcustom=MinYearBuilt"`
	MinHwgEnergyClass    *EnergyClass `json:"minHwgEnergyClass" validate:"omitempty,energycustom"`
	MinFgeeEnergyClass   *EnergyClass `json:"minFgeeEnergyClass" validate:"omitempty,energycustom"`
	ListingType          *ListingType `json:"listingType" validate:"omitempty,listingtypecustom"`
	MinRentPricePerMonth *float32     `json:"minRentPrice,string" validate:"omitempty,gt=0"`
	MaxRentPricePerMonth *float32     `json:"maxRentPrice,string" validate:"omitempty,gt=0,gtfieldcustom=MinRentPricePerMonth"`
	MinCooperativeShare  *float32     `json:"minCooperativeShare,string" validate:"omitempty,gt=0"`
	MaxCooperativeShare  *float32     `json:"maxCooperativeShare,string" validate:"omitempty,gt=0,gtfieldcustom=MinCooperativeShare"`
	MinSalePrice         *float32     `json:"minSalePrice,string" validate:"omitempty,gt=0"`
	MaxSalePrice         *float32     `json:"maxSalePrice,string" validate:"omitempty,gt=0,gtfieldcustom=MinSalePrice"`
	ContinuationToken    *string      `json:"continuationToken"`
	PageSize             *int         `json:"pageSize,string" validate:"omitempty,gt=0,lte=30"`
	SortBy               *string
	SortType             *SortType `json:"sortType" validate:"omitempty,sorttypecustom"`
}

type Metadata

type Metadata struct {
	City string `json:"city"`
	ID   string `json:"id"`
}

type NotificationData

type NotificationData struct {
	Emails  []string `json:"emails"`
	Listing Listing  `json:"listing"`
}

type NotificationSettings

type NotificationSettings struct {
	City *string `json:"city"`
	Preferences
}

type Preferences

type Preferences struct {
	PartitionKey         string       `json:"_partitionKey,omitempty"`
	Id                   string       `json:"id"`
	Email                string       `json:"email" validate:"email"`
	Title                *string      `json:"title,omitempty" validate:"omitempty"`
	HousingCooperative   *string      `json:"housingCooperative,omitempty" validate:"omitempty"`
	ProjectId            *string      `json:"projectId,omitempty" validate:"omitempty"`
	PostalCode           *string      `json:"postalCode,omitempty" validate:"omitempty"`
	RoomCount            *float32     `json:"roomCount,omitempty" validate:"omitempty,gt=0"`
	MinRoomCount         *float32     `json:"minRoomCount,omitempty" validate:"omitempty,gt=0"`
	MaxRoomCount         *float32     `json:"maxRoomCount,omitempty" validate:"omitempty,gt=0,gtfieldcustom=MinRoomCount"`
	MinSquareMeters      *float32     `json:"minSqm,omitempty" validate:"omitempty,gt=0"`
	MaxSquareMeters      *float32     `json:"maxSqm,omitempty" validate:"omitempty,gt=0,gtfieldcustom=MinSquareMeters"`
	AvailableFrom        *string      `json:"availableFrom,omitempty" validate:"omitempty,datecustom"`
	MinYearBuilt         *int         `json:"minYearBuilt,omitempty" validate:"omitempty,gt=1900"`
	MaxYearBuilt         *int         `json:"maxYearBuilt,omitempty" validate:"omitempty,gt=1900,gtfieldcustom=MinYearBuilt"`
	MinHwgEnergyClass    *EnergyClass `json:"minHwgEnergyClass,omitempty" validate:"omitempty,energycustom"`
	MinFgeeEnergyClass   *EnergyClass `json:"minFgeeEnergyClass,omitempty" validate:"omitempty,energycustom"`
	ListingType          *ListingType `json:"listingType,omitempty" validate:"omitempty,listingtypecustom"`
	MinRentPricePerMonth *float32     `json:"minRentPrice,omitempty" validate:"omitempty,gt=0"`
	MaxRentPricePerMonth *float32     `json:"maxRentPrice,omitempty" validate:"omitempty,gt=0,gtfieldcustom=MinRentPricePerMonth"`
	MinCooperativeShare  *float32     `json:"minCooperativeShare,omitempty" validate:"omitempty,gt=0"`
	MaxCooperativeShare  *float32     `json:"maxCooperativeShare,omitempty" validate:"omitempty,gt=0,gtfieldcustom=MinCooperativeShare"`
	MinSalePrice         *float32     `json:"minSalePrice,omitempty" validate:"omitempty,gt=0"`
	MaxSalePrice         *float32     `json:"maxSalePrice,omitempty" validate:"omitempty,gt=0,gtfieldcustom=MinSalePrice"`
}

type QueueBindingData

type QueueBindingData struct {
	Msg string `json:"msg"`
}

type QueueBindingInput

type QueueBindingInput struct {
	Data     QueueBindingData     `json:"Data"`
	Metadata QueueBindingMetadata `json:"Metadata"`
}

type QueueBindingMetadata

type QueueBindingMetadata struct {
	Id           string `json:"Id"`
	DequeueCount string `json:"DequeueCount"`
}

type ScraperResultList

type ScraperResultList struct {
	ScraperId string                 `json:"scraperId"`
	Timestamp time.Time              `json:"timestamp"`
	Listings  []ScraperResultListing `json:"listings"`
}

type ScraperResultListing

type ScraperResultListing struct {
	Title              string   `json:"title"`
	HousingCooperative string   `json:"housingCooperative"`
	ProjectId          string   `json:"projectId"`
	ListingId          string   `json:"listingId"`
	Country            string   `json:"country"`
	City               string   `json:"city"`
	PostalCode         string   `json:"postalCode"`
	Address            string   `json:"address"`
	RoomCount          *float32 `json:"roomCount"`
	SquareMeters       float32  `json:"squareMeters"`
	AvailabilityDate   string   `json:"availabilityDate"`
	YearBuilt          *int     `json:"yearBuilt,omitempty"`
	HwgEnergyClass     *string  `json:"hwgEnergyClass,omitempty"`
	FgeeEnergyClass    *string  `json:"fgeeEnergyClass,omitempty"`
	ListingType        string   `json:"listingType"`
	RentPricePerMonth  *float32 `json:"rentPricePerMonth,omitempty"`
	CooperativeShare   *float32 `json:"cooperativeShare,omitempty"`
	SalePrice          *float32 `json:"salePrice,omitempty"`
	AdditionalFees     *float32 `json:"additionalFees,omitempty"`
	DetailsUrl         string   `json:"detailsUrl"`
	PreviewImageUrl    string   `json:"previewImageUrl"`
}

type SortType

type SortType string

func (SortType) IsEnumValue

func (t SortType) IsEnumValue() bool

type StringEnum

type StringEnum interface {
	IsEnumValue() bool
}

type UserData

type UserData struct {
	City *string `json:"city"`
	Preferences
}

type UserPrincipal

type UserPrincipal struct {
	AuthTyp string  `json:"auth_typ"`
	Claims  []Claim `json:"claims"`
	NameTyp string  `json:"name_typ"`
	RoleTyp string  `json:"role_typ"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL