forked from palantir/conjure-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.conjure.go
42 lines (35 loc) · 1.23 KB
/
services.conjure.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
// This file was generated by Conjure and should not be manually edited.
package api
import (
"context"
"fmt"
"github.com/palantir/conjure-go-runtime/conjure-go-client/httpclient"
)
type TestServiceClient interface {
Echo(ctx context.Context, inputArg string) (string, error)
}
type testServiceClient struct {
client httpclient.Client
}
func NewTestServiceClient(client httpclient.Client) TestServiceClient {
return &testServiceClient{client: client}
}
func (c *testServiceClient) Echo(ctx context.Context, inputArg string) (string, error) {
var defaultReturnVal string
var returnVal *string
var requestParams []httpclient.RequestParam
requestParams = append(requestParams, httpclient.WithRPCMethodName("Echo"))
requestParams = append(requestParams, httpclient.WithRequestMethod("POST"))
requestParams = append(requestParams, httpclient.WithPathf("/echo"))
requestParams = append(requestParams, httpclient.WithJSONRequest(inputArg))
requestParams = append(requestParams, httpclient.WithJSONResponse(&returnVal))
resp, err := c.client.Do(ctx, requestParams...)
if err != nil {
return defaultReturnVal, err
}
_ = resp
if returnVal == nil {
return defaultReturnVal, fmt.Errorf("returnVal cannot be nil")
}
return *returnVal, nil
}