Get obtains a PersonalizationResponse for the given resource and params.
(ctx context.Context, resource string, params map[string]any)
| 25 | |
| 26 | // Get obtains a PersonalizationResponse for the given resource and params. |
| 27 | func (c *PersonalizationClient) Get(ctx context.Context, resource string, params map[string]any) (*PersonalizationResponse, error) { |
| 28 | if resource == "" { |
| 29 | return nil, errors.New("missing resource") |
| 30 | } |
| 31 | endpoint := c.client.makeEndpoint("%s/", resource) |
| 32 | for k, v := range params { |
| 33 | endpoint.addQueryParam(makeRequestOption(k, v)) |
| 34 | } |
| 35 | return c.decode(c.client.get(ctx, endpoint, nil, c.client.authenticator.personalizationAuth)) |
| 36 | } |
| 37 | |
| 38 | // Post sends data to the given resource, adding the given params to the request. |
| 39 | func (c *PersonalizationClient) Post(ctx context.Context, resource string, params, data map[string]any) (*PersonalizationResponse, error) { |
nothing calls this directly
no test coverage detected