@@ -28,18 +28,19 @@ public IngestEndpoint(SvixHttpClient client) {
28
28
}
29
29
30
30
/** List ingest endpoints. */
31
- public ListResponseIngestEndpointOut list () throws IOException , ApiException {
32
-
33
- return this .list (new IngestEndpointListOptions ());
31
+ public ListResponseIngestEndpointOut list (final String sourceId )
32
+ throws IOException , ApiException {
33
+ return this .list (sourceId , new IngestEndpointListOptions ());
34
34
}
35
35
36
36
/** List ingest endpoints. */
37
- public ListResponseIngestEndpointOut list (final IngestEndpointListOptions options )
37
+ public ListResponseIngestEndpointOut list (
38
+ final String sourceId , final IngestEndpointListOptions options )
38
39
throws IOException , ApiException {
39
40
HttpUrl .Builder url =
40
41
this .client
41
42
.newUrlBuilder ()
42
- .encodedPath ("/ingest/api/v1/source/{source_id} /endpoint" );
43
+ .encodedPath (String . format ( "/ingest/api/v1/source/%s /endpoint" , sourceId ) );
43
44
if (options .limit != null ) {
44
45
url .addQueryParameter ("limit" , Utils .serializeQueryParam (options .limit ));
45
46
}
@@ -54,19 +55,21 @@ public ListResponseIngestEndpointOut list(final IngestEndpointListOptions option
54
55
}
55
56
56
57
/** Create an ingest endpoint. */
57
- public IngestEndpointOut create (final IngestEndpointIn ingestEndpointIn )
58
+ public IngestEndpointOut create (final String sourceId , final IngestEndpointIn ingestEndpointIn )
58
59
throws IOException , ApiException {
59
- return this .create (ingestEndpointIn , new IngestEndpointCreateOptions ());
60
+ return this .create (sourceId , ingestEndpointIn , new IngestEndpointCreateOptions ());
60
61
}
61
62
62
63
/** Create an ingest endpoint. */
63
64
public IngestEndpointOut create (
64
- final IngestEndpointIn ingestEndpointIn , final IngestEndpointCreateOptions options )
65
+ final String sourceId ,
66
+ final IngestEndpointIn ingestEndpointIn ,
67
+ final IngestEndpointCreateOptions options )
65
68
throws IOException , ApiException {
66
69
HttpUrl .Builder url =
67
70
this .client
68
71
.newUrlBuilder ()
69
- .encodedPath ("/ingest/api/v1/source/{source_id} /endpoint" );
72
+ .encodedPath (String . format ( "/ingest/api/v1/source/%s /endpoint" , sourceId ) );
70
73
Map <String , String > headers = new HashMap <>();
71
74
if (options .idempotencyKey != null ) {
72
75
headers .put ("idempotency-key" , options .idempotencyKey );
@@ -80,69 +83,75 @@ public IngestEndpointOut create(
80
83
}
81
84
82
85
/** Get an ingest endpoint. */
83
- public IngestEndpointOut get (final String endpointId ) throws IOException , ApiException {
86
+ public IngestEndpointOut get (final String sourceId , final String endpointId )
87
+ throws IOException , ApiException {
84
88
HttpUrl .Builder url =
85
89
this .client
86
90
.newUrlBuilder ()
87
91
.encodedPath (
88
92
String .format (
89
- "/ingest/api/v1/source/{source_id} /endpoint/%s" ,
90
- endpointId ));
93
+ "/ingest/api/v1/source/%s /endpoint/%s" ,
94
+ sourceId , endpointId ));
91
95
return this .client .executeRequest ("GET" , url .build (), null , null , IngestEndpointOut .class );
92
96
}
93
97
94
98
/** Update an ingest endpoint. */
95
99
public IngestEndpointOut update (
96
- final String endpointId , final IngestEndpointUpdate ingestEndpointUpdate )
100
+ final String sourceId ,
101
+ final String endpointId ,
102
+ final IngestEndpointUpdate ingestEndpointUpdate )
97
103
throws IOException , ApiException {
98
104
HttpUrl .Builder url =
99
105
this .client
100
106
.newUrlBuilder ()
101
107
.encodedPath (
102
108
String .format (
103
- "/ingest/api/v1/source/{source_id} /endpoint/%s" ,
104
- endpointId ));
109
+ "/ingest/api/v1/source/%s /endpoint/%s" ,
110
+ sourceId , endpointId ));
105
111
return this .client .executeRequest (
106
112
"PUT" , url .build (), null , ingestEndpointUpdate , IngestEndpointOut .class );
107
113
}
108
114
109
115
/** Delete an ingest endpoint. */
110
- public void delete (final String endpointId ) throws IOException , ApiException {
116
+ public void delete (final String sourceId , final String endpointId )
117
+ throws IOException , ApiException {
111
118
HttpUrl .Builder url =
112
119
this .client
113
120
.newUrlBuilder ()
114
121
.encodedPath (
115
122
String .format (
116
- "/ingest/api/v1/source/{source_id} /endpoint/%s" ,
117
- endpointId ));
123
+ "/ingest/api/v1/source/%s /endpoint/%s" ,
124
+ sourceId , endpointId ));
118
125
this .client .executeRequest ("DELETE" , url .build (), null , null , null );
119
126
}
120
127
121
128
/** Get the additional headers to be sent with the ingest. */
122
- public IngestEndpointHeadersOut getHeaders (final String endpointId )
129
+ public IngestEndpointHeadersOut getHeaders (final String sourceId , final String endpointId )
123
130
throws IOException , ApiException {
124
131
HttpUrl .Builder url =
125
132
this .client
126
133
.newUrlBuilder ()
127
134
.encodedPath (
128
135
String .format (
129
- "/ingest/api/v1/source/{source_id} /endpoint/%s/headers" ,
130
- endpointId ));
136
+ "/ingest/api/v1/source/%s /endpoint/%s/headers" ,
137
+ sourceId , endpointId ));
131
138
return this .client .executeRequest (
132
139
"GET" , url .build (), null , null , IngestEndpointHeadersOut .class );
133
140
}
134
141
135
142
/** Set the additional headers to be sent to the endpoint. */
136
143
public void updateHeaders (
137
- final String endpointId , final IngestEndpointHeadersIn ingestEndpointHeadersIn )
144
+ final String sourceId ,
145
+ final String endpointId ,
146
+ final IngestEndpointHeadersIn ingestEndpointHeadersIn )
138
147
throws IOException , ApiException {
139
148
HttpUrl .Builder url =
140
149
this .client
141
150
.newUrlBuilder ()
142
151
.encodedPath (
143
152
String .format (
144
- "/ingest/api/v1/source/{source_id} /endpoint/%s/headers" ,
145
- endpointId ));
153
+ "/ingest/api/v1/source/%s /endpoint/%s/headers" ,
154
+ sourceId , endpointId ));
146
155
this .client .executeRequest ("PUT" , url .build (), null , ingestEndpointHeadersIn , null );
147
156
}
148
157
@@ -152,15 +161,15 @@ public void updateHeaders(
152
161
* <p>This is used to verify the authenticity of the webhook. For more information please refer
153
162
* to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
154
163
*/
155
- public IngestEndpointSecretOut getSecret (final String endpointId )
164
+ public IngestEndpointSecretOut getSecret (final String sourceId , final String endpointId )
156
165
throws IOException , ApiException {
157
166
HttpUrl .Builder url =
158
167
this .client
159
168
.newUrlBuilder ()
160
169
.encodedPath (
161
170
String .format (
162
- "/ingest/api/v1/source/{source_id} /endpoint/%s/secret" ,
163
- endpointId ));
171
+ "/ingest/api/v1/source/%s /endpoint/%s/secret" ,
172
+ sourceId , endpointId ));
164
173
return this .client .executeRequest (
165
174
"GET" , url .build (), null , null , IngestEndpointSecretOut .class );
166
175
}
@@ -171,10 +180,15 @@ public IngestEndpointSecretOut getSecret(final String endpointId)
171
180
* <p>The previous secret will remain valid for the next 24 hours.
172
181
*/
173
182
public void rotateSecret (
174
- final String endpointId , final IngestEndpointSecretIn ingestEndpointSecretIn )
183
+ final String sourceId ,
184
+ final String endpointId ,
185
+ final IngestEndpointSecretIn ingestEndpointSecretIn )
175
186
throws IOException , ApiException {
176
187
this .rotateSecret (
177
- endpointId , ingestEndpointSecretIn , new IngestEndpointRotateSecretOptions ());
188
+ sourceId ,
189
+ endpointId ,
190
+ ingestEndpointSecretIn ,
191
+ new IngestEndpointRotateSecretOptions ());
178
192
}
179
193
180
194
/**
@@ -183,6 +197,7 @@ public void rotateSecret(
183
197
* <p>The previous secret will remain valid for the next 24 hours.
184
198
*/
185
199
public void rotateSecret (
200
+ final String sourceId ,
186
201
final String endpointId ,
187
202
final IngestEndpointSecretIn ingestEndpointSecretIn ,
188
203
final IngestEndpointRotateSecretOptions options )
@@ -192,8 +207,8 @@ public void rotateSecret(
192
207
.newUrlBuilder ()
193
208
.encodedPath (
194
209
String .format (
195
- "/ingest/api/v1/source/{source_id} /endpoint/%s/secret/rotate" ,
196
- endpointId ));
210
+ "/ingest/api/v1/source/%s /endpoint/%s/secret/rotate" ,
211
+ sourceId , endpointId ));
197
212
Map <String , String > headers = new HashMap <>();
198
213
if (options .idempotencyKey != null ) {
199
214
headers .put ("idempotency-key" , options .idempotencyKey );
0 commit comments