package redis

import (
	
	
)

type GeoCmdable interface {
	GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
	GeoPos(ctx context.Context, key string, members ...string) *GeoPosCmd
	GeoRadius(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd
	GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *IntCmd
	GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
	GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
	GeoSearch(ctx context.Context, key string, q *GeoSearchQuery) *StringSliceCmd
	GeoSearchLocation(ctx context.Context, key string, q *GeoSearchLocationQuery) *GeoSearchLocationCmd
	GeoSearchStore(ctx context.Context, key, store string, q *GeoSearchStoreQuery) *IntCmd
	GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
	GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
}

func ( cmdable) ( context.Context,  string,  ...*GeoLocation) *IntCmd {
	 := make([]interface{}, 2+3*len())
	[0] = "geoadd"
	[1] = 
	for ,  := range  {
		[2+3*] = .Longitude
		[2+3*+1] = .Latitude
		[2+3*+2] = .Name
	}
	 := NewIntCmd(, ...)
	_ = (, )
	return 
}

// GeoRadius queries a geospatial index for members within a distance from a coordinate.
// This is a read-only variant that does not support Store or StoreDist options.
//
// Deprecated: Use GeoSearch with BYRADIUS argument instead as of Redis 6.2.0.
func ( cmdable) (
	 context.Context,  string, ,  float64,  *GeoRadiusQuery,
) *GeoLocationCmd {
	 := NewGeoLocationCmd(, , "georadius_ro", , , )
	if .Store != "" || .StoreDist != "" {
		.SetErr(errors.New("GeoRadius does not support Store or StoreDist"))
		return 
	}
	_ = (, )
	return 
}

// GeoRadiusStore is a writing GEORADIUS command.
func ( cmdable) (
	 context.Context,  string, ,  float64,  *GeoRadiusQuery,
) *IntCmd {
	 := geoLocationArgs(, "georadius", , , )
	 := NewIntCmd(, ...)
	if .Store == "" && .StoreDist == "" {
		.SetErr(errors.New("GeoRadiusStore requires Store or StoreDist"))
		return 
	}
	_ = (, )
	return 
}

// GeoRadiusByMember queries a geospatial index for members within a distance from a member.
// This is a read-only variant that does not support Store or StoreDist options.
//
// Deprecated: Use GeoSearch with BYRADIUS and FROMMEMBER arguments instead as of Redis 6.2.0.
func ( cmdable) (
	 context.Context, ,  string,  *GeoRadiusQuery,
) *GeoLocationCmd {
	 := NewGeoLocationCmd(, , "georadiusbymember_ro", , )
	if .Store != "" || .StoreDist != "" {
		.SetErr(errors.New("GeoRadiusByMember does not support Store or StoreDist"))
		return 
	}
	_ = (, )
	return 
}

// GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func ( cmdable) (
	 context.Context, ,  string,  *GeoRadiusQuery,
) *IntCmd {
	 := geoLocationArgs(, "georadiusbymember", , )
	 := NewIntCmd(, ...)
	if .Store == "" && .StoreDist == "" {
		.SetErr(errors.New("GeoRadiusByMemberStore requires Store or StoreDist"))
		return 
	}
	_ = (, )
	return 
}

func ( cmdable) ( context.Context,  string,  *GeoSearchQuery) *StringSliceCmd {
	 := make([]interface{}, 0, 13)
	 = append(, "geosearch", )
	 = geoSearchArgs(, )
	 := NewStringSliceCmd(, ...)
	_ = (, )
	return 
}

func ( cmdable) (
	 context.Context,  string,  *GeoSearchLocationQuery,
) *GeoSearchLocationCmd {
	 := make([]interface{}, 0, 16)
	 = append(, "geosearch", )
	 := NewGeoSearchLocationCmd(, , ...)
	_ = (, )
	return 
}

func ( cmdable) ( context.Context, ,  string,  *GeoSearchStoreQuery) *IntCmd {
	 := make([]interface{}, 0, 15)
	 = append(, "geosearchstore", , )
	 = geoSearchArgs(&.GeoSearchQuery, )
	if .StoreDist {
		 = append(, "storedist")
	}
	 := NewIntCmd(, ...)
	_ = (, )
	return 
}

func ( cmdable) (
	 context.Context,  string, , ,  string,
) *FloatCmd {
	if  == "" {
		 = "km"
	}
	 := NewFloatCmd(, "geodist", , , , )
	_ = (, )
	return 
}

func ( cmdable) ( context.Context,  string,  ...string) *StringSliceCmd {
	 := make([]interface{}, 2+len())
	[0] = "geohash"
	[1] = 
	for ,  := range  {
		[2+] = 
	}
	 := NewStringSliceCmd(, ...)
	_ = (, )
	return 
}

func ( cmdable) ( context.Context,  string,  ...string) *GeoPosCmd {
	 := make([]interface{}, 2+len())
	[0] = "geopos"
	[1] = 
	for ,  := range  {
		[2+] = 
	}
	 := NewGeoPosCmd(, ...)
	_ = (, )
	return 
}