-
Notifications
You must be signed in to change notification settings - Fork 25
/
filter.go
47 lines (41 loc) · 1.14 KB
/
filter.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
// Code generated by goagen v1.4.3, DO NOT EDIT.
//
// API "feedpushr": filter Resource Client
//
// Command:
// $ goagen
// --design=github.com/ncarlier/feedpushr/v3/design
// --out=/home/nicolas/workspace/feedpushr/autogen
// --version=v1.4.3
package client
import (
"context"
"fmt"
"net/http"
"net/url"
)
// SpecsFilterPath computes a request path to the specs action of filter.
func SpecsFilterPath() string {
return fmt.Sprintf("/v2/filters/_specs")
}
// Retrieve all filter types available
func (c *Client) SpecsFilter(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewSpecsFilterRequest(ctx, path)
if err != nil {
return nil, err
}
return c.Client.Do(ctx, req)
}
// NewSpecsFilterRequest create the request corresponding to the specs action endpoint of the filter resource.
func (c *Client) NewSpecsFilterRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
scheme = "http"
}
u := url.URL{Host: c.Host, Scheme: scheme, Path: path}
req, err := http.NewRequestWithContext(ctx, "GET", u.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}