-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_properties.go
42 lines (37 loc) · 1.13 KB
/
user_properties.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package recombee
import (
"fmt"
"net/http"
)
// AddUserProperty is somehow equivalent to adding a column to the table of users.
// The users may be characterized by various properties of different types.
func AddUserProperty(propertyName string, typ string) Request {
params := make(map[string]interface{})
params["type"] = typ
return Request{
Path: fmt.Sprintf("/users/properties/%s", propertyName),
Method: http.MethodPut,
Params: params,
}
}
// DeleteUserProperty is roughly equivalent to removing a column from the table of users.
func DeleteUserProperty(propertyName string) Request {
return Request{
Path: fmt.Sprintf("/users/properties/%s", propertyName),
Method: http.MethodDelete,
}
}
// GetUserPropertyInfo gets information about specified user property.
func GetUserPropertyInfo(propertyName string) Request {
return Request{
Path: fmt.Sprintf("/users/properties/%s", propertyName),
Method: http.MethodGet,
}
}
// ListUserProperties gets the list of all the user properties in your database.
func ListUserProperties() Request {
return Request{
Path: "/users/properties/list/",
Method: http.MethodGet,
}
}