-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_properties.go
47 lines (42 loc) · 1.23 KB
/
item_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
43
44
45
46
47
package recombee
import (
"fmt"
"net/http"
)
// AddItemProperty adds item property.
//
// Adding an item property is somehow equivalent to adding a column to the table of items. The items may be
// characterized by various properties of different types.
func AddItemProperty(propertyName string, typ string) Request {
params := map[string]interface{}{
"type": typ,
}
return Request{
Path: fmt.Sprintf("/items/properties/%s", propertyName),
Method: http.MethodPut,
Params: params,
}
}
// DeleteItemProperty deletes item property.
//
// Deleting an item property is roughly equivalent to removing a column from the table of items.
func DeleteItemProperty(propertyName string) Request {
return Request{
Path: fmt.Sprintf("/items/properties/%s", propertyName),
Method: http.MethodDelete,
}
}
// GetItemPropertyInfo gets information about specified item property.
func GetItemPropertyInfo(propertyName string) Request {
return Request{
Path: fmt.Sprintf("/items/properties/%s", propertyName),
Method: http.MethodGet,
}
}
// ListItemProperties gets the list of all the item properties in your database.
func ListItemProperties() Request {
return Request{
Path: "/items/properties/list/",
Method: http.MethodGet,
}
}