Skip to content

Commit 27ffd30

Browse files
committed
Release v0.9.0
1 parent b85fb7d commit 27ffd30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+11274
-990
lines changed

analytics.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analytics/client.go

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analytics/raw_client.go

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package analytics
2+
3+
import (
4+
context "context"
5+
server "github.com/VapiAI/server-sdk-go"
6+
core "github.com/VapiAI/server-sdk-go/core"
7+
internal "github.com/VapiAI/server-sdk-go/internal"
8+
option "github.com/VapiAI/server-sdk-go/option"
9+
http "net/http"
10+
)
11+
12+
type RawClient struct {
13+
baseURL string
14+
caller *internal.Caller
15+
header http.Header
16+
}
17+
18+
func NewRawClient(options *core.RequestOptions) *RawClient {
19+
return &RawClient{
20+
baseURL: options.BaseURL,
21+
caller: internal.NewCaller(
22+
&internal.CallerParams{
23+
Client: options.HTTPClient,
24+
MaxAttempts: options.MaxAttempts,
25+
},
26+
),
27+
header: options.ToHeader(),
28+
}
29+
}
30+
31+
func (r *RawClient) Get(
32+
ctx context.Context,
33+
request *server.AnalyticsQueryDto,
34+
opts ...option.RequestOption,
35+
) (*core.Response[[]*server.AnalyticsQueryResult], error) {
36+
options := core.NewRequestOptions(opts...)
37+
baseURL := internal.ResolveBaseURL(
38+
options.BaseURL,
39+
r.baseURL,
40+
"https://api.vapi.ai",
41+
)
42+
endpointURL := baseURL + "/analytics"
43+
headers := internal.MergeHeaders(
44+
r.header.Clone(),
45+
options.ToHeader(),
46+
)
47+
headers.Add("Content-Type", "application/json")
48+
var response []*server.AnalyticsQueryResult
49+
raw, err := r.caller.Call(
50+
ctx,
51+
&internal.CallParams{
52+
URL: endpointURL,
53+
Method: http.MethodPost,
54+
Headers: headers,
55+
MaxAttempts: options.MaxAttempts,
56+
BodyProperties: options.BodyProperties,
57+
QueryParameters: options.QueryParameters,
58+
Client: options.HTTPClient,
59+
Request: request,
60+
Response: &response,
61+
},
62+
)
63+
if err != nil {
64+
return nil, err
65+
}
66+
return &core.Response[[]*server.AnalyticsQueryResult]{
67+
StatusCode: raw.StatusCode,
68+
Header: raw.Header,
69+
Body: response,
70+
}, nil
71+
}

assistants.go

Lines changed: 85 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)