diff --git a/csharp/Svix/IngestEndpoint.cs b/csharp/Svix/IngestEndpoint.cs index 71e295ba4..277602d69 100644 --- a/csharp/Svix/IngestEndpoint.cs +++ b/csharp/Svix/IngestEndpoint.cs @@ -56,6 +56,7 @@ public class IngestEndpoint(SvixClient client) /// List ingest endpoints. /// public async Task ListAsync( + string sourceId, IngestEndpointListOptions? options = null, CancellationToken cancellationToken = default ) @@ -66,6 +67,7 @@ public async Task ListAsync( await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint", + pathParams: new Dictionary { { "source_id", sourceId } }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams(), cancellationToken: cancellationToken @@ -83,13 +85,17 @@ await _client.SvixHttpClient.SendRequestAsync( /// /// List ingest endpoints. /// - public ListResponseIngestEndpointOut List(IngestEndpointListOptions? options = null) + public ListResponseIngestEndpointOut List( + string sourceId, + IngestEndpointListOptions? options = null + ) { try { var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint", + pathParams: new Dictionary { { "source_id", sourceId } }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams() ); @@ -107,6 +113,7 @@ public ListResponseIngestEndpointOut List(IngestEndpointListOptions? options = n /// Create an ingest endpoint. /// public async Task CreateAsync( + string sourceId, IngestEndpointIn ingestEndpointIn, IngestEndpointCreateOptions? options = null, CancellationToken cancellationToken = default @@ -119,6 +126,7 @@ public async Task CreateAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Post, path: "/ingest/api/v1/source/{source_id}/endpoint", + pathParams: new Dictionary { { "source_id", sourceId } }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams(), content: ingestEndpointIn, @@ -138,6 +146,7 @@ public async Task CreateAsync( /// Create an ingest endpoint. /// public IngestEndpointOut Create( + string sourceId, IngestEndpointIn ingestEndpointIn, IngestEndpointCreateOptions? options = null ) @@ -149,6 +158,7 @@ public IngestEndpointOut Create( var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Post, path: "/ingest/api/v1/source/{source_id}/endpoint", + pathParams: new Dictionary { { "source_id", sourceId } }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams(), content: ingestEndpointIn @@ -167,6 +177,7 @@ public IngestEndpointOut Create( /// Get an ingest endpoint. /// public async Task GetAsync( + string sourceId, string endpointId, CancellationToken cancellationToken = default ) @@ -176,7 +187,11 @@ public async Task GetAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, cancellationToken: cancellationToken ); return response.Data; @@ -192,14 +207,18 @@ public async Task GetAsync( /// /// Get an ingest endpoint. /// - public IngestEndpointOut Get(string endpointId) + public IngestEndpointOut Get(string sourceId, string endpointId) { try { var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } } + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + } ); return response.Data; } @@ -215,6 +234,7 @@ public IngestEndpointOut Get(string endpointId) /// Update an ingest endpoint. /// public async Task UpdateAsync( + string sourceId, string endpointId, IngestEndpointUpdate ingestEndpointUpdate, CancellationToken cancellationToken = default @@ -228,7 +248,11 @@ public async Task UpdateAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Put, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, content: ingestEndpointUpdate, cancellationToken: cancellationToken ); @@ -246,6 +270,7 @@ public async Task UpdateAsync( /// Update an ingest endpoint. /// public IngestEndpointOut Update( + string sourceId, string endpointId, IngestEndpointUpdate ingestEndpointUpdate ) @@ -258,7 +283,11 @@ IngestEndpointUpdate ingestEndpointUpdate var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Put, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, content: ingestEndpointUpdate ); return response.Data; @@ -275,6 +304,7 @@ IngestEndpointUpdate ingestEndpointUpdate /// Delete an ingest endpoint. /// public async Task DeleteAsync( + string sourceId, string endpointId, CancellationToken cancellationToken = default ) @@ -284,7 +314,11 @@ public async Task DeleteAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Delete, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, cancellationToken: cancellationToken ); return response.Data; @@ -300,14 +334,18 @@ public async Task DeleteAsync( /// /// Delete an ingest endpoint. /// - public bool Delete(string endpointId) + public bool Delete(string sourceId, string endpointId) { try { var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Delete, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", - pathParams: new Dictionary { { "endpoint_id", endpointId } } + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + } ); return response.Data; } @@ -323,6 +361,7 @@ public bool Delete(string endpointId) /// Get the additional headers to be sent with the ingest. /// public async Task GetHeadersAsync( + string sourceId, string endpointId, CancellationToken cancellationToken = default ) @@ -335,6 +374,7 @@ await _client.SvixHttpClient.SendRequestAsync( path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", pathParams: new Dictionary { + { "source_id", sourceId }, { "endpoint_id", endpointId }, }, cancellationToken: cancellationToken @@ -352,14 +392,18 @@ await _client.SvixHttpClient.SendRequestAsync( /// /// Get the additional headers to be sent with the ingest. /// - public IngestEndpointHeadersOut GetHeaders(string endpointId) + public IngestEndpointHeadersOut GetHeaders(string sourceId, string endpointId) { try { var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", - pathParams: new Dictionary { { "endpoint_id", endpointId } } + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + } ); return response.Data; } @@ -375,6 +419,7 @@ public IngestEndpointHeadersOut GetHeaders(string endpointId) /// Set the additional headers to be sent to the endpoint. /// public async Task UpdateHeadersAsync( + string sourceId, string endpointId, IngestEndpointHeadersIn ingestEndpointHeadersIn, CancellationToken cancellationToken = default @@ -388,7 +433,11 @@ public async Task UpdateHeadersAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Put, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, content: ingestEndpointHeadersIn, cancellationToken: cancellationToken ); @@ -406,6 +455,7 @@ public async Task UpdateHeadersAsync( /// Set the additional headers to be sent to the endpoint. /// public bool UpdateHeaders( + string sourceId, string endpointId, IngestEndpointHeadersIn ingestEndpointHeadersIn ) @@ -418,7 +468,11 @@ IngestEndpointHeadersIn ingestEndpointHeadersIn var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Put, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, content: ingestEndpointHeadersIn ); return response.Data; @@ -438,6 +492,7 @@ IngestEndpointHeadersIn ingestEndpointHeadersIn /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). /// public async Task GetSecretAsync( + string sourceId, string endpointId, CancellationToken cancellationToken = default ) @@ -450,6 +505,7 @@ await _client.SvixHttpClient.SendRequestAsync( path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", pathParams: new Dictionary { + { "source_id", sourceId }, { "endpoint_id", endpointId }, }, cancellationToken: cancellationToken @@ -470,14 +526,18 @@ await _client.SvixHttpClient.SendRequestAsync( /// This is used to verify the authenticity of the webhook. /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). /// - public IngestEndpointSecretOut GetSecret(string endpointId) + public IngestEndpointSecretOut GetSecret(string sourceId, string endpointId) { try { var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Get, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", - pathParams: new Dictionary { { "endpoint_id", endpointId } } + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + } ); return response.Data; } @@ -495,6 +555,7 @@ public IngestEndpointSecretOut GetSecret(string endpointId) /// The previous secret will remain valid for the next 24 hours. /// public async Task RotateSecretAsync( + string sourceId, string endpointId, IngestEndpointSecretIn ingestEndpointSecretIn, IngestEndpointRotateSecretOptions? options = null, @@ -509,7 +570,11 @@ public async Task RotateSecretAsync( var response = await _client.SvixHttpClient.SendRequestAsync( method: HttpMethod.Post, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams(), content: ingestEndpointSecretIn, @@ -531,6 +596,7 @@ public async Task RotateSecretAsync( /// The previous secret will remain valid for the next 24 hours. /// public bool RotateSecret( + string sourceId, string endpointId, IngestEndpointSecretIn ingestEndpointSecretIn, IngestEndpointRotateSecretOptions? options = null @@ -544,7 +610,11 @@ public bool RotateSecret( var response = _client.SvixHttpClient.SendRequest( method: HttpMethod.Post, path: "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", - pathParams: new Dictionary { { "endpoint_id", endpointId } }, + pathParams: new Dictionary + { + { "source_id", sourceId }, + { "endpoint_id", endpointId }, + }, queryParams: options?.QueryParams(), headerParams: options?.HeaderParams(), content: ingestEndpointSecretIn diff --git a/go/ingest_endpoint.go b/go/ingest_endpoint.go index 8c8abe85a..eaeb43b68 100644 --- a/go/ingest_endpoint.go +++ b/go/ingest_endpoint.go @@ -39,8 +39,12 @@ type IngestEndpointRotateSecretOptions struct { // List ingest endpoints. func (ingestEndpoint *IngestEndpoint) List( ctx context.Context, + sourceId string, o *IngestEndpointListOptions, ) (*models.ListResponseIngestEndpointOut, error) { + pathMap := map[string]string{ + "source_id": sourceId, + } queryMap := map[string]string{} var err error if o != nil { @@ -56,7 +60,7 @@ func (ingestEndpoint *IngestEndpoint) List( ingestEndpoint.client, "GET", "/ingest/api/v1/source/{source_id}/endpoint", - nil, + pathMap, queryMap, nil, nil, @@ -66,9 +70,13 @@ func (ingestEndpoint *IngestEndpoint) List( // Create an ingest endpoint. func (ingestEndpoint *IngestEndpoint) Create( ctx context.Context, + sourceId string, ingestEndpointIn models.IngestEndpointIn, o *IngestEndpointCreateOptions, ) (*models.IngestEndpointOut, error) { + pathMap := map[string]string{ + "source_id": sourceId, + } headerMap := map[string]string{} var err error if o != nil { @@ -82,7 +90,7 @@ func (ingestEndpoint *IngestEndpoint) Create( ingestEndpoint.client, "POST", "/ingest/api/v1/source/{source_id}/endpoint", - nil, + pathMap, nil, headerMap, &ingestEndpointIn, @@ -92,9 +100,11 @@ func (ingestEndpoint *IngestEndpoint) Create( // Get an ingest endpoint. func (ingestEndpoint *IngestEndpoint) Get( ctx context.Context, + sourceId string, endpointId string, ) (*models.IngestEndpointOut, error) { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } return internal.ExecuteRequest[any, models.IngestEndpointOut]( @@ -112,10 +122,12 @@ func (ingestEndpoint *IngestEndpoint) Get( // Update an ingest endpoint. func (ingestEndpoint *IngestEndpoint) Update( ctx context.Context, + sourceId string, endpointId string, ingestEndpointUpdate models.IngestEndpointUpdate, ) (*models.IngestEndpointOut, error) { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } return internal.ExecuteRequest[models.IngestEndpointUpdate, models.IngestEndpointOut]( @@ -133,9 +145,11 @@ func (ingestEndpoint *IngestEndpoint) Update( // Delete an ingest endpoint. func (ingestEndpoint *IngestEndpoint) Delete( ctx context.Context, + sourceId string, endpointId string, ) error { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } _, err := internal.ExecuteRequest[any, any]( @@ -154,9 +168,11 @@ func (ingestEndpoint *IngestEndpoint) Delete( // Get the additional headers to be sent with the ingest. func (ingestEndpoint *IngestEndpoint) GetHeaders( ctx context.Context, + sourceId string, endpointId string, ) (*models.IngestEndpointHeadersOut, error) { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } return internal.ExecuteRequest[any, models.IngestEndpointHeadersOut]( @@ -174,10 +190,12 @@ func (ingestEndpoint *IngestEndpoint) GetHeaders( // Set the additional headers to be sent to the endpoint. func (ingestEndpoint *IngestEndpoint) UpdateHeaders( ctx context.Context, + sourceId string, endpointId string, ingestEndpointHeadersIn models.IngestEndpointHeadersIn, ) error { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } _, err := internal.ExecuteRequest[models.IngestEndpointHeadersIn, any]( @@ -199,9 +217,11 @@ func (ingestEndpoint *IngestEndpoint) UpdateHeaders( // For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). func (ingestEndpoint *IngestEndpoint) GetSecret( ctx context.Context, + sourceId string, endpointId string, ) (*models.IngestEndpointSecretOut, error) { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } return internal.ExecuteRequest[any, models.IngestEndpointSecretOut]( @@ -221,11 +241,13 @@ func (ingestEndpoint *IngestEndpoint) GetSecret( // The previous secret will remain valid for the next 24 hours. func (ingestEndpoint *IngestEndpoint) RotateSecret( ctx context.Context, + sourceId string, endpointId string, ingestEndpointSecretIn models.IngestEndpointSecretIn, o *IngestEndpointRotateSecretOptions, ) error { pathMap := map[string]string{ + "source_id": sourceId, "endpoint_id": endpointId, } headerMap := map[string]string{} diff --git a/java/lib/src/main/java/com/svix/api/IngestEndpoint.java b/java/lib/src/main/java/com/svix/api/IngestEndpoint.java index 368f6b1a9..86d376679 100644 --- a/java/lib/src/main/java/com/svix/api/IngestEndpoint.java +++ b/java/lib/src/main/java/com/svix/api/IngestEndpoint.java @@ -28,18 +28,19 @@ public IngestEndpoint(SvixHttpClient client) { } /** List ingest endpoints. */ - public ListResponseIngestEndpointOut list() throws IOException, ApiException { - - return this.list(new IngestEndpointListOptions()); + public ListResponseIngestEndpointOut list(final String sourceId) + throws IOException, ApiException { + return this.list(sourceId, new IngestEndpointListOptions()); } /** List ingest endpoints. */ - public ListResponseIngestEndpointOut list(final IngestEndpointListOptions options) + public ListResponseIngestEndpointOut list( + final String sourceId, final IngestEndpointListOptions options) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint"); + .encodedPath(String.format("/ingest/api/v1/source/%s/endpoint", sourceId)); if (options.limit != null) { url.addQueryParameter("limit", Utils.serializeQueryParam(options.limit)); } @@ -54,19 +55,21 @@ public ListResponseIngestEndpointOut list(final IngestEndpointListOptions option } /** Create an ingest endpoint. */ - public IngestEndpointOut create(final IngestEndpointIn ingestEndpointIn) + public IngestEndpointOut create(final String sourceId, final IngestEndpointIn ingestEndpointIn) throws IOException, ApiException { - return this.create(ingestEndpointIn, new IngestEndpointCreateOptions()); + return this.create(sourceId, ingestEndpointIn, new IngestEndpointCreateOptions()); } /** Create an ingest endpoint. */ public IngestEndpointOut create( - final IngestEndpointIn ingestEndpointIn, final IngestEndpointCreateOptions options) + final String sourceId, + final IngestEndpointIn ingestEndpointIn, + final IngestEndpointCreateOptions options) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint"); + .encodedPath(String.format("/ingest/api/v1/source/%s/endpoint", sourceId)); Map headers = new HashMap<>(); if (options.idempotencyKey != null) { headers.put("idempotency-key", options.idempotencyKey); @@ -80,69 +83,75 @@ public IngestEndpointOut create( } /** Get an ingest endpoint. */ - public IngestEndpointOut get(final String endpointId) throws IOException, ApiException { + public IngestEndpointOut get(final String sourceId, final String endpointId) + throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s", + sourceId, endpointId)); return this.client.executeRequest("GET", url.build(), null, null, IngestEndpointOut.class); } /** Update an ingest endpoint. */ public IngestEndpointOut update( - final String endpointId, final IngestEndpointUpdate ingestEndpointUpdate) + final String sourceId, + final String endpointId, + final IngestEndpointUpdate ingestEndpointUpdate) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s", + sourceId, endpointId)); return this.client.executeRequest( "PUT", url.build(), null, ingestEndpointUpdate, IngestEndpointOut.class); } /** Delete an ingest endpoint. */ - public void delete(final String endpointId) throws IOException, ApiException { + public void delete(final String sourceId, final String endpointId) + throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s", + sourceId, endpointId)); this.client.executeRequest("DELETE", url.build(), null, null, null); } /** Get the additional headers to be sent with the ingest. */ - public IngestEndpointHeadersOut getHeaders(final String endpointId) + public IngestEndpointHeadersOut getHeaders(final String sourceId, final String endpointId) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s/headers", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s/headers", + sourceId, endpointId)); return this.client.executeRequest( "GET", url.build(), null, null, IngestEndpointHeadersOut.class); } /** Set the additional headers to be sent to the endpoint. */ public void updateHeaders( - final String endpointId, final IngestEndpointHeadersIn ingestEndpointHeadersIn) + final String sourceId, + final String endpointId, + final IngestEndpointHeadersIn ingestEndpointHeadersIn) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s/headers", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s/headers", + sourceId, endpointId)); this.client.executeRequest("PUT", url.build(), null, ingestEndpointHeadersIn, null); } @@ -152,15 +161,15 @@ public void updateHeaders( *

This is used to verify the authenticity of the webhook. For more information please refer * to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). */ - public IngestEndpointSecretOut getSecret(final String endpointId) + public IngestEndpointSecretOut getSecret(final String sourceId, final String endpointId) throws IOException, ApiException { HttpUrl.Builder url = this.client .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s/secret", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s/secret", + sourceId, endpointId)); return this.client.executeRequest( "GET", url.build(), null, null, IngestEndpointSecretOut.class); } @@ -171,10 +180,15 @@ public IngestEndpointSecretOut getSecret(final String endpointId) *

The previous secret will remain valid for the next 24 hours. */ public void rotateSecret( - final String endpointId, final IngestEndpointSecretIn ingestEndpointSecretIn) + final String sourceId, + final String endpointId, + final IngestEndpointSecretIn ingestEndpointSecretIn) throws IOException, ApiException { this.rotateSecret( - endpointId, ingestEndpointSecretIn, new IngestEndpointRotateSecretOptions()); + sourceId, + endpointId, + ingestEndpointSecretIn, + new IngestEndpointRotateSecretOptions()); } /** @@ -183,6 +197,7 @@ public void rotateSecret( *

The previous secret will remain valid for the next 24 hours. */ public void rotateSecret( + final String sourceId, final String endpointId, final IngestEndpointSecretIn ingestEndpointSecretIn, final IngestEndpointRotateSecretOptions options) @@ -192,8 +207,8 @@ public void rotateSecret( .newUrlBuilder() .encodedPath( String.format( - "/ingest/api/v1/source/{source_id}/endpoint/%s/secret/rotate", - endpointId)); + "/ingest/api/v1/source/%s/endpoint/%s/secret/rotate", + sourceId, endpointId)); Map headers = new HashMap<>(); if (options.idempotencyKey != null) { headers.put("idempotency-key", options.idempotencyKey); diff --git a/javascript/src/api/ingestEndpoint.ts b/javascript/src/api/ingestEndpoint.ts index 297d2ed43..146ececdd 100644 --- a/javascript/src/api/ingestEndpoint.ts +++ b/javascript/src/api/ingestEndpoint.ts @@ -53,6 +53,7 @@ export class IngestEndpoint { /** List ingest endpoints. */ public list( + sourceId: string, options?: IngestEndpointListOptions ): Promise { const request = new SvixRequest( @@ -60,6 +61,7 @@ export class IngestEndpoint { "/ingest/api/v1/source/{source_id}/endpoint" ); + request.setPathParam("source_id", sourceId); request.setQueryParam("limit", options?.limit); request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); @@ -72,6 +74,7 @@ export class IngestEndpoint { /** Create an ingest endpoint. */ public create( + sourceId: string, ingestEndpointIn: IngestEndpointIn, options?: IngestEndpointCreateOptions ): Promise { @@ -80,6 +83,7 @@ export class IngestEndpoint { "/ingest/api/v1/source/{source_id}/endpoint" ); + request.setPathParam("source_id", sourceId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); request.setBody(IngestEndpointInSerializer._toJsonObject(ingestEndpointIn)); @@ -87,12 +91,13 @@ export class IngestEndpoint { } /** Get an ingest endpoint. */ - public get(endpointId: string): Promise { + public get(sourceId: string, endpointId: string): Promise { const request = new SvixRequest( HttpMethod.GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject); @@ -100,6 +105,7 @@ export class IngestEndpoint { /** Update an ingest endpoint. */ public update( + sourceId: string, endpointId: string, ingestEndpointUpdate: IngestEndpointUpdate ): Promise { @@ -108,6 +114,7 @@ export class IngestEndpoint { "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); request.setBody(IngestEndpointUpdateSerializer._toJsonObject(ingestEndpointUpdate)); @@ -115,24 +122,29 @@ export class IngestEndpoint { } /** Delete an ingest endpoint. */ - public delete(endpointId: string): Promise { + public delete(sourceId: string, endpointId: string): Promise { const request = new SvixRequest( HttpMethod.DELETE, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); return request.sendNoResponseBody(this.requestCtx); } /** Get the additional headers to be sent with the ingest. */ - public getHeaders(endpointId: string): Promise { + public getHeaders( + sourceId: string, + endpointId: string + ): Promise { const request = new SvixRequest( HttpMethod.GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); return request.send( @@ -143,6 +155,7 @@ export class IngestEndpoint { /** Set the additional headers to be sent to the endpoint. */ public updateHeaders( + sourceId: string, endpointId: string, ingestEndpointHeadersIn: IngestEndpointHeadersIn ): Promise { @@ -151,6 +164,7 @@ export class IngestEndpoint { "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); request.setBody( IngestEndpointHeadersInSerializer._toJsonObject(ingestEndpointHeadersIn) @@ -165,12 +179,16 @@ export class IngestEndpoint { * This is used to verify the authenticity of the webhook. * For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). */ - public getSecret(endpointId: string): Promise { + public getSecret( + sourceId: string, + endpointId: string + ): Promise { const request = new SvixRequest( HttpMethod.GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); return request.send( @@ -185,6 +203,7 @@ export class IngestEndpoint { * The previous secret will remain valid for the next 24 hours. */ public rotateSecret( + sourceId: string, endpointId: string, ingestEndpointSecretIn: IngestEndpointSecretIn, options?: IngestEndpointRotateSecretOptions @@ -194,6 +213,7 @@ export class IngestEndpoint { "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate" ); + request.setPathParam("source_id", sourceId); request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); request.setBody( diff --git a/kotlin/lib/src/main/kotlin/IngestEndpoint.kt b/kotlin/lib/src/main/kotlin/IngestEndpoint.kt index 4f613465f..8f350bfa9 100644 --- a/kotlin/lib/src/main/kotlin/IngestEndpoint.kt +++ b/kotlin/lib/src/main/kotlin/IngestEndpoint.kt @@ -28,9 +28,10 @@ data class IngestEndpointRotateSecretOptions(val idempotencyKey: String? = null) class IngestEndpoint(private val client: SvixHttpClient) { /** List ingest endpoints. */ suspend fun list( - options: IngestEndpointListOptions = IngestEndpointListOptions() + sourceId: String, + options: IngestEndpointListOptions = IngestEndpointListOptions(), ): ListResponseIngestEndpointOut { - val url = client.newUrlBuilder().encodedPath("/ingest/api/v1/source/{source_id}/endpoint") + val url = client.newUrlBuilder().encodedPath("/ingest/api/v1/source/$sourceId/endpoint") options.limit?.let { url.addQueryParameter("limit", serializeQueryParam(it)) } options.iterator?.let { url.addQueryParameter("iterator", it) } options.order?.let { url.addQueryParameter("order", serializeQueryParam(it)) } @@ -39,10 +40,11 @@ class IngestEndpoint(private val client: SvixHttpClient) { /** Create an ingest endpoint. */ suspend fun create( + sourceId: String, ingestEndpointIn: IngestEndpointIn, options: IngestEndpointCreateOptions = IngestEndpointCreateOptions(), ): IngestEndpointOut { - val url = client.newUrlBuilder().encodedPath("/ingest/api/v1/source/{source_id}/endpoint") + val url = client.newUrlBuilder().encodedPath("/ingest/api/v1/source/$sourceId/endpoint") val headers = Headers.Builder() options.idempotencyKey?.let { headers.add("idempotency-key", it) } @@ -55,23 +57,24 @@ class IngestEndpoint(private val client: SvixHttpClient) { } /** Get an ingest endpoint. */ - suspend fun get(endpointId: String): IngestEndpointOut { + suspend fun get(sourceId: String, endpointId: String): IngestEndpointOut { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId") return client.executeRequest("GET", url.build()) } /** Update an ingest endpoint. */ suspend fun update( + sourceId: String, endpointId: String, ingestEndpointUpdate: IngestEndpointUpdate, ): IngestEndpointOut { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId") return client.executeRequest( "PUT", @@ -81,32 +84,33 @@ class IngestEndpoint(private val client: SvixHttpClient) { } /** Delete an ingest endpoint. */ - suspend fun delete(endpointId: String) { + suspend fun delete(sourceId: String, endpointId: String) { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId") client.executeRequest("DELETE", url.build()) } /** Get the additional headers to be sent with the ingest. */ - suspend fun getHeaders(endpointId: String): IngestEndpointHeadersOut { + suspend fun getHeaders(sourceId: String, endpointId: String): IngestEndpointHeadersOut { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId/headers") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId/headers") return client.executeRequest("GET", url.build()) } /** Set the additional headers to be sent to the endpoint. */ suspend fun updateHeaders( + sourceId: String, endpointId: String, ingestEndpointHeadersIn: IngestEndpointHeadersIn, ) { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId/headers") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId/headers") client.executeRequest( "PUT", @@ -121,11 +125,11 @@ class IngestEndpoint(private val client: SvixHttpClient) { * This is used to verify the authenticity of the webhook. For more information please refer to * [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). */ - suspend fun getSecret(endpointId: String): IngestEndpointSecretOut { + suspend fun getSecret(sourceId: String, endpointId: String): IngestEndpointSecretOut { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId/secret") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId/secret") return client.executeRequest("GET", url.build()) } @@ -135,6 +139,7 @@ class IngestEndpoint(private val client: SvixHttpClient) { * The previous secret will remain valid for the next 24 hours. */ suspend fun rotateSecret( + sourceId: String, endpointId: String, ingestEndpointSecretIn: IngestEndpointSecretIn, options: IngestEndpointRotateSecretOptions = IngestEndpointRotateSecretOptions(), @@ -142,7 +147,7 @@ class IngestEndpoint(private val client: SvixHttpClient) { val url = client .newUrlBuilder() - .encodedPath("/ingest/api/v1/source/{source_id}/endpoint/$endpointId/secret/rotate") + .encodedPath("/ingest/api/v1/source/$sourceId/endpoint/$endpointId/secret/rotate") val headers = Headers.Builder() options.idempotencyKey?.let { headers.add("idempotency-key", it) } diff --git a/lib-openapi.json b/lib-openapi.json index 54e6bc84a..3ae85a82d 100644 --- a/lib-openapi.json +++ b/lib-openapi.json @@ -9626,7 +9626,7 @@ "info": { "description": "Welcome to the Svix API documentation!\n\nUseful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/)\n\n# Introduction\n\nThis is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com).\n\n## Main concepts\n\nIn Svix you have four important entities you will be interacting with:\n\n- `messages`: these are the webhooks being sent. They can have contents and a few other properties.\n- `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform.\n- `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type).\n- `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint.\n\n\n## Authentication\n\nGet your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys).\n\n\n\n\n## Code samples\n\nThe code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/).\n\n\n## Idempotency\n\nSvix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.\n\nTo perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions.\n\nSvix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result for a period of up to 12 hours.\n\nPlease note that idempotency is only supported for `POST` requests.\n\n\n## Cross-Origin Resource Sharing\n\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n", "title": "Svix API", - "version": "1.64.1", + "version": "1.64.0", "x-logo": { "altText": "Svix Logo", "url": "https://www.svix.com/static/img/brand-padded.svg" @@ -38925,6 +38925,20 @@ "description": "List ingest endpoints.", "operationId": "v1.ingest.endpoint.list", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "Limit the number of returned items", "in": "query", @@ -39060,57 +39074,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const listResponseIngestEndpointOut = await svix.ingest.endpoint.list();" + "source": "const listResponseIngestEndpointOut = await svix.ingest.endpoint.list(\"source_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const listResponseIngestEndpointOut = await svix.ingest.endpoint.list();" + "source": "const listResponseIngestEndpointOut = await svix.ingest.endpoint.list(\"source_id\");" }, { "label": "Python", "lang": "Python", - "source": "list_response_ingest_endpoint_out = svix.ingest.endpoint.list(options=...)" + "source": "list_response_ingest_endpoint_out = svix.ingest.endpoint.list(\"source_id\", options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "list_response_ingest_endpoint_out = await svix.ingest.endpoint.list(options=...)" + "source": "list_response_ingest_endpoint_out = await svix.ingest.endpoint.list(\"source_id\", options=...)" }, { "label": "Go", "lang": "Go", - "source": "listResponseIngestEndpointOut, err := svixClient.Ingest.Endpoint.List(ctx, nil)" + "source": "listResponseIngestEndpointOut, err := svixClient.Ingest.Endpoint.List(ctx, \"source_id\", nil)" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val listResponseIngestEndpointOut = svix.ingest.endpoint.list()" + "source": "val listResponseIngestEndpointOut = svix.ingest.endpoint.list(\"source_id\")" }, { "label": "Java", "lang": "Java", - "source": "ListResponseIngestEndpointOut listResponseIngestEndpointOut = svix.getIngest().getEndpoint().list();" + "source": "ListResponseIngestEndpointOut listResponseIngestEndpointOut = svix.getIngest().getEndpoint().list(\"source_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "list_response_ingest_endpoint_out = svix.ingest.endpoint.list()" + "source": "list_response_ingest_endpoint_out = svix.ingest.endpoint.list(\"source_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let list_response_ingest_endpoint_out = svix.ingest().endpoint().list(None).await?;" + "source": "let list_response_ingest_endpoint_out = svix.ingest().endpoint().list(\"source_id\", None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var listResponseIngestEndpointOut = await svix.Ingest.Endpoint.ListAsync();" + "source": "var listResponseIngestEndpointOut = await svix.Ingest.Endpoint.ListAsync(\"source_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint list " + "source": "svix ingest endpoint list \"source_id\"" }, { "label": "cURL", @@ -39123,6 +39137,20 @@ "description": "Create an ingest endpoint.", "operationId": "v1.ingest.endpoint.create", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The request's idempotency key", "in": "header", @@ -39238,57 +39266,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.create({\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.create(\"source_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.create({\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.create(\"source_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "Python", "lang": "Python", - "source": "ingest_endpoint_out = svix.ingest.endpoint.create(IngestEndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" + "source": "ingest_endpoint_out = svix.ingest.endpoint.create(\"source_id\", IngestEndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "ingest_endpoint_out = await svix.ingest.endpoint.create(IngestEndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" + "source": "ingest_endpoint_out = await svix.ingest.endpoint.create(\"source_id\", IngestEndpointIn(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False,\n secret=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Create(ctx, &IngestEndpointIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-identifier\",\n Url: \"https://example.com/webhook/\",\n Disabled: false,\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Create(ctx, \"source_id\", &IngestEndpointIn{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-identifier\",\n Url: \"https://example.com/webhook/\",\n Disabled: false,\n Secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val ingestEndpointOut = svix.ingest.endpoint.create(IngestEndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "val ingestEndpointOut = svix.ingest.endpoint.create(\"source_id\", IngestEndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Java", "lang": "Java", - "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().create(new IngestEndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n);" + "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().create(\"source_id\", new IngestEndpointIn()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n .secret(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "ingest_endpoint_out = svix.ingest.endpoint.create(Svix::IngestEndpointIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + "source": "ingest_endpoint_out = svix.ingest.endpoint.create(\"source_id\", Svix::IngestEndpointIn.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let ingest_endpoint_out = svix.ingest().endpoint().create(IngestEndpointIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n disabled: Some(false),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + "source": "let ingest_endpoint_out = svix.ingest().endpoint().create(\"source_id\", IngestEndpointIn {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n disabled: Some(false),\n secret: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.CreateAsync(new IngestEndpointIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.CreateAsync(\"source_id\", new IngestEndpointIn{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false,\n secret: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint create '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + "source": "svix ingest endpoint create \"source_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false,\n \"secret\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" }, { "label": "cURL", @@ -39303,6 +39331,20 @@ "description": "Delete an ingest endpoint.", "operationId": "v1.ingest.endpoint.delete", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -39407,57 +39449,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.delete(\"endpoint_id\");" + "source": "await svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.delete(\"endpoint_id\");" + "source": "await svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "svix.ingest.endpoint.delete(\"endpoint_id\")" + "source": "svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.ingest.endpoint.delete(\"endpoint_id\")" + "source": "await svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Ingest.Endpoint.Delete(ctx, \"endpoint_id\")" + "source": "err := svixClient.Ingest.Endpoint.Delete(ctx, \"source_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.ingest.endpoint.delete(\"endpoint_id\")" + "source": "svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "svix.getIngest().getEndpoint().delete(\"endpoint_id\");" + "source": "svix.getIngest().getEndpoint().delete(\"source_id\", \"endpoint_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.ingest.endpoint.delete(\"endpoint_id\")" + "source": "svix.ingest.endpoint.delete(\"source_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "svix.ingest().endpoint().delete(\"endpoint_id\").await?;" + "source": "svix.ingest().endpoint().delete(\"source_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Ingest.Endpoint.DeleteAsync(\"endpoint_id\");" + "source": "await svix.Ingest.Endpoint.DeleteAsync(\"source_id\", \"endpoint_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint delete \"endpoint_id\"" + "source": "svix ingest endpoint delete \"source_id\" \"endpoint_id\"" }, { "label": "cURL", @@ -39470,6 +39512,20 @@ "description": "Get an ingest endpoint.", "operationId": "v1.ingest.endpoint.get", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -39581,57 +39637,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.get(\"endpoint_id\");" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.get(\"endpoint_id\");" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "ingest_endpoint_out = svix.ingest.endpoint.get(\"endpoint_id\")" + "source": "ingest_endpoint_out = svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "ingest_endpoint_out = await svix.ingest.endpoint.get(\"endpoint_id\")" + "source": "ingest_endpoint_out = await svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Get(ctx, \"endpoint_id\")" + "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Get(ctx, \"source_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val ingestEndpointOut = svix.ingest.endpoint.get(\"endpoint_id\")" + "source": "val ingestEndpointOut = svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().get(\"endpoint_id\");" + "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().get(\"source_id\", \"endpoint_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "ingest_endpoint_out = svix.ingest.endpoint.get(\"endpoint_id\")" + "source": "ingest_endpoint_out = svix.ingest.endpoint.get(\"source_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let ingest_endpoint_out = svix.ingest().endpoint().get(\"endpoint_id\").await?;" + "source": "let ingest_endpoint_out = svix.ingest().endpoint().get(\"source_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.GetAsync(\"endpoint_id\");" + "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.GetAsync(\"source_id\", \"endpoint_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint get \"endpoint_id\"" + "source": "svix ingest endpoint get \"source_id\" \"endpoint_id\"" }, { "label": "cURL", @@ -39644,6 +39700,20 @@ "description": "Update an ingest endpoint.", "operationId": "v1.ingest.endpoint.update", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -39765,57 +39835,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.update(\"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const ingestEndpointOut = await svix.ingest.endpoint.update(\"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" + "source": "const ingestEndpointOut = await svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", {\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" }, { "label": "Python", "lang": "Python", - "source": "ingest_endpoint_out = svix.ingest.endpoint.update(\"endpoint_id\", IngestEndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False\n))" + "source": "ingest_endpoint_out = svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", IngestEndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "ingest_endpoint_out = await svix.ingest.endpoint.update(\"endpoint_id\", IngestEndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False\n))" + "source": "ingest_endpoint_out = await svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", IngestEndpointUpdate(\n description=\"An example endpoint name\",\n rate_limit=None,\n uid=\"unique-identifier\",\n url=\"https://example.com/webhook/\",\n disabled=False\n))" }, { "label": "Go", "lang": "Go", - "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Update(ctx, \"endpoint_id\", &IngestEndpointUpdate{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-identifier\",\n Url: \"https://example.com/webhook/\",\n Disabled: false,\n})" + "source": "ingestEndpointOut, err := svixClient.Ingest.Endpoint.Update(ctx, \"source_id\", \"endpoint_id\", &IngestEndpointUpdate{\n Description: \"An example endpoint name\",\n RateLimit: nil,\n Uid: \"unique-identifier\",\n Url: \"https://example.com/webhook/\",\n Disabled: false,\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val ingestEndpointOut = svix.ingest.endpoint.update(\"endpoint_id\", IngestEndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n)" + "source": "val ingestEndpointOut = svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", IngestEndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n)" }, { "label": "Java", "lang": "Java", - "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().update(\"endpoint_id\", new IngestEndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n);" + "source": "IngestEndpointOut ingestEndpointOut = svix.getIngest().getEndpoint().update(\"source_id\", \"endpoint_id\", new IngestEndpointUpdate()\n .description(\"An example endpoint name\")\n .rateLimit(null)\n .uid(\"unique-identifier\")\n .url(\"https://example.com/webhook/\")\n .disabled(false)\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "ingest_endpoint_out = svix.ingest.endpoint.update(\"endpoint_id\", Svix::IngestEndpointUpdate.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n}))" + "source": "ingest_endpoint_out = svix.ingest.endpoint.update(\"source_id\", \"endpoint_id\", Svix::IngestEndpointUpdate.new({\n \"description\": \"An example endpoint name\",\n \"rate_limit\": nil,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "let ingest_endpoint_out = svix.ingest().endpoint().update(\"endpoint_id\", IngestEndpointUpdate {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n disabled: Some(false),\n}).await?;" + "source": "let ingest_endpoint_out = svix.ingest().endpoint().update(\"source_id\", \"endpoint_id\", IngestEndpointUpdate {\n description: Some(\"An example endpoint name\".to_string()),\n rate_limit: None,\n uid: Some(\"unique-identifier\".to_string()),\n url: \"https://example.com/webhook/\".to_string(),\n disabled: Some(false),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.UpdateAsync(\"endpoint_id\", new IngestEndpointUpdate{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" + "source": "var ingestEndpointOut = await svix.Ingest.Endpoint.UpdateAsync(\"source_id\", \"endpoint_id\", new IngestEndpointUpdate{\n description: \"An example endpoint name\",\n rateLimit: null,\n uid: \"unique-identifier\",\n url: \"https://example.com/webhook/\",\n disabled: false\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint update \"endpoint_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n}'" + "source": "svix ingest endpoint update \"source_id\" \"endpoint_id\" '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n}'" }, { "label": "cURL", @@ -39830,6 +39900,20 @@ "description": "Get the additional headers to be sent with the ingest.", "operationId": "v1.ingest.endpoint.get-headers", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -39941,57 +40025,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const ingestEndpointHeadersOut = await svix.ingest.endpoint.getHeaders(\"endpoint_id\");" + "source": "const ingestEndpointHeadersOut = await svix.ingest.endpoint.getHeaders(\"source_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const ingestEndpointHeadersOut = await svix.ingest.endpoint.getHeaders(\"endpoint_id\");" + "source": "const ingestEndpointHeadersOut = await svix.ingest.endpoint.getHeaders(\"source_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "ingest_endpoint_headers_out = svix.ingest.endpoint.get_headers(\"endpoint_id\")" + "source": "ingest_endpoint_headers_out = svix.ingest.endpoint.get_headers(\"source_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "ingest_endpoint_headers_out = await svix.ingest.endpoint.get_headers(\"endpoint_id\")" + "source": "ingest_endpoint_headers_out = await svix.ingest.endpoint.get_headers(\"source_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "ingestEndpointHeadersOut, err := svixClient.Ingest.Endpoint.GetHeaders(ctx, \"endpoint_id\")" + "source": "ingestEndpointHeadersOut, err := svixClient.Ingest.Endpoint.GetHeaders(ctx, \"source_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val ingestEndpointHeadersOut = svix.ingest.endpoint.getHeaders(\"endpoint_id\")" + "source": "val ingestEndpointHeadersOut = svix.ingest.endpoint.getHeaders(\"source_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "IngestEndpointHeadersOut ingestEndpointHeadersOut = svix.getIngest().getEndpoint().getHeaders(\"endpoint_id\");" + "source": "IngestEndpointHeadersOut ingestEndpointHeadersOut = svix.getIngest().getEndpoint().getHeaders(\"source_id\", \"endpoint_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "ingest_endpoint_headers_out = svix.ingest.endpoint.get_headers(\"endpoint_id\")" + "source": "ingest_endpoint_headers_out = svix.ingest.endpoint.get_headers(\"source_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let ingest_endpoint_headers_out = svix.ingest().endpoint().get_headers(\"endpoint_id\").await?;" + "source": "let ingest_endpoint_headers_out = svix.ingest().endpoint().get_headers(\"source_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var ingestEndpointHeadersOut = await svix.Ingest.Endpoint.GetHeadersAsync(\"endpoint_id\");" + "source": "var ingestEndpointHeadersOut = await svix.Ingest.Endpoint.GetHeadersAsync(\"source_id\", \"endpoint_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint get-headers \"endpoint_id\"" + "source": "svix ingest endpoint get-headers \"source_id\" \"endpoint_id\"" }, { "label": "cURL", @@ -40004,6 +40088,20 @@ "description": "Set the additional headers to be sent to the endpoint.", "operationId": "v1.ingest.endpoint.update-headers", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -40118,57 +40216,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.updateHeaders(\"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "await svix.ingest.endpoint.updateHeaders(\"source_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.updateHeaders(\"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" + "source": "await svix.ingest.endpoint.updateHeaders(\"source_id\", \"endpoint_id\", {\n headers: {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.ingest.endpoint.update_headers(\"endpoint_id\", IngestEndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "svix.ingest.endpoint.update_headers(\"source_id\", \"endpoint_id\", IngestEndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.ingest.endpoint.update_headers(\"endpoint_id\", IngestEndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" + "source": "await svix.ingest.endpoint.update_headers(\"source_id\", \"endpoint_id\", IngestEndpointHeadersIn(\n headers={\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"}\n))" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Ingest.Endpoint.UpdateHeaders(ctx, \"endpoint_id\", &IngestEndpointHeadersIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" + "source": "err := svixClient.Ingest.Endpoint.UpdateHeaders(ctx, \"source_id\", \"endpoint_id\", &IngestEndpointHeadersIn{\n Headers: map[string]interface{}{\"X-Example\": \"123\", \"X-Foobar\": \"Bar\"},\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.ingest.endpoint.updateHeaders(\"endpoint_id\", IngestEndpointHeadersIn()\n .headers(/* ... */)\n)" + "source": "svix.ingest.endpoint.updateHeaders(\"source_id\", \"endpoint_id\", IngestEndpointHeadersIn()\n .headers(/* ... */)\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getIngest().getEndpoint().updateHeaders(\"endpoint_id\", new IngestEndpointHeadersIn()\n .headers(/* ... */)\n);" + "source": "svix.getIngest().getEndpoint().updateHeaders(\"source_id\", \"endpoint_id\", new IngestEndpointHeadersIn()\n .headers(/* ... */)\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.ingest.endpoint.update_headers(\"endpoint_id\", Svix::IngestEndpointHeadersIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" + "source": "svix.ingest.endpoint.update_headers(\"source_id\", \"endpoint_id\", Svix::IngestEndpointHeadersIn.new({\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.ingest().endpoint().update_headers(\"endpoint_id\", IngestEndpointHeadersIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" + "source": "svix.ingest().endpoint().update_headers(\"source_id\", \"endpoint_id\", IngestEndpointHeadersIn {\n headers: json!({\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}),\n}).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Ingest.Endpoint.UpdateHeadersAsync(\"endpoint_id\", new IngestEndpointHeadersIn{\n headers: /* ... */\n});" + "source": "await svix.Ingest.Endpoint.UpdateHeadersAsync(\"source_id\", \"endpoint_id\", new IngestEndpointHeadersIn{\n headers: /* ... */\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint update-headers \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" + "source": "svix ingest endpoint update-headers \"source_id\" \"endpoint_id\" '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n}'" }, { "label": "cURL", @@ -40183,6 +40281,20 @@ "description": "Get an ingest endpoint's signing secret.\n\nThis is used to verify the authenticity of the webhook.\nFor more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).", "operationId": "v1.ingest.endpoint.get-secret", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -40294,57 +40406,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "const ingestEndpointSecretOut = await svix.ingest.endpoint.getSecret(\"endpoint_id\");" + "source": "const ingestEndpointSecretOut = await svix.ingest.endpoint.getSecret(\"source_id\", \"endpoint_id\");" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "const ingestEndpointSecretOut = await svix.ingest.endpoint.getSecret(\"endpoint_id\");" + "source": "const ingestEndpointSecretOut = await svix.ingest.endpoint.getSecret(\"source_id\", \"endpoint_id\");" }, { "label": "Python", "lang": "Python", - "source": "ingest_endpoint_secret_out = svix.ingest.endpoint.get_secret(\"endpoint_id\")" + "source": "ingest_endpoint_secret_out = svix.ingest.endpoint.get_secret(\"source_id\", \"endpoint_id\")" }, { "label": "Python (Async)", "lang": "Python", - "source": "ingest_endpoint_secret_out = await svix.ingest.endpoint.get_secret(\"endpoint_id\")" + "source": "ingest_endpoint_secret_out = await svix.ingest.endpoint.get_secret(\"source_id\", \"endpoint_id\")" }, { "label": "Go", "lang": "Go", - "source": "ingestEndpointSecretOut, err := svixClient.Ingest.Endpoint.GetSecret(ctx, \"endpoint_id\")" + "source": "ingestEndpointSecretOut, err := svixClient.Ingest.Endpoint.GetSecret(ctx, \"source_id\", \"endpoint_id\")" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "val ingestEndpointSecretOut = svix.ingest.endpoint.getSecret(\"endpoint_id\")" + "source": "val ingestEndpointSecretOut = svix.ingest.endpoint.getSecret(\"source_id\", \"endpoint_id\")" }, { "label": "Java", "lang": "Java", - "source": "IngestEndpointSecretOut ingestEndpointSecretOut = svix.getIngest().getEndpoint().getSecret(\"endpoint_id\");" + "source": "IngestEndpointSecretOut ingestEndpointSecretOut = svix.getIngest().getEndpoint().getSecret(\"source_id\", \"endpoint_id\");" }, { "label": "Ruby", "lang": "Ruby", - "source": "ingest_endpoint_secret_out = svix.ingest.endpoint.get_secret(\"endpoint_id\")" + "source": "ingest_endpoint_secret_out = svix.ingest.endpoint.get_secret(\"source_id\", \"endpoint_id\")" }, { "label": "Rust", "lang": "Rust", - "source": "let ingest_endpoint_secret_out = svix.ingest().endpoint().get_secret(\"endpoint_id\").await?;" + "source": "let ingest_endpoint_secret_out = svix.ingest().endpoint().get_secret(\"source_id\", \"endpoint_id\").await?;" }, { "label": "C#", "lang": "C#", - "source": "var ingestEndpointSecretOut = await svix.Ingest.Endpoint.GetSecretAsync(\"endpoint_id\");" + "source": "var ingestEndpointSecretOut = await svix.Ingest.Endpoint.GetSecretAsync(\"source_id\", \"endpoint_id\");" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint get-secret \"endpoint_id\"" + "source": "svix ingest endpoint get-secret \"source_id\" \"endpoint_id\"" }, { "label": "cURL", @@ -40359,6 +40471,20 @@ "description": "Rotates an ingest endpoint's signing secret.\n\nThe previous secret will remain valid for the next 24 hours.", "operationId": "v1.ingest.endpoint.rotate-secret", "parameters": [ + { + "description": "The Source's ID or UID.", + "in": "path", + "name": "source_id", + "required": true, + "schema": { + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, { "description": "The Endpoint's ID or UID.", "in": "path", @@ -40482,57 +40608,57 @@ { "label": "JavaScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.rotateSecret(\"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "await svix.ingest.endpoint.rotateSecret(\"source_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "TypeScript", "lang": "JavaScript", - "source": "await svix.ingest.endpoint.rotateSecret(\"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "await svix.ingest.endpoint.rotateSecret(\"source_id\", \"endpoint_id\", {\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "Python", "lang": "Python", - "source": "svix.ingest.endpoint.rotate_secret(\"endpoint_id\", IngestEndpointSecretIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" + "source": "svix.ingest.endpoint.rotate_secret(\"source_id\", \"endpoint_id\", IngestEndpointSecretIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Python (Async)", "lang": "Python", - "source": "await svix.ingest.endpoint.rotate_secret(\"endpoint_id\", IngestEndpointSecretIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" + "source": "await svix.ingest.endpoint.rotate_secret(\"source_id\", \"endpoint_id\", IngestEndpointSecretIn(\n key=\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n), options=...)" }, { "label": "Go", "lang": "Go", - "source": "err := svixClient.Ingest.Endpoint.RotateSecret(ctx, \"endpoint_id\", &IngestEndpointSecretIn{\n Key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" + "source": "err := svixClient.Ingest.Endpoint.RotateSecret(ctx, \"source_id\", \"endpoint_id\", &IngestEndpointSecretIn{\n Key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\",\n})" }, { "label": "Kotlin", "lang": "Kotlin", - "source": "svix.ingest.endpoint.rotateSecret(\"endpoint_id\", IngestEndpointSecretIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" + "source": "svix.ingest.endpoint.rotateSecret(\"source_id\", \"endpoint_id\", IngestEndpointSecretIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n)" }, { "label": "Java", "lang": "Java", - "source": "svix.getIngest().getEndpoint().rotateSecret(\"endpoint_id\", new IngestEndpointSecretIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n);" + "source": "svix.getIngest().getEndpoint().rotateSecret(\"source_id\", \"endpoint_id\", new IngestEndpointSecretIn()\n .key(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\")\n);" }, { "label": "Ruby", "lang": "Ruby", - "source": "svix.ingest.endpoint.rotate_secret(\"endpoint_id\", Svix::IngestEndpointSecretIn.new({\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" + "source": "svix.ingest.endpoint.rotate_secret(\"source_id\", \"endpoint_id\", Svix::IngestEndpointSecretIn.new({\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}))" }, { "label": "Rust", "lang": "Rust", - "source": "svix.ingest().endpoint().rotate_secret(\"endpoint_id\", IngestEndpointSecretIn {\n key: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" + "source": "svix.ingest().endpoint().rotate_secret(\"source_id\", \"endpoint_id\", IngestEndpointSecretIn {\n key: Some(\"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\".to_string()),\n}, None).await?;" }, { "label": "C#", "lang": "C#", - "source": "await svix.Ingest.Endpoint.RotateSecretAsync(\"endpoint_id\", new IngestEndpointSecretIn{\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" + "source": "await svix.Ingest.Endpoint.RotateSecretAsync(\"source_id\", \"endpoint_id\", new IngestEndpointSecretIn{\n key: \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n});" }, { "label": "CLI", "lang": "Shell", - "source": "svix ingest endpoint rotate-secret \"endpoint_id\" '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" + "source": "svix ingest endpoint rotate-secret \"source_id\" \"endpoint_id\" '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n}'" }, { "label": "cURL", diff --git a/python/svix/api/ingest_endpoint.py b/python/svix/api/ingest_endpoint.py index de5c31d0d..4827e09b3 100644 --- a/python/svix/api/ingest_endpoint.py +++ b/python/svix/api/ingest_endpoint.py @@ -61,13 +61,17 @@ def _header_params(self) -> t.Dict[str, str]: class IngestEndpointAsync(ApiBase): async def list( - self, options: IngestEndpointListOptions = IngestEndpointListOptions() + self, + source_id: str, + options: IngestEndpointListOptions = IngestEndpointListOptions(), ) -> ListResponseIngestEndpointOut: """List ingest endpoints.""" response = await self._request_asyncio( method="get", path="/ingest/api/v1/source/{source_id}/endpoint", - path_params={}, + path_params={ + "source_id": source_id, + }, query_params=options._query_params(), header_params=options._header_params(), ) @@ -75,6 +79,7 @@ async def list( async def create( self, + source_id: str, ingest_endpoint_in: IngestEndpointIn, options: IngestEndpointCreateOptions = IngestEndpointCreateOptions(), ) -> IngestEndpointOut: @@ -82,7 +87,9 @@ async def create( response = await self._request_asyncio( method="post", path="/ingest/api/v1/source/{source_id}/endpoint", - path_params={}, + path_params={ + "source_id": source_id, + }, query_params=options._query_params(), header_params=options._header_params(), json_body=ingest_endpoint_in.model_dump_json( @@ -91,25 +98,30 @@ async def create( ) return IngestEndpointOut.model_validate(response.json()) - async def get(self, endpoint_id: str) -> IngestEndpointOut: + async def get(self, source_id: str, endpoint_id: str) -> IngestEndpointOut: """Get an ingest endpoint.""" response = await self._request_asyncio( method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) return IngestEndpointOut.model_validate(response.json()) async def update( - self, endpoint_id: str, ingest_endpoint_update: IngestEndpointUpdate + self, + source_id: str, + endpoint_id: str, + ingest_endpoint_update: IngestEndpointUpdate, ) -> IngestEndpointOut: """Update an ingest endpoint.""" response = await self._request_asyncio( method="put", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, json_body=ingest_endpoint_update.model_dump_json( @@ -118,35 +130,43 @@ async def update( ) return IngestEndpointOut.model_validate(response.json()) - async def delete(self, endpoint_id: str) -> None: + async def delete(self, source_id: str, endpoint_id: str) -> None: """Delete an ingest endpoint.""" await self._request_asyncio( method="delete", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) - async def get_headers(self, endpoint_id: str) -> IngestEndpointHeadersOut: + async def get_headers( + self, source_id: str, endpoint_id: str + ) -> IngestEndpointHeadersOut: """Get the additional headers to be sent with the ingest.""" response = await self._request_asyncio( method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) return IngestEndpointHeadersOut.model_validate(response.json()) async def update_headers( - self, endpoint_id: str, ingest_endpoint_headers_in: IngestEndpointHeadersIn + self, + source_id: str, + endpoint_id: str, + ingest_endpoint_headers_in: IngestEndpointHeadersIn, ) -> None: """Set the additional headers to be sent to the endpoint.""" await self._request_asyncio( method="put", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, json_body=ingest_endpoint_headers_in.model_dump_json( @@ -154,7 +174,9 @@ async def update_headers( ), ) - async def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: + async def get_secret( + self, source_id: str, endpoint_id: str + ) -> IngestEndpointSecretOut: """Get an ingest endpoint's signing secret. This is used to verify the authenticity of the webhook. @@ -163,6 +185,7 @@ async def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) @@ -170,6 +193,7 @@ async def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: async def rotate_secret( self, + source_id: str, endpoint_id: str, ingest_endpoint_secret_in: IngestEndpointSecretIn, options: IngestEndpointRotateSecretOptions = IngestEndpointRotateSecretOptions(), @@ -181,6 +205,7 @@ async def rotate_secret( method="post", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, query_params=options._query_params(), @@ -193,13 +218,17 @@ async def rotate_secret( class IngestEndpoint(ApiBase): def list( - self, options: IngestEndpointListOptions = IngestEndpointListOptions() + self, + source_id: str, + options: IngestEndpointListOptions = IngestEndpointListOptions(), ) -> ListResponseIngestEndpointOut: """List ingest endpoints.""" response = self._request_sync( method="get", path="/ingest/api/v1/source/{source_id}/endpoint", - path_params={}, + path_params={ + "source_id": source_id, + }, query_params=options._query_params(), header_params=options._header_params(), ) @@ -207,6 +236,7 @@ def list( def create( self, + source_id: str, ingest_endpoint_in: IngestEndpointIn, options: IngestEndpointCreateOptions = IngestEndpointCreateOptions(), ) -> IngestEndpointOut: @@ -214,7 +244,9 @@ def create( response = self._request_sync( method="post", path="/ingest/api/v1/source/{source_id}/endpoint", - path_params={}, + path_params={ + "source_id": source_id, + }, query_params=options._query_params(), header_params=options._header_params(), json_body=ingest_endpoint_in.model_dump_json( @@ -223,25 +255,30 @@ def create( ) return IngestEndpointOut.model_validate(response.json()) - def get(self, endpoint_id: str) -> IngestEndpointOut: + def get(self, source_id: str, endpoint_id: str) -> IngestEndpointOut: """Get an ingest endpoint.""" response = self._request_sync( method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) return IngestEndpointOut.model_validate(response.json()) def update( - self, endpoint_id: str, ingest_endpoint_update: IngestEndpointUpdate + self, + source_id: str, + endpoint_id: str, + ingest_endpoint_update: IngestEndpointUpdate, ) -> IngestEndpointOut: """Update an ingest endpoint.""" response = self._request_sync( method="put", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, json_body=ingest_endpoint_update.model_dump_json( @@ -250,35 +287,41 @@ def update( ) return IngestEndpointOut.model_validate(response.json()) - def delete(self, endpoint_id: str) -> None: + def delete(self, source_id: str, endpoint_id: str) -> None: """Delete an ingest endpoint.""" self._request_sync( method="delete", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) - def get_headers(self, endpoint_id: str) -> IngestEndpointHeadersOut: + def get_headers(self, source_id: str, endpoint_id: str) -> IngestEndpointHeadersOut: """Get the additional headers to be sent with the ingest.""" response = self._request_sync( method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) return IngestEndpointHeadersOut.model_validate(response.json()) def update_headers( - self, endpoint_id: str, ingest_endpoint_headers_in: IngestEndpointHeadersIn + self, + source_id: str, + endpoint_id: str, + ingest_endpoint_headers_in: IngestEndpointHeadersIn, ) -> None: """Set the additional headers to be sent to the endpoint.""" self._request_sync( method="put", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, json_body=ingest_endpoint_headers_in.model_dump_json( @@ -286,7 +329,7 @@ def update_headers( ), ) - def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: + def get_secret(self, source_id: str, endpoint_id: str) -> IngestEndpointSecretOut: """Get an ingest endpoint's signing secret. This is used to verify the authenticity of the webhook. @@ -295,6 +338,7 @@ def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: method="get", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, ) @@ -302,6 +346,7 @@ def get_secret(self, endpoint_id: str) -> IngestEndpointSecretOut: def rotate_secret( self, + source_id: str, endpoint_id: str, ingest_endpoint_secret_in: IngestEndpointSecretIn, options: IngestEndpointRotateSecretOptions = IngestEndpointRotateSecretOptions(), @@ -313,6 +358,7 @@ def rotate_secret( method="post", path="/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", path_params={ + "source_id": source_id, "endpoint_id": endpoint_id, }, query_params=options._query_params(), diff --git a/ruby/lib/svix/api/ingest_endpoint.rb b/ruby/lib/svix/api/ingest_endpoint.rb index 48ccc481d..c77d266ad 100644 --- a/ruby/lib/svix/api/ingest_endpoint.rb +++ b/ruby/lib/svix/api/ingest_endpoint.rb @@ -9,11 +9,11 @@ def initialize(client) @client = client end - def list(options = {}) + def list(source_id, options = {}) options = options.transform_keys(&:to_s) res = @client.execute_request( "GET", - "/ingest/api/v1/source/{source_id}/endpoint", + "/ingest/api/v1/source/#{source_id}/endpoint", query_params: { "limit" => options["limit"], "iterator" => options["iterator"], @@ -23,11 +23,11 @@ def list(options = {}) ListResponseIngestEndpointOut.deserialize(res) end - def create(ingest_endpoint_in, options = {}) + def create(source_id, ingest_endpoint_in, options = {}) options = options.transform_keys(&:to_s) res = @client.execute_request( "POST", - "/ingest/api/v1/source/{source_id}/endpoint", + "/ingest/api/v1/source/#{source_id}/endpoint", headers: { "idempotency-key" => options["idempotency-key"] }, @@ -36,59 +36,59 @@ def create(ingest_endpoint_in, options = {}) IngestEndpointOut.deserialize(res) end - def get(endpoint_id) + def get(source_id, endpoint_id) res = @client.execute_request( "GET", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}" + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}" ) IngestEndpointOut.deserialize(res) end - def update(endpoint_id, ingest_endpoint_update) + def update(source_id, endpoint_id, ingest_endpoint_update) res = @client.execute_request( "PUT", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}", + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}", body: ingest_endpoint_update ) IngestEndpointOut.deserialize(res) end - def delete(endpoint_id) + def delete(source_id, endpoint_id) @client.execute_request( "DELETE", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}" + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}" ) end - def get_headers(endpoint_id) + def get_headers(source_id, endpoint_id) res = @client.execute_request( "GET", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}/headers" + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}/headers" ) IngestEndpointHeadersOut.deserialize(res) end - def update_headers(endpoint_id, ingest_endpoint_headers_in) + def update_headers(source_id, endpoint_id, ingest_endpoint_headers_in) @client.execute_request( "PUT", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}/headers", + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}/headers", body: ingest_endpoint_headers_in ) end - def get_secret(endpoint_id) + def get_secret(source_id, endpoint_id) res = @client.execute_request( "GET", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}/secret" + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}/secret" ) IngestEndpointSecretOut.deserialize(res) end - def rotate_secret(endpoint_id, ingest_endpoint_secret_in, options = {}) + def rotate_secret(source_id, endpoint_id, ingest_endpoint_secret_in, options = {}) options = options.transform_keys(&:to_s) @client.execute_request( "POST", - "/ingest/api/v1/source/{source_id}/endpoint/#{endpoint_id}/secret/rotate", + "/ingest/api/v1/source/#{source_id}/endpoint/#{endpoint_id}/secret/rotate", headers: { "idempotency-key" => options["idempotency-key"] }, diff --git a/rust/src/api/ingest_endpoint.rs b/rust/src/api/ingest_endpoint.rs index 858a3baed..7e2099ca6 100644 --- a/rust/src/api/ingest_endpoint.rs +++ b/rust/src/api/ingest_endpoint.rs @@ -34,6 +34,7 @@ impl<'a> IngestEndpoint<'a> { /// List ingest endpoints. pub async fn list( &self, + source_id: String, options: Option, ) -> Result { let IngestEndpointListOptions { @@ -46,6 +47,7 @@ impl<'a> IngestEndpoint<'a> { http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint", ) + .with_path_param("source_id", source_id) .with_optional_query_param("limit", limit) .with_optional_query_param("iterator", iterator) .with_optional_query_param("order", order) @@ -56,6 +58,7 @@ impl<'a> IngestEndpoint<'a> { /// Create an ingest endpoint. pub async fn create( &self, + source_id: String, ingest_endpoint_in: IngestEndpointIn, options: Option, ) -> Result { @@ -65,6 +68,7 @@ impl<'a> IngestEndpoint<'a> { http1::Method::POST, "/ingest/api/v1/source/{source_id}/endpoint", ) + .with_path_param("source_id", source_id) .with_optional_header_param("idempotency-key", idempotency_key) .with_body_param(ingest_endpoint_in) .execute(self.cfg) @@ -72,11 +76,12 @@ impl<'a> IngestEndpoint<'a> { } /// Get an ingest endpoint. - pub async fn get(&self, endpoint_id: String) -> Result { + pub async fn get(&self, source_id: String, endpoint_id: String) -> Result { crate::request::Request::new( http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .execute(self.cfg) .await @@ -85,6 +90,7 @@ impl<'a> IngestEndpoint<'a> { /// Update an ingest endpoint. pub async fn update( &self, + source_id: String, endpoint_id: String, ingest_endpoint_update: IngestEndpointUpdate, ) -> Result { @@ -92,6 +98,7 @@ impl<'a> IngestEndpoint<'a> { http1::Method::PUT, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .with_body_param(ingest_endpoint_update) .execute(self.cfg) @@ -99,11 +106,12 @@ impl<'a> IngestEndpoint<'a> { } /// Delete an ingest endpoint. - pub async fn delete(&self, endpoint_id: String) -> Result<()> { + pub async fn delete(&self, source_id: String, endpoint_id: String) -> Result<()> { crate::request::Request::new( http1::Method::DELETE, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .returns_nothing() .execute(self.cfg) @@ -111,11 +119,16 @@ impl<'a> IngestEndpoint<'a> { } /// Get the additional headers to be sent with the ingest. - pub async fn get_headers(&self, endpoint_id: String) -> Result { + pub async fn get_headers( + &self, + source_id: String, + endpoint_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .execute(self.cfg) .await @@ -124,6 +137,7 @@ impl<'a> IngestEndpoint<'a> { /// Set the additional headers to be sent to the endpoint. pub async fn update_headers( &self, + source_id: String, endpoint_id: String, ingest_endpoint_headers_in: IngestEndpointHeadersIn, ) -> Result<()> { @@ -131,6 +145,7 @@ impl<'a> IngestEndpoint<'a> { http1::Method::PUT, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .with_body_param(ingest_endpoint_headers_in) .returns_nothing() @@ -142,11 +157,16 @@ impl<'a> IngestEndpoint<'a> { /// /// This is used to verify the authenticity of the webhook. /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). - pub async fn get_secret(&self, endpoint_id: String) -> Result { + pub async fn get_secret( + &self, + source_id: String, + endpoint_id: String, + ) -> Result { crate::request::Request::new( http1::Method::GET, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .execute(self.cfg) .await @@ -157,6 +177,7 @@ impl<'a> IngestEndpoint<'a> { /// The previous secret will remain valid for the next 24 hours. pub async fn rotate_secret( &self, + source_id: String, endpoint_id: String, ingest_endpoint_secret_in: IngestEndpointSecretIn, options: Option, @@ -167,6 +188,7 @@ impl<'a> IngestEndpoint<'a> { http1::Method::POST, "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate", ) + .with_path_param("source_id", source_id) .with_path_param("endpoint_id", endpoint_id) .with_optional_header_param("idempotency-key", idempotency_key) .with_body_param(ingest_endpoint_secret_in) diff --git a/svix-cli/src/cmds/api/ingest_endpoint.rs b/svix-cli/src/cmds/api/ingest_endpoint.rs index 20c3f9986..5d9ab7cde 100644 --- a/svix-cli/src/cmds/api/ingest_endpoint.rs +++ b/svix-cli/src/cmds/api/ingest_endpoint.rs @@ -68,28 +68,41 @@ pub struct IngestEndpointArgs { pub enum IngestEndpointCommands { /// List ingest endpoints. List { + source_id: String, #[clap(flatten)] options: IngestEndpointListOptions, }, /// Create an ingest endpoint. Create { + source_id: String, ingest_endpoint_in: JsonOf, #[clap(flatten)] options: IngestEndpointCreateOptions, }, /// Get an ingest endpoint. - Get { endpoint_id: String }, + Get { + source_id: String, + endpoint_id: String, + }, /// Update an ingest endpoint. Update { + source_id: String, endpoint_id: String, ingest_endpoint_update: JsonOf, }, /// Delete an ingest endpoint. - Delete { endpoint_id: String }, + Delete { + source_id: String, + endpoint_id: String, + }, /// Get the additional headers to be sent with the ingest. - GetHeaders { endpoint_id: String }, + GetHeaders { + source_id: String, + endpoint_id: String, + }, /// Set the additional headers to be sent to the endpoint. UpdateHeaders { + source_id: String, endpoint_id: String, ingest_endpoint_headers_in: JsonOf, }, @@ -97,11 +110,15 @@ pub enum IngestEndpointCommands { /// /// This is used to verify the authenticity of the webhook. /// For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/). - GetSecret { endpoint_id: String }, + GetSecret { + source_id: String, + endpoint_id: String, + }, /// Rotates an ingest endpoint's signing secret. /// /// The previous secret will remain valid for the next 24 hours. RotateSecret { + source_id: String, endpoint_id: String, ingest_endpoint_secret_in: Option>, #[clap(flatten)] @@ -116,62 +133,102 @@ impl IngestEndpointCommands { color_mode: colored_json::ColorMode, ) -> anyhow::Result<()> { match self { - Self::List { options } => { + Self::List { source_id, options } => { let resp = client .ingest() .endpoint() - .list(Some(options.into())) + .list(source_id, Some(options.into())) .await?; crate::json::print_json_output(&resp, color_mode)?; } Self::Create { + source_id, ingest_endpoint_in, options, } => { let resp = client .ingest() .endpoint() - .create(ingest_endpoint_in.into_inner(), Some(options.into())) + .create( + source_id, + ingest_endpoint_in.into_inner(), + Some(options.into()), + ) .await?; crate::json::print_json_output(&resp, color_mode)?; } - Self::Get { endpoint_id } => { - let resp = client.ingest().endpoint().get(endpoint_id).await?; + Self::Get { + source_id, + endpoint_id, + } => { + let resp = client + .ingest() + .endpoint() + .get(source_id, endpoint_id) + .await?; crate::json::print_json_output(&resp, color_mode)?; } Self::Update { + source_id, endpoint_id, ingest_endpoint_update, } => { let resp = client .ingest() .endpoint() - .update(endpoint_id, ingest_endpoint_update.into_inner()) + .update(source_id, endpoint_id, ingest_endpoint_update.into_inner()) .await?; crate::json::print_json_output(&resp, color_mode)?; } - Self::Delete { endpoint_id } => { - client.ingest().endpoint().delete(endpoint_id).await?; + Self::Delete { + source_id, + endpoint_id, + } => { + client + .ingest() + .endpoint() + .delete(source_id, endpoint_id) + .await?; } - Self::GetHeaders { endpoint_id } => { - let resp = client.ingest().endpoint().get_headers(endpoint_id).await?; + Self::GetHeaders { + source_id, + endpoint_id, + } => { + let resp = client + .ingest() + .endpoint() + .get_headers(source_id, endpoint_id) + .await?; crate::json::print_json_output(&resp, color_mode)?; } Self::UpdateHeaders { + source_id, endpoint_id, ingest_endpoint_headers_in, } => { client .ingest() .endpoint() - .update_headers(endpoint_id, ingest_endpoint_headers_in.into_inner()) + .update_headers( + source_id, + endpoint_id, + ingest_endpoint_headers_in.into_inner(), + ) .await?; } - Self::GetSecret { endpoint_id } => { - let resp = client.ingest().endpoint().get_secret(endpoint_id).await?; + Self::GetSecret { + source_id, + endpoint_id, + } => { + let resp = client + .ingest() + .endpoint() + .get_secret(source_id, endpoint_id) + .await?; crate::json::print_json_output(&resp, color_mode)?; } Self::RotateSecret { + source_id, endpoint_id, ingest_endpoint_secret_in, options, @@ -180,6 +237,7 @@ impl IngestEndpointCommands { .ingest() .endpoint() .rotate_secret( + source_id, endpoint_id, ingest_endpoint_secret_in.unwrap_or_default().into_inner(), Some(options.into()),