@@ -4,14 +4,15 @@ package svix
4
4
import (
5
5
"context"
6
6
7
+ "github.com/svix/svix-webhooks/go/internal"
7
8
"github.com/svix/svix-webhooks/go/models"
8
9
)
9
10
10
11
type Application struct {
11
- client * SvixHttpClient
12
+ client * internal. SvixHttpClient
12
13
}
13
14
14
- func newApplication (client * SvixHttpClient ) * Application {
15
+ func newApplication (client * internal. SvixHttpClient ) * Application {
15
16
return & Application {
16
17
client : client ,
17
18
}
@@ -39,14 +40,14 @@ func (application *Application) List(
39
40
queryMap := map [string ]string {}
40
41
var err error
41
42
if o != nil {
42
- serializeParamToMap ("limit" , o .Limit , queryMap , & err )
43
- serializeParamToMap ("iterator" , o .Iterator , queryMap , & err )
44
- serializeParamToMap ("order" , o .Order , queryMap , & err )
43
+ internal . SerializeParamToMap ("limit" , o .Limit , queryMap , & err )
44
+ internal . SerializeParamToMap ("iterator" , o .Iterator , queryMap , & err )
45
+ internal . SerializeParamToMap ("order" , o .Order , queryMap , & err )
45
46
if err != nil {
46
47
return nil , err
47
48
}
48
49
}
49
- return executeRequest [any , models.ListResponseApplicationOut ](
50
+ return internal . ExecuteRequest [any , models.ListResponseApplicationOut ](
50
51
ctx ,
51
52
application .client ,
52
53
"GET" ,
@@ -70,12 +71,12 @@ func (application *Application) Create(
70
71
headerMap := map [string ]string {}
71
72
var err error
72
73
if o != nil {
73
- serializeParamToMap ("idempotency-key" , o .IdempotencyKey , headerMap , & err )
74
+ internal . SerializeParamToMap ("idempotency-key" , o .IdempotencyKey , headerMap , & err )
74
75
if err != nil {
75
76
return nil , err
76
77
}
77
78
}
78
- return executeRequest [models.ApplicationIn , models.ApplicationOut ](
79
+ return internal . ExecuteRequest [models.ApplicationIn , models.ApplicationOut ](
79
80
ctx ,
80
81
application .client ,
81
82
"POST" ,
@@ -100,13 +101,13 @@ func (application *Application) GetOrCreate(
100
101
101
102
var err error
102
103
if o != nil {
103
- serializeParamToMap ("idempotency-key" , o .IdempotencyKey , headerMap , & err )
104
+ internal . SerializeParamToMap ("idempotency-key" , o .IdempotencyKey , headerMap , & err )
104
105
if err != nil {
105
106
return nil , err
106
107
}
107
108
}
108
109
109
- return executeRequest [models.ApplicationIn , models.ApplicationOut ](
110
+ return internal . ExecuteRequest [models.ApplicationIn , models.ApplicationOut ](
110
111
ctx ,
111
112
application .client ,
112
113
"POST" ,
@@ -126,7 +127,7 @@ func (application *Application) Get(
126
127
pathMap := map [string ]string {
127
128
"app_id" : appId ,
128
129
}
129
- return executeRequest [any , models.ApplicationOut ](
130
+ return internal . ExecuteRequest [any , models.ApplicationOut ](
130
131
ctx ,
131
132
application .client ,
132
133
"GET" ,
@@ -147,7 +148,7 @@ func (application *Application) Update(
147
148
pathMap := map [string ]string {
148
149
"app_id" : appId ,
149
150
}
150
- return executeRequest [models.ApplicationIn , models.ApplicationOut ](
151
+ return internal . ExecuteRequest [models.ApplicationIn , models.ApplicationOut ](
151
152
ctx ,
152
153
application .client ,
153
154
"PUT" ,
@@ -167,7 +168,7 @@ func (application *Application) Delete(
167
168
pathMap := map [string ]string {
168
169
"app_id" : appId ,
169
170
}
170
- _ , err := executeRequest [any , any ](
171
+ _ , err := internal . ExecuteRequest [any , any ](
171
172
ctx ,
172
173
application .client ,
173
174
"DELETE" ,
@@ -189,7 +190,7 @@ func (application *Application) Patch(
189
190
pathMap := map [string ]string {
190
191
"app_id" : appId ,
191
192
}
192
- return executeRequest [models.ApplicationPatch , models.ApplicationOut ](
193
+ return internal . ExecuteRequest [models.ApplicationPatch , models.ApplicationOut ](
193
194
ctx ,
194
195
application .client ,
195
196
"PATCH" ,
0 commit comments