From 6970d5e27cff1589b1cd8c4c27d3d5ca48cbb437 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 6 Mar 2025 18:05:54 +0100 Subject: [PATCH] Upgrade OpenAPI spec and Rust SDK Other SDKs are disabled in codegen.toml for now and will be re-enabled in subsequent PRs. --- codegen.toml | 228 +- lib-openapi.json | 3234 ++++++++++++----- regen_openapi.py | 2 +- rust/src/api/ingest.rs | 33 +- rust/src/api/ingest_source.rs | 120 + rust/src/api/mod.rs | 5 + rust/src/models/adobe_sign_config.rs | 14 + rust/src/models/adobe_sign_config_out.rs | 11 + rust/src/models/connector_out.rs | 75 + rust/src/models/cron_config.rs | 26 + rust/src/models/docusign_config.rs | 14 + rust/src/models/docusign_config_out.rs | 11 + rust/src/models/environment_out.rs | 6 +- rust/src/models/github_config.rs | 14 + rust/src/models/github_config_out.rs | 11 + rust/src/models/hubspot_config.rs | 14 + rust/src/models/hubspot_config_out.rs | 11 + ...ingest_source_consumer_portal_access_in.rs | 25 + rust/src/models/ingest_source_in.rs | 57 + rust/src/models/ingest_source_out.rs | 72 + .../models/list_response_ingest_source_out.rs | 29 + rust/src/models/mod.rs | 56 +- rust/src/models/rotate_token_out.rs | 14 + rust/src/models/segment_config.rs | 14 + rust/src/models/segment_config_out.rs | 11 + rust/src/models/shopify_config.rs | 13 + rust/src/models/shopify_config_out.rs | 11 + rust/src/models/slack_config.rs | 13 + rust/src/models/slack_config_out.rs | 11 + rust/src/models/stripe_config.rs | 13 + rust/src/models/stripe_config_out.rs | 11 + rust/src/models/svix_config.rs | 13 + rust/src/models/svix_config_out.rs | 11 + rust/src/models/zoom_config.rs | 13 + rust/src/models/zoom_config_out.rs | 11 + rust/templates/types/struct_enum.rs.jinja | 19 +- 36 files changed, 3187 insertions(+), 1059 deletions(-) create mode 100644 rust/src/api/ingest_source.rs create mode 100644 rust/src/models/adobe_sign_config.rs create mode 100644 rust/src/models/adobe_sign_config_out.rs create mode 100644 rust/src/models/connector_out.rs create mode 100644 rust/src/models/cron_config.rs create mode 100644 rust/src/models/docusign_config.rs create mode 100644 rust/src/models/docusign_config_out.rs create mode 100644 rust/src/models/github_config.rs create mode 100644 rust/src/models/github_config_out.rs create mode 100644 rust/src/models/hubspot_config.rs create mode 100644 rust/src/models/hubspot_config_out.rs create mode 100644 rust/src/models/ingest_source_consumer_portal_access_in.rs create mode 100644 rust/src/models/ingest_source_in.rs create mode 100644 rust/src/models/ingest_source_out.rs create mode 100644 rust/src/models/list_response_ingest_source_out.rs create mode 100644 rust/src/models/rotate_token_out.rs create mode 100644 rust/src/models/segment_config.rs create mode 100644 rust/src/models/segment_config_out.rs create mode 100644 rust/src/models/shopify_config.rs create mode 100644 rust/src/models/shopify_config_out.rs create mode 100644 rust/src/models/slack_config.rs create mode 100644 rust/src/models/slack_config_out.rs create mode 100644 rust/src/models/stripe_config.rs create mode 100644 rust/src/models/stripe_config_out.rs create mode 100644 rust/src/models/svix_config.rs create mode 100644 rust/src/models/svix_config_out.rs create mode 100644 rust/src/models/zoom_config.rs create mode 100644 rust/src/models/zoom_config_out.rs diff --git a/codegen.toml b/codegen.toml index ba44c2433..a2b6fe4cc 100644 --- a/codegen.toml +++ b/codegen.toml @@ -16,117 +16,117 @@ template = "rust/templates/component_type.rs.jinja" output_dir = "rust/src/models" -[javascript] -template_dir = "javascript/templates" -extra_shell_commands = ["rm javascript/src/api/{ingest,operationalWebhook}.ts"] -[[javascript.task]] -template = "javascript/templates/api_resource.ts.jinja" -output_dir = "javascript/src/api" -[[javascript.task]] -template = "javascript/templates/component_type_summary.ts.jinja" -output_dir = "javascript/src/models" -[[javascript.task]] -template = "javascript/templates/component_type.ts.jinja" -output_dir = "javascript/src/models" - - -[cli] -template_dir = "svix-cli/templates" -extra_mounts = { "svix-cli/.rustfmt.toml" = "/app/.rustfmt.toml" } -extra_shell_commands = [ - "cargo fix --manifest-path svix-cli/Cargo.toml --allow-dirty", - "cargo fmt --manifest-path svix-cli/Cargo.toml", - "rm svix-cli/src/cmds/api/{ingest,operational_webhook,background_task,environment,health,operational_webhook_endpoint,statistics}.rs", -] -[[cli.task]] -template = "svix-cli/templates/api_resource.rs.jinja" -output_dir = "svix-cli/src/cmds/api" - - -[python] -template_dir = "python/templates" -extra_shell_commands = [ - "rm python/svix/api/{environment,health,ingest,operational_webhook}.py", -] -[[python.task]] -template = "python/templates/api_resource.py.jinja" -output_dir = "python/svix/api" -[[python.task]] -template = "python/templates/component_type_summary.py.jinja" -output_dir = "python/svix/models" -[[python.task]] -template = "python/templates/component_type.py.jinja" -output_dir = "python/svix/models" - - -[ruby] -template_dir = "ruby/templates" -extra_shell_commands = ["rm ruby/lib/svix/api/{ingest,operational_webhook}.rb"] -[[ruby.task]] -template = "ruby/templates/api_resource.rb.jinja" -output_dir = "ruby/lib/svix/api" -[[ruby.task]] -template = "ruby/templates/summary.rb.jinja" -output_dir = "ruby/lib" -[[ruby.task]] -template = "ruby/templates/component_type.rb.jinja" -output_dir = "ruby/lib/svix/models" - - -[csharp] -template_dir = "csharp/templates" -extra_shell_commands = [ - "rm csharp/Svix/{IngestEndpoint,Ingest,OperationalWebhook}.cs", -] -[[csharp.task]] -template = "csharp/templates/api_resource.cs.jinja" -output_dir = "csharp/Svix" -[[csharp.task]] -template = "csharp/templates/component_type.cs.jinja" -output_dir = "csharp/Svix/Models" - - -[java] -template_dir = "java/templates" -extra_shell_commands = [ - "rm java/lib/src/main/java/com/svix/api/{OperationalWebhook,Ingest}.java", -] -[[java.task]] -template = "java/templates/api_resource.java.jinja" -output_dir = "java/lib/src/main/java/com/svix/api" -[[java.task]] -template = "java/templates/operation_options.java.jinja" -output_dir = "java/lib/src/main/java/com/svix/api" -[[java.task]] -template = "java/templates/component_type.java.jinja" -output_dir = "java/lib/src/main/java/com/svix/models" - - -[go] -template_dir = "openapi-templates/go" -extra_shell_commands = [ - "rm go/{environment,health,ingest_endpoint,ingest,operational_webhook}.go", -] -[[go.task]] -template = "openapi-templates/go/api_resource.go.jinja" -output_dir = "go" -[[go.task]] -template = "openapi-templates/go/component_type_summary.go.jinja" -output_dir = "go" -[[go.task]] -template = "openapi-templates/go/component_type.go.jinja" -output_dir = "go/models" - - -[kotlin] -extra_shell_commands = [ - "rm kotlin/lib/src/main/kotlin/{Ingest,OperationalWebhook}.kt", -] -template_dir = "kotlin/templates" -[[kotlin.task]] -template = "kotlin/templates/component_type.kt.jinja" -output_dir = "kotlin/lib/src/main/kotlin/models" - -[[kotlin.task]] -template = "kotlin/templates/api_resource.kt.jinja" -output_dir = "kotlin/lib/src/main/kotlin" +#[javascript] +#template_dir = "javascript/templates" +#extra_shell_commands = ["rm javascript/src/api/{ingest,operationalWebhook}.ts"] +#[[javascript.task]] +#template = "javascript/templates/api_resource.ts.jinja" +#output_dir = "javascript/src/api" +#[[javascript.task]] +#template = "javascript/templates/component_type_summary.ts.jinja" +#output_dir = "javascript/src/models" +#[[javascript.task]] +#template = "javascript/templates/component_type.ts.jinja" +#output_dir = "javascript/src/models" +# +# +#[cli] +#template_dir = "svix-cli/templates" +#extra_mounts = { "svix-cli/.rustfmt.toml" = "/app/.rustfmt.toml" } +#extra_shell_commands = [ +# "cargo fix --manifest-path svix-cli/Cargo.toml --allow-dirty", +# "cargo fmt --manifest-path svix-cli/Cargo.toml", +# "rm svix-cli/src/cmds/api/{ingest,operational_webhook,background_task,environment,health,operational_webhook_endpoint,statistics}.rs", +#] +#[[cli.task]] +#template = "svix-cli/templates/api_resource.rs.jinja" +#output_dir = "svix-cli/src/cmds/api" +# +# +#[python] +#template_dir = "python/templates" +#extra_shell_commands = [ +# "rm python/svix/api/{environment,health,ingest,operational_webhook}.py", +#] +#[[python.task]] +#template = "python/templates/api_resource.py.jinja" +#output_dir = "python/svix/api" +#[[python.task]] +#template = "python/templates/component_type_summary.py.jinja" +#output_dir = "python/svix/models" +#[[python.task]] +#template = "python/templates/component_type.py.jinja" +#output_dir = "python/svix/models" +# +# +#[ruby] +#template_dir = "ruby/templates" +#extra_shell_commands = ["rm ruby/lib/svix/api/{ingest,operational_webhook}.rb"] +#[[ruby.task]] +#template = "ruby/templates/api_resource.rb.jinja" +#output_dir = "ruby/lib/svix/api" +#[[ruby.task]] +#template = "ruby/templates/summary.rb.jinja" +#output_dir = "ruby/lib" +#[[ruby.task]] +#template = "ruby/templates/component_type.rb.jinja" +#output_dir = "ruby/lib/svix/models" +# +# +#[csharp] +#template_dir = "csharp/templates" +#extra_shell_commands = [ +# "rm csharp/Svix/{IngestEndpoint,Ingest,OperationalWebhook}.cs", +#] +#[[csharp.task]] +#template = "csharp/templates/api_resource.cs.jinja" +#output_dir = "csharp/Svix" +#[[csharp.task]] +#template = "csharp/templates/component_type.cs.jinja" +#output_dir = "csharp/Svix/Models" +# +# +#[java] +#template_dir = "java/templates" +#extra_shell_commands = [ +# "rm java/lib/src/main/java/com/svix/api/{OperationalWebhook,Ingest}.java", +#] +#[[java.task]] +#template = "java/templates/api_resource.java.jinja" +#output_dir = "java/lib/src/main/java/com/svix/api" +#[[java.task]] +#template = "java/templates/operation_options.java.jinja" +#output_dir = "java/lib/src/main/java/com/svix/api" +#[[java.task]] +#template = "java/templates/component_type.java.jinja" +#output_dir = "java/lib/src/main/java/com/svix/models" +# +# +#[go] +#template_dir = "openapi-templates/go" +#extra_shell_commands = [ +# "rm go/{environment,health,ingest_endpoint,ingest,operational_webhook}.go", +#] +#[[go.task]] +#template = "openapi-templates/go/api_resource.go.jinja" +#output_dir = "go" +#[[go.task]] +#template = "openapi-templates/go/component_type_summary.go.jinja" +#output_dir = "go" +#[[go.task]] +#template = "openapi-templates/go/component_type.go.jinja" +#output_dir = "go/models" +# +# +#[kotlin] +#extra_shell_commands = [ +# "rm kotlin/lib/src/main/kotlin/{Ingest,OperationalWebhook}.kt", +#] +#template_dir = "kotlin/templates" +#[[kotlin.task]] +#template = "kotlin/templates/component_type.kt.jinja" +#output_dir = "kotlin/lib/src/main/kotlin/models" +# +#[[kotlin.task]] +#template = "kotlin/templates/api_resource.kt.jinja" +#output_dir = "kotlin/lib/src/main/kotlin" diff --git a/lib-openapi.json b/lib-openapi.json index 5f619e91a..05334f1da 100644 --- a/lib-openapi.json +++ b/lib-openapi.json @@ -99,6 +99,9 @@ ], "type": "object" }, + "AdobeSignConfigOut": { + "type": "object" + }, "AdobeSignResponse": { "properties": { "xAdobeSignClientId": { @@ -930,6 +933,150 @@ ], "type": "string" }, + "ConnectorOut": { + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "description": { + "type": "string" + }, + "featureFlag": { + "example": "cool-new-feature", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "filterTypes": { + "example": [ + "user.signup", + "user.deleted" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "id": { + "description": "The TransformationTemplate's ID.", + "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 34, + "minLength": 34, + "pattern": "^trtmpl_[A-Za-z0-9]{27}$", + "type": "string" + }, + "instructions": { + "type": "string" + }, + "instructionsLink": { + "format": "uri", + "nullable": true, + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/ConnectorKind" + }, + "logo": { + "format": "uri", + "type": "string" + }, + "name": { + "type": "string" + }, + "orgId": { + "description": "The Organization's ID.", + "example": "org_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 31, + "minLength": 31, + "pattern": "^org_[A-Za-z0-9]{27}$", + "type": "string" + }, + "transformation": { + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "createdAt", + "description", + "id", + "instructions", + "kind", + "logo", + "name", + "orgId", + "transformation", + "updatedAt" + ], + "type": "object" + }, + "ConnectorPatch": { + "properties": { + "description": { + "type": "string" + }, + "featureFlag": { + "example": "cool-new-feature", + "maxLength": 256, + "nullable": true, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "filterTypes": { + "example": [ + "user.signup", + "user.deleted" + ], + "items": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "minItems": 1, + "nullable": true, + "type": "array", + "uniqueItems": true + }, + "instructions": { + "type": "string" + }, + "instructionsLink": { + "format": "uri", + "nullable": true, + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/ConnectorKind" + }, + "logo": { + "format": "uri", + "type": "string" + }, + "name": { + "type": "string" + }, + "transformation": { + "maxLength": 51200, + "minLength": 10, + "type": "string" + } + }, + "type": "object" + }, "CountOut": { "properties": { "approximated": { @@ -1212,6 +1359,9 @@ }, "type": "object" }, + "DocusignConfigOut": { + "type": "object" + }, "Duration": { "properties": { "nanos": { @@ -2412,7 +2562,7 @@ }, "transformationTemplates": { "items": { - "$ref": "#/components/schemas/TemplateOut" + "$ref": "#/components/schemas/ConnectorOut" }, "type": "array" }, @@ -3200,6 +3350,9 @@ }, "type": "object" }, + "GithubConfigOut": { + "type": "object" + }, "GoogleCloudStorageConfig": { "description": "Configuration for a Google Cloud Storage sink.\n\nWrite stream events into the named bucket using the supplied Google Cloud credentials.", "properties": { @@ -3256,6 +3409,9 @@ }, "type": "object" }, + "HubspotConfigOut": { + "type": "object" + }, "HubspotOauthConfigIn": { "properties": { "refresh_token": { @@ -3664,6 +3820,24 @@ ], "description": "Some providers need to generate responses to incoming ingest requests." }, + "IngestSourceConsumerPortalAccessIn": { + "properties": { + "expiry": { + "description": "How long the token will be valid for, in seconds.\n\nValid values are between 1 hour and 7 days. The default is 7 days.", + "format": "uint64", + "maximum": 604800, + "minimum": 3600, + "nullable": true, + "type": "integer" + }, + "readOnly": { + "description": "Whether the app portal should be in read-only mode.", + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + }, "IngestSourceIn": { "oneOf": [ { @@ -3671,7 +3845,7 @@ "properties": { "type": { "enum": [ - "genericWebhook" + "generic-webhook" ], "type": "string" } @@ -3706,7 +3880,7 @@ }, "type": { "enum": [ - "adobeSign" + "adobe-sign" ], "type": "string" } @@ -3850,7 +4024,7 @@ }, "type": { "enum": [ - "incidentIo" + "incident-io" ], "type": "string" } @@ -4120,14 +4294,6 @@ "minLength": 2, "type": "string" }, - "transformation": { - "nullable": true, - "type": "string" - }, - "transformationEnabled": { - "default": false, - "type": "boolean" - }, "uid": { "description": "The Source's UID.", "example": "unique-identifier", @@ -4146,11 +4312,10 @@ "IngestSourceOut": { "oneOf": [ { - "description": "Webhooks with no verification scheme or special handling.", "properties": { "type": { "enum": [ - "genericWebhook" + "generic-webhook" ], "type": "string" } @@ -4181,11 +4346,11 @@ { "properties": { "config": { - "$ref": "#/components/schemas/AdobeSignConfig" + "$ref": "#/components/schemas/AdobeSignConfigOut" }, "type": { "enum": [ - "adobeSign" + "adobe-sign" ], "type": "string" } @@ -4199,7 +4364,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4217,7 +4382,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4235,7 +4400,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4253,7 +4418,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/DocusignConfig" + "$ref": "#/components/schemas/DocusignConfigOut" }, "type": { "enum": [ @@ -4271,7 +4436,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/GithubConfig" + "$ref": "#/components/schemas/GithubConfigOut" }, "type": { "enum": [ @@ -4289,7 +4454,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4307,7 +4472,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/HubspotConfig" + "$ref": "#/components/schemas/HubspotConfigOut" }, "type": { "enum": [ @@ -4325,11 +4490,11 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ - "incidentIo" + "incident-io" ], "type": "string" } @@ -4343,7 +4508,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4361,7 +4526,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4379,7 +4544,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4397,7 +4562,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4415,7 +4580,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4433,7 +4598,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4451,7 +4616,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4469,7 +4634,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SegmentConfig" + "$ref": "#/components/schemas/SegmentConfigOut" }, "type": { "enum": [ @@ -4487,7 +4652,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/ShopifyConfig" + "$ref": "#/components/schemas/ShopifyConfigOut" }, "type": { "enum": [ @@ -4505,7 +4670,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SlackConfig" + "$ref": "#/components/schemas/SlackConfigOut" }, "type": { "enum": [ @@ -4523,7 +4688,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/StripeConfig" + "$ref": "#/components/schemas/StripeConfigOut" }, "type": { "enum": [ @@ -4541,7 +4706,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4559,7 +4724,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/SvixConfig" + "$ref": "#/components/schemas/SvixConfigOut" }, "type": { "enum": [ @@ -4577,7 +4742,7 @@ { "properties": { "config": { - "$ref": "#/components/schemas/ZoomConfig" + "$ref": "#/components/schemas/ZoomConfigOut" }, "type": { "enum": [ @@ -4614,13 +4779,6 @@ "name": { "type": "string" }, - "transformation": { - "nullable": true, - "type": "string" - }, - "transformationEnabled": { - "type": "boolean" - }, "uid": { "description": "The Source's UID.", "example": "unique-identifier", @@ -4639,7 +4797,6 @@ "createdAt", "id", "name", - "transformationEnabled", "updatedAt" ], "type": "object" @@ -4878,6 +5035,35 @@ ], "type": "object" }, + "ListResponse_ConnectorOut_": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ConnectorOut" + }, + "type": "array" + }, + "done": { + "type": "boolean" + }, + "iterator": { + "example": "iterator", + "nullable": true, + "type": "string" + }, + "prevIterator": { + "example": "-iterator", + "nullable": true, + "type": "string" + } + }, + "required": [ + "data", + "done", + "iterator" + ], + "type": "object" + }, "ListResponse_EndpointMessageOut_": { "properties": { "data": { @@ -5342,35 +5528,6 @@ ], "type": "object" }, - "ListResponse_TemplateOut_": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/TemplateOut" - }, - "type": "array" - }, - "done": { - "type": "boolean" - }, - "iterator": { - "example": "iterator", - "nullable": true, - "type": "string" - }, - "prevIterator": { - "example": "-iterator", - "nullable": true, - "type": "string" - } - }, - "required": [ - "data", - "done", - "iterator" - ], - "type": "object" - }, "MessageAttemptEndpointOut": { "properties": { "endpointId": { @@ -7028,6 +7185,9 @@ }, "type": "object" }, + "SegmentConfigOut": { + "type": "object" + }, "ShopifyConfig": { "properties": { "secret": { @@ -7039,6 +7199,9 @@ ], "type": "object" }, + "ShopifyConfigOut": { + "type": "object" + }, "SinkHttpConfig": { "properties": { "headers": { @@ -7578,6 +7741,9 @@ ], "type": "object" }, + "SlackConfigOut": { + "type": "object" + }, "SnowflakeConfig": { "description": "Configuration parameters for defining a Snowflake sink.", "properties": { @@ -7613,6 +7779,31 @@ ], "type": "object" }, + "SqsConfig": { + "description": "Configuration for an SQS sink.", + "properties": { + "accessKeyId": { + "type": "string" + }, + "queueUrl": { + "format": "uri", + "type": "string" + }, + "region": { + "type": "string" + }, + "secretAccessKey": { + "type": "string" + } + }, + "required": [ + "accessKeyId", + "queueUrl", + "region", + "secretAccessKey" + ], + "type": "object" + }, "StatisticsPeriod": { "description": "Period length for a statistics data point.", "enum": [ @@ -7986,6 +8177,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/SqsConfig" + }, + "type": { + "enum": [ + "sqs" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -8204,6 +8413,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/SqsConfig" + }, + "type": { + "enum": [ + "sqs" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -8440,6 +8667,24 @@ "type" ], "type": "object" + }, + { + "properties": { + "config": { + "$ref": "#/components/schemas/SqsConfig" + }, + "type": { + "enum": [ + "sqs" + ], + "type": "string" + } + }, + "required": [ + "config", + "type" + ], + "type": "object" } ], "properties": { @@ -8502,6 +8747,9 @@ ], "type": "object" }, + "StripeConfigOut": { + "type": "object" + }, "SvixConfig": { "properties": { "secret": { @@ -8513,148 +8761,7 @@ ], "type": "object" }, - "TemplateOut": { - "properties": { - "createdAt": { - "format": "date-time", - "type": "string" - }, - "description": { - "type": "string" - }, - "featureFlag": { - "example": "cool-new-feature", - "maxLength": 256, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "filterTypes": { - "example": [ - "user.signup", - "user.deleted" - ], - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "minItems": 1, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "id": { - "description": "The TransformationTemplate's ID.", - "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 34, - "minLength": 34, - "pattern": "^trtmpl_[A-Za-z0-9]{27}$", - "type": "string" - }, - "instructions": { - "type": "string" - }, - "instructionsLink": { - "format": "uri", - "nullable": true, - "type": "string" - }, - "kind": { - "$ref": "#/components/schemas/ConnectorKind" - }, - "logo": { - "format": "uri", - "type": "string" - }, - "name": { - "type": "string" - }, - "orgId": { - "description": "The Organization's ID.", - "example": "org_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 31, - "minLength": 31, - "pattern": "^org_[A-Za-z0-9]{27}$", - "type": "string" - }, - "transformation": { - "type": "string" - }, - "updatedAt": { - "format": "date-time", - "type": "string" - } - }, - "required": [ - "createdAt", - "description", - "id", - "instructions", - "kind", - "logo", - "name", - "orgId", - "transformation", - "updatedAt" - ], - "type": "object" - }, - "TemplatePatch": { - "properties": { - "description": { - "type": "string" - }, - "featureFlag": { - "example": "cool-new-feature", - "maxLength": 256, - "nullable": true, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "filterTypes": { - "example": [ - "user.signup", - "user.deleted" - ], - "items": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", - "type": "string" - }, - "minItems": 1, - "nullable": true, - "type": "array", - "uniqueItems": true - }, - "instructions": { - "type": "string" - }, - "instructionsLink": { - "format": "uri", - "nullable": true, - "type": "string" - }, - "kind": { - "$ref": "#/components/schemas/ConnectorKind" - }, - "logo": { - "format": "uri", - "type": "string" - }, - "name": { - "type": "string" - }, - "transformation": { - "maxLength": 51200, - "minLength": 10, - "type": "string" - } - }, + "SvixConfigOut": { "type": "object" }, "TemplateUpdate": { @@ -8824,6 +8931,9 @@ ], "type": "object" }, + "ZoomConfigOut": { + "type": "object" + }, "ZoomCrcResponse": { "properties": { "encryptedToken": { @@ -8851,7 +8961,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.61.3", + "version": "1.59.2", "x-logo": { "altText": "Svix Logo", "url": "https://www.svix.com/static/img/brand-padded.svg" @@ -29979,36 +30089,1244 @@ "HTTPBearer": [] } ], - "summary": "Delete Stream Event Type", + "summary": "Delete Stream Event Type", + "tags": [ + "Stream Event Types" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + }, + "get": { + "description": "Get an event type.", + "operationId": "v1.stream.event-type.get", + "parameters": [ + { + "description": "The event type's name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypeOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Stream Event Type", + "tags": [ + "Stream Event Types" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + }, + "patch": { + "description": "Patch an event type for Streams.", + "operationId": "v1.stream.event-type.patch", + "parameters": [ + { + "description": "The event type's name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypePatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypeOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Patch Stream Event Type", + "tags": [ + "Stream Event Types" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": null\n }'" + } + ], + "x-hidden": true + }, + "put": { + "description": "Update or create a event type for Streams.", + "operationId": "v1.stream.event-type.update", + "parameters": [ + { + "description": "The event type's name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "description": "The event type's name", + "example": "user.signup", + "maxLength": 256, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypeIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypeOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamEventTypeOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Update Stream Event Type", + "tags": [ + "Stream Event Types" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": null\n }'" + } + ], + "x-hidden": true + } + }, + "/api/v1/stream/{stream_id}": { + "delete": { + "description": "Delete a stream.", + "operationId": "v1.stream.stream.delete", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Delete Stream", + "tags": [ + "Stream" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + }, + "get": { + "description": "Get a stream by id or uid.", + "operationId": "v1.stream.stream.get", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Stream", + "tags": [ + "Stream" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + }, + "patch": { + "description": "Partially update a stream.", + "operationId": "v1.stream.stream.patch", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamPatch" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Patch Stream", + "tags": [ + "Stream" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" + } + ], + "x-hidden": true + }, + "put": { + "description": "Update a stream.", + "operationId": "v1.stream.stream.update", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamIn" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StreamOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Update Stream", + "tags": [ + "Stream" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" + } + ], + "x-hidden": true + } + }, + "/api/v1/stream/{stream_id}/events": { + "get": { + "description": "Iterate over a stream of events.", + "operationId": "v1.stream.events.get", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, + { + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "after", + "schema": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EventStreamOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Stream Events", + "tags": [ + "Stream" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + }, + "post": { + "description": "Creates events on the Stream.", + "operationId": "v1.stream.events.create", + "parameters": [ + { + "description": "The Stream's ID or UID.", + "in": "path", + "name": "stream_id", + "required": true, + "schema": { + "description": "The Stream's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, + "type": "string" + }, + "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStreamIn" + } + } + }, + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStreamOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Create Events", "tags": [ - "Stream Event Types" + "Stream" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"stream\": null\n }'" } ], "x-hidden": true - }, + } + }, + "/api/v1/transformation-template": { "get": { - "description": "Get an event type.", - "operationId": "v1.stream.event-type.get", + "description": "List all transformation templates for an application.", + "operationId": "v1.beta.connector.list", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "name", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 34, + "minLength": 34, + "nullable": true, + "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], "responses": { @@ -30016,7 +31334,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamEventTypeOut" + "$ref": "#/components/schemas/ListResponse_ConnectorOut_" } } }, @@ -30098,33 +31416,28 @@ "HTTPBearer": [] } ], - "summary": "Get Stream Event Type", + "summary": "List Transformation Templates", "tags": [ - "Stream Event Types" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/transformation-template' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ], "x-hidden": true }, - "patch": { - "description": "Patch an event type for Streams.", - "operationId": "v1.stream.event-type.patch", + "post": { + "description": "Create a new connector.", + "operationId": "v1.beta.connector.create", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "name", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -30134,18 +31447,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamEventTypePatch" + "$ref": "#/components/schemas/ConnectorIn" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamEventTypeOut" + "$ref": "#/components/schemas/ConnectorOut" } } }, @@ -30227,33 +31540,30 @@ "HTTPBearer": [] } ], - "summary": "Patch Stream Event Type", + "summary": "Create Transformation Template", "tags": [ - "Stream Event Types" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" } ], "x-hidden": true - }, - "put": { - "description": "Update or create a event type for Streams.", - "operationId": "v1.stream.event-type.update", + } + }, + "/api/v1/transformation-template/generate": { + "post": { + "description": "Use OpenAI's Completion API to generate code for a connector.", + "operationId": "v1.beta.connector.generate", "parameters": [ { - "description": "The event type's name", - "in": "path", - "name": "name", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The event type's name", - "example": "user.signup", - "maxLength": 256, - "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" @@ -30263,7 +31573,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamEventTypeIn" + "$ref": "#/components/schemas/GenerateIn" } } }, @@ -30274,17 +31584,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamEventTypeOut" - } - } - }, - "description": "" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StreamEventTypeOut" + "$ref": "#/components/schemas/GenerateOut" } } }, @@ -30366,43 +31666,55 @@ "HTTPBearer": [] } ], - "summary": "Update Stream Event Type", + "summary": "Generate", "tags": [ - "Stream Event Types" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stream/event-type/{name}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"name\": \"user.signup\",\n \"description\": null\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/generate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" } ], "x-hidden": true } }, - "/api/v1/stream/{stream_id}": { - "delete": { - "description": "Delete a stream.", - "operationId": "v1.stream.stream.delete", + "/api/v1/transformation-template/oauth/discord": { + "post": { + "description": "Get Discord Incoming webhook URL.", + "operationId": "v1.beta.connector.oauth.discord", "parameters": [ { - "description": "The Stream's ID or UID.", - "in": "path", - "name": "stream_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthPayloadIn" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IncomingWebhookPayloadOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -30480,44 +31792,51 @@ "HTTPBearer": [] } ], - "summary": "Delete Stream", + "summary": "Authorize Discord", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/discord' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" } ], "x-hidden": true - }, - "get": { - "description": "Get a stream by id or uid.", - "operationId": "v1.stream.stream.get", + } + }, + "/api/v1/transformation-template/oauth/hubspot": { + "post": { + "description": "Get Hubspot access token using authorization code.", + "operationId": "v1.beta.connector.oauth.hubspot", "parameters": [ { - "description": "The Stream's ID or UID.", - "in": "path", - "name": "stream_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OAuthPayloadIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamOut" + "$ref": "#/components/schemas/OAuthPayloadOut" } } }, @@ -30599,33 +31918,30 @@ "HTTPBearer": [] } ], - "summary": "Get Stream", + "summary": "Authorize Hubspot", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" } ], "x-hidden": true - }, - "patch": { - "description": "Partially update a stream.", - "operationId": "v1.stream.stream.patch", + } + }, + "/api/v1/transformation-template/oauth/slack": { + "post": { + "description": "Get Slack Incoming webhook URL.", + "operationId": "v1.beta.connector.oauth.slack", "parameters": [ { - "description": "The Stream's ID or UID.", - "in": "path", - "name": "stream_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, "type": "string" }, "style": "simple" @@ -30635,7 +31951,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamPatch" + "$ref": "#/components/schemas/OAuthPayloadIn" } } }, @@ -30646,7 +31962,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamOut" + "$ref": "#/components/schemas/IncomingWebhookPayloadOut" } } }, @@ -30728,33 +32044,30 @@ "HTTPBearer": [] } ], - "summary": "Patch Stream", + "summary": "Authorize Slack", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/slack' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" } ], "x-hidden": true - }, - "put": { - "description": "Update a stream.", - "operationId": "v1.stream.stream.update", + } + }, + "/api/v1/transformation-template/simulate": { + "post": { + "description": "Simulate running the transformation on the payload and code.", + "operationId": "v1.beta.connector.simulate", "parameters": [ { - "description": "The Stream's ID or UID.", - "in": "path", - "name": "stream_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, "type": "string" }, "style": "simple" @@ -30764,7 +32077,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamIn" + "$ref": "#/components/schemas/TransformationSimulateIn" } } }, @@ -30775,17 +32088,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StreamOut" - } - } - }, - "description": "" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StreamOut" + "$ref": "#/components/schemas/TransformationSimulateOut" } } }, @@ -30867,84 +32170,44 @@ "HTTPBearer": [] } ], - "summary": "Update Stream", + "summary": "Simulate", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/simulate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n }'" } ], "x-hidden": true } }, - "/api/v1/stream/{stream_id}/events": { - "get": { - "description": "Iterate over a stream of events.", - "operationId": "v1.stream.events.get", + "/api/v1/transformation-template/{transformation_template_id}": { + "delete": { + "description": "Delete a connector.", + "operationId": "v1.beta.connector.delete", "parameters": [ { - "description": "The Stream's ID or UID.", + "description": "The TransformationTemplate's ID.", "in": "path", - "name": "stream_id", + "name": "transformation_template_id", "required": true, "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, + "description": "The TransformationTemplate's ID.", + "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 34, + "minLength": 34, + "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, "style": "simple" - }, - { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", - "schema": { - "description": "The iterator returned from a prior invocation", - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "after", - "schema": { - "format": "date-time", - "nullable": true, - "type": "string" - }, - "style": "form" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EventStreamOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -31022,63 +32285,45 @@ "HTTPBearer": [] } ], - "summary": "Stream Events", + "summary": "Delete Transformation Template", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ], "x-hidden": true }, - "post": { - "description": "Creates events on the Stream.", - "operationId": "v1.stream.events.create", + "get": { + "description": "Get a connector.", + "operationId": "v1.beta.connector.get", "parameters": [ { - "description": "The Stream's ID or UID.", + "description": "The TransformationTemplate's ID.", "in": "path", - "name": "stream_id", + "name": "transformation_template_id", "required": true, "schema": { - "description": "The Stream's ID or UID.", - "example": "unique-identifier", - "maxLength": 60, - "minLength": 1, - "type": "string" - }, - "style": "simple" - }, - { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", - "schema": { + "description": "The TransformationTemplate's ID.", + "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 34, + "minLength": 34, + "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateStreamIn" - } - } - }, - "required": true - }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateStreamOut" + "$ref": "#/components/schemas/ConnectorOut" } } }, @@ -31160,71 +32405,55 @@ "HTTPBearer": [] } ], - "summary": "Create Events", + "summary": "Get Transformation Template", "tags": [ - "Stream" + "Transformation Template" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/stream/{stream_id}/events' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"stream\": null\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ], "x-hidden": true - } - }, - "/api/v1/transformation-template": { - "get": { - "description": "List all transformation templates for an application.", - "operationId": "v1.beta.connector.list", + }, + "patch": { + "description": "Partially update a connector.", + "operationId": "v1.beta.connector.patch", "parameters": [ { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The TransformationTemplate's ID.", + "in": "path", + "name": "transformation_template_id", + "required": true, "schema": { - "description": "The iterator returned from a prior invocation", + "description": "The TransformationTemplate's ID.", "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", "maxLength": 34, "minLength": 34, - "nullable": true, "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" + "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorPatch" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListResponse_TemplateOut_" + "$ref": "#/components/schemas/ConnectorOut" } } }, @@ -31306,7 +32535,7 @@ "HTTPBearer": [] } ], - "summary": "List Transformation Templates", + "summary": "Patch Transformation Template", "tags": [ "Transformation Template" ], @@ -31314,20 +32543,26 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/transformation-template' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" } ], "x-hidden": true }, - "post": { - "description": "Create a new connector.", - "operationId": "v1.beta.connector.create", + "put": { + "description": "Update a connector.", + "operationId": "v1.beta.connector.update", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The TransformationTemplate's ID.", + "in": "path", + "name": "transformation_template_id", + "required": true, "schema": { + "description": "The TransformationTemplate's ID.", + "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 34, + "minLength": 34, + "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, "style": "simple" @@ -31337,18 +32572,28 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConnectorIn" + "$ref": "#/components/schemas/TemplateUpdate" } } }, "required": true }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorOut" + } + } + }, + "description": "" + }, "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateOut" + "$ref": "#/components/schemas/ConnectorOut" } } }, @@ -31430,7 +32675,7 @@ "HTTPBearer": [] } ], - "summary": "Create Transformation Template", + "summary": "Update Transformation Template", "tags": [ "Transformation Template" ], @@ -31438,43 +32683,63 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" } ], "x-hidden": true } }, - "/api/v1/transformation-template/generate": { - "post": { - "description": "Use OpenAI's Completion API to generate code for a connector.", - "operationId": "v1.beta.connector.generate", + "/ingest/api/v1/source": { + "get": { + "description": "List of all the organization's Ingest Sources.", + "operationId": "v1.ingest.source.list", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", + "schema": { + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", "schema": { + "description": "The iterator returned from a prior invocation", + "example": "src_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 26, + "minLength": 26, + "nullable": true, + "pattern": "^src_[A-Za-z0-9]{22}$", "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GenerateIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GenerateOut" + "$ref": "#/components/schemas/ListResponse_IngestSourceOut_" } } }, @@ -31556,24 +32821,21 @@ "HTTPBearer": [] } ], - "summary": "Generate", + "summary": "List Ingest Sources", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/generate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } - ], - "x-hidden": true - } - }, - "/api/v1/transformation-template/oauth/discord": { + ] + }, "post": { - "description": "Get Discord Incoming webhook URL.", - "operationId": "v1.beta.connector.oauth.discord", + "description": "Create Ingest Source.", + "operationId": "v1.ingest.source.create", "parameters": [ { "description": "The request's idempotency key", @@ -31589,18 +32851,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OAuthPayloadIn" + "$ref": "#/components/schemas/IngestSourceIn" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IncomingWebhookPayloadOut" + "$ref": "#/components/schemas/IngestSourceOut" } } }, @@ -31682,55 +32944,42 @@ "HTTPBearer": [] } ], - "summary": "Authorize Discord", + "summary": "Create Ingest Source", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/discord' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" } - ], - "x-hidden": true + ] } }, - "/api/v1/transformation-template/oauth/hubspot": { - "post": { - "description": "Get Hubspot access token using authorization code.", - "operationId": "v1.beta.connector.oauth.hubspot", + "/ingest/api/v1/source/{source_id}": { + "delete": { + "description": "Delete an Ingest Source.", + "operationId": "v1.ingest.source.delete", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "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" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OAuthPayloadIn" - } - } - }, - "required": true - }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OAuthPayloadOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -31808,51 +33057,43 @@ "HTTPBearer": [] } ], - "summary": "Authorize Hubspot", + "summary": "Delete Ingest Source", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/hubspot' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } - ], - "x-hidden": true - } - }, - "/api/v1/transformation-template/oauth/slack": { - "post": { - "description": "Get Slack Incoming webhook URL.", - "operationId": "v1.beta.connector.oauth.slack", + ] + }, + "get": { + "description": "Get an Ingest Source by id or uid.", + "operationId": "v1.ingest.source.get", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "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" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OAuthPayloadIn" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IncomingWebhookPayloadOut" + "$ref": "#/components/schemas/IngestSourceOut" } } }, @@ -31934,30 +33175,32 @@ "HTTPBearer": [] } ], - "summary": "Authorize Slack", + "summary": "Get Ingest Source", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/oauth/slack' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } - ], - "x-hidden": true - } - }, - "/api/v1/transformation-template/simulate": { - "post": { - "description": "Simulate running the transformation on the payload and code.", - "operationId": "v1.beta.connector.simulate", + ] + }, + "put": { + "description": "Update an Ingest Source.", + "operationId": "v1.ingest.source.update", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "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" @@ -31967,7 +33210,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransformationSimulateIn" + "$ref": "#/components/schemas/IngestSourceIn" } } }, @@ -31978,7 +33221,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransformationSimulateOut" + "$ref": "#/components/schemas/IngestSourceOut" + } + } + }, + "description": "" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestSourceOut" } } }, @@ -32060,160 +33313,64 @@ "HTTPBearer": [] } ], - "summary": "Simulate", + "summary": "Update Source", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/simulate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"eventType\": \"user.signup\",\n \"channels\": null\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"uid\": \"unique-identifier\"\n }'" } - ], - "x-hidden": true + ] } }, - "/api/v1/transformation-template/{transformation_template_id}": { - "delete": { - "description": "Delete a connector.", - "operationId": "v1.beta.connector.delete", + "/ingest/api/v1/source/{source_id}/dashboard": { + "post": { + "description": "Get access to the Ingest Source Consumer Portal.", + "operationId": "v1.ingest.dashboard", "parameters": [ { - "description": "The TransformationTemplate's ID.", + "description": "The Source's ID or UID.", "in": "path", - "name": "transformation_template_id", + "name": "source_id", "required": true, "schema": { - "description": "The TransformationTemplate's ID.", - "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 34, - "minLength": 34, - "pattern": "^trtmpl_[A-Za-z0-9]{27}$", + "description": "The Source's ID or UID.", + "example": "unique-identifier", + "maxLength": 60, + "minLength": 1, "type": "string" }, "style": "simple" - } - ], - "responses": { - "204": { - "description": "no content" - }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Forbidden" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Not Found" - }, - "409": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Conflict" }, - "422": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - }, - "description": "Validation Error" - }, - "429": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorOut" - } - } - }, - "description": "Too Many Requests" - } - }, - "security": [ - { - "HTTPBearer": [] - } - ], - "summary": "Delete Transformation Template", - "tags": [ - "Transformation Template" - ], - "x-codeSamples": [ { - "label": "cURL", - "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" - } - ], - "x-hidden": true - }, - "get": { - "description": "Get a connector.", - "operationId": "v1.beta.connector.get", - "parameters": [ - { - "description": "The TransformationTemplate's ID.", - "in": "path", - "name": "transformation_template_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The TransformationTemplate's ID.", - "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 34, - "minLength": 34, - "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestSourceConsumerPortalAccessIn" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateOut" + "$ref": "#/components/schemas/DashboardAccessOut" } } }, @@ -32295,55 +33452,125 @@ "HTTPBearer": [] } ], - "summary": "Get Transformation Template", + "summary": "Ingest Source Consumer Portal", "tags": [ - "Transformation Template" + "Ingest Source" ], "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.ingest.dashboard(\"source_id\", {\n expiry: null,\n readOnly: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const dashboardAccessOut = await svix.ingest.dashboard(\"source_id\", {\n expiry: null,\n readOnly: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "dashboard_access_out = svix.ingest.dashboard(\"source_id\", IngestSourceConsumerPortalAccessIn(\n expiry=None,\n read_only=None\n), options=...)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "dashboard_access_out = await svix.ingest.dashboard(\"source_id\", IngestSourceConsumerPortalAccessIn(\n expiry=None,\n read_only=None\n), options=...)" + }, + { + "label": "Go", + "lang": "Go", + "source": "dashboardAccessOut, err := svixClient.Ingest.Dashboard(ctx, \"source_id\", &IngestSourceConsumerPortalAccessIn{\n Expiry: nil,\n ReadOnly: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val dashboardAccessOut = svix.ingest.dashboard(\"source_id\", IngestSourceConsumerPortalAccessIn()\n .expiry(null)\n .readOnly(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "DashboardAccessOut dashboardAccessOut = svix.getIngest().dashboard(\"source_id\", new IngestSourceConsumerPortalAccessIn()\n .expiry(null)\n .readOnly(null)\n);" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "dashboard_access_out = svix.ingest.dashboard(\"source_id\", Svix::IngestSourceConsumerPortalAccessIn.new({\n \"expiry\": nil,\n \"read_only\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let dashboard_access_out = svix.ingest().dashboard(\"source_id\", IngestSourceConsumerPortalAccessIn {\n expiry: None,\n read_only: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var dashboardAccessOut = await svix.Ingest.DashboardAsync(\"source_id\", new IngestSourceConsumerPortalAccessIn{\n expiry: null,\n readOnly: null\n});" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix ingest dashboard \"source_id\" '{\n \"expiry\": null,\n \"readOnly\": null\n}'" + }, { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/dashboard' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"expiry\": null,\n \"readOnly\": null\n }'" } - ], - "x-hidden": true - }, - "patch": { - "description": "Partially update a connector.", - "operationId": "v1.beta.connector.patch", + ] + } + }, + "/ingest/api/v1/source/{source_id}/endpoint": { + "get": { + "description": "List ingest endpoints.", + "operationId": "v1.ingest.endpoint.list", "parameters": [ { - "description": "The TransformationTemplate's ID.", - "in": "path", - "name": "transformation_template_id", - "required": true, + "description": "Limit the number of returned items", + "in": "query", + "name": "limit", "schema": { - "description": "The TransformationTemplate's ID.", - "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 34, - "minLength": 34, - "pattern": "^trtmpl_[A-Za-z0-9]{27}$", + "description": "Limit the number of returned items", + "format": "uint64", + "maximum": 250, + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The iterator returned from a prior invocation", + "in": "query", + "name": "iterator", + "schema": { + "description": "The iterator returned from a prior invocation", + "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", + "maxLength": 30, + "minLength": 30, + "nullable": true, + "pattern": "^ep_[A-Za-z0-9]{27}$", "type": "string" }, - "style": "simple" + "style": "form" + }, + { + "description": "The sorting order of the returned items", + "in": "query", + "name": "order", + "schema": { + "$ref": "#/components/schemas/Ordering", + "description": "The sorting order of the returned items", + "nullable": true + }, + "style": "form" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TemplatePatch" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateOut" + "$ref": "#/components/schemas/ListResponse_IngestEndpointOut_" } } }, @@ -32425,34 +33652,27 @@ "HTTPBearer": [] } ], - "summary": "Patch Transformation Template", + "summary": "List Ingest Endpoints", "tags": [ - "Transformation Template" + "Ingest Endpoint" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PATCH' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } - ], - "x-hidden": true + ] }, - "put": { - "description": "Update a connector.", - "operationId": "v1.beta.connector.update", + "post": { + "description": "Create an ingest endpoint.", + "operationId": "v1.ingest.endpoint.create", "parameters": [ { - "description": "The TransformationTemplate's ID.", - "in": "path", - "name": "transformation_template_id", - "required": true, + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", "schema": { - "description": "The TransformationTemplate's ID.", - "example": "trtmpl_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 34, - "minLength": 34, - "pattern": "^trtmpl_[A-Za-z0-9]{27}$", "type": "string" }, "style": "simple" @@ -32462,28 +33682,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateUpdate" + "$ref": "#/components/schemas/IngestEndpointIn" } } }, "required": true }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TemplateOut" - } - } - }, - "description": "" - }, "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TemplateOut" + "$ref": "#/components/schemas/IngestEndpointOut" } } }, @@ -32565,75 +33775,43 @@ "HTTPBearer": [] } ], - "summary": "Update Transformation Template", + "summary": "Create Ingest Endpoint", "tags": [ - "Transformation Template" + "Ingest Endpoint" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/api/v1/transformation-template/{transformation_template_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"instructionsLink\": null,\n \"filterTypes\": [\"user.signup\", \"user.deleted\"],\n \"featureFlag\": \"cool-new-feature\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\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 }'" } - ], - "x-hidden": true + ] } }, - "/ingest/api/v1/source/{source_id}/endpoint": { - "get": { - "description": "List ingest endpoints.", - "operationId": "v1.ingest.endpoint.list", + "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}": { + "delete": { + "description": "Delete an ingest endpoint.", + "operationId": "v1.ingest.endpoint.delete", "parameters": [ { - "description": "Limit the number of returned items", - "in": "query", - "name": "limit", - "schema": { - "description": "Limit the number of returned items", - "format": "uint64", - "maximum": 250, - "minimum": 1, - "type": "integer" - }, - "style": "form" - }, - { - "description": "The iterator returned from a prior invocation", - "in": "query", - "name": "iterator", + "description": "The Endpoint's ID or UID.", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { - "description": "The iterator returned from a prior invocation", - "example": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2", - "maxLength": 30, - "minLength": 30, - "nullable": true, - "pattern": "^ep_[A-Za-z0-9]{27}$", + "description": "The Endpoint's ID or UID.", + "example": "unique-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, - "style": "form" - }, - { - "description": "The sorting order of the returned items", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/Ordering", - "description": "The sorting order of the returned items", - "nullable": true - }, - "style": "form" + "style": "simple" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListResponse_IngestEndpointOut_" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -32711,7 +33889,7 @@ "HTTPBearer": [] } ], - "summary": "List Ingest Endpoints", + "summary": "Delete Ingest Endpoint", "tags": [ "Ingest Endpoint" ], @@ -32719,36 +33897,32 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] }, - "post": { - "description": "Create an ingest endpoint.", - "operationId": "v1.ingest.endpoint.create", + "get": { + "description": "Get an ingest endpoint.", + "operationId": "v1.ingest.endpoint.get", "parameters": [ { - "description": "The request's idempotency key", - "in": "header", - "name": "idempotency-key", + "description": "The Endpoint's ID or UID.", + "in": "path", + "name": "endpoint_id", + "required": true, "schema": { + "description": "The Endpoint's ID or UID.", + "example": "unique-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IngestEndpointIn" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { @@ -32834,7 +34008,7 @@ "HTTPBearer": [] } ], - "summary": "Create Ingest Endpoint", + "summary": "Get Ingest Endpoint", "tags": [ "Ingest Endpoint" ], @@ -32842,15 +34016,13 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\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": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] - } - }, - "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}": { - "delete": { - "description": "Delete an ingest endpoint.", - "operationId": "v1.ingest.endpoint.delete", + }, + "put": { + "description": "Update an ingest endpoint.", + "operationId": "v1.ingest.endpoint.update", "parameters": [ { "description": "The Endpoint's ID or UID.", @@ -32868,9 +34040,26 @@ "style": "simple" } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestEndpointUpdate" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "no content" + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestEndpointOut" + } + } + }, + "description": "" }, "400": { "content": { @@ -32948,7 +34137,7 @@ "HTTPBearer": [] } ], - "summary": "Delete Ingest Endpoint", + "summary": "Update Ingest Endpoint", "tags": [ "Ingest Endpoint" ], @@ -32956,13 +34145,15 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'DELETE' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n }'" } ] - }, + } + }, + "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers": { "get": { - "description": "Get an ingest endpoint.", - "operationId": "v1.ingest.endpoint.get", + "description": "Get the additional headers to be sent with the ingest.", + "operationId": "v1.ingest.endpoint.get-headers", "parameters": [ { "description": "The Endpoint's ID or UID.", @@ -32985,7 +34176,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IngestEndpointOut" + "$ref": "#/components/schemas/IngestEndpointHeadersOut" } } }, @@ -33067,7 +34258,7 @@ "HTTPBearer": [] } ], - "summary": "Get Ingest Endpoint", + "summary": "Get Ingest Endpoint Headers", "tags": [ "Ingest Endpoint" ], @@ -33075,13 +34266,13 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] }, "put": { - "description": "Update an ingest endpoint.", - "operationId": "v1.ingest.endpoint.update", + "description": "Set the additional headers to be sent to the endpoint.", + "operationId": "v1.ingest.endpoint.update-headers", "parameters": [ { "description": "The Endpoint's ID or UID.", @@ -33103,22 +34294,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IngestEndpointUpdate" + "$ref": "#/components/schemas/IngestEndpointHeadersIn" } } }, "required": true }, "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IngestEndpointOut" - } - } - }, - "description": "" + "204": { + "description": "no content" }, "400": { "content": { @@ -33196,7 +34380,7 @@ "HTTPBearer": [] } ], - "summary": "Update Ingest Endpoint", + "summary": "Update Ingest Endpoint Headers", "tags": [ "Ingest Endpoint" ], @@ -33204,15 +34388,15 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"description\": \"An example endpoint name\",\n \"rateLimit\": null,\n \"uid\": \"unique-identifier\",\n \"url\": \"https://example.com/webhook/\",\n \"disabled\": false\n }'" + "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" } ] } }, - "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers": { + "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret": { "get": { - "description": "Get the additional headers to be sent with the ingest.", - "operationId": "v1.ingest.endpoint.get-headers", + "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 Endpoint's ID or UID.", @@ -33235,7 +34419,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IngestEndpointHeadersOut" + "$ref": "#/components/schemas/IngestEndpointSecretOut" } } }, @@ -33317,7 +34501,7 @@ "HTTPBearer": [] } ], - "summary": "Get Ingest Endpoint Headers", + "summary": "Get Ingest Endpoint Secret", "tags": [ "Ingest Endpoint" ], @@ -33325,13 +34509,15 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] - }, - "put": { - "description": "Set the additional headers to be sent to the endpoint.", - "operationId": "v1.ingest.endpoint.update-headers", + } + }, + "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate": { + "post": { + "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 Endpoint's ID or UID.", @@ -33347,13 +34533,22 @@ "type": "string" }, "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" } ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IngestEndpointHeadersIn" + "$ref": "#/components/schemas/IngestEndpointSecretIn" } } }, @@ -33439,7 +34634,7 @@ "HTTPBearer": [] } ], - "summary": "Update Ingest Endpoint Headers", + "summary": "Rotate Ingest Endpoint Secret", "tags": [ "Ingest Endpoint" ], @@ -33447,43 +34642,64 @@ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'PUT' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"headers\": {\"X-Example\":\"123\",\"X-Foobar\":\"Bar\"}\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" } ] } }, - "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret": { + "/ingest/api/v1/source/{source_id}/in/{token}": { "get": { - "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", + "description": "Non-legacy (using a token) ingest webhook.", + "operationId": "v1.ingest", "parameters": [ { - "description": "The Endpoint's ID or UID.", + "description": "The Source's ID.", "in": "path", - "name": "endpoint_id", + "name": "source_id", "required": true, "schema": { - "description": "The Endpoint's ID or UID.", - "example": "unique-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "The Source's ID.", + "example": "src_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 26, + "minLength": 26, + "pattern": "^src_[A-Za-z0-9]{22}$", + "type": "string" + }, + "style": "simple" + }, + { + "in": "path", + "name": "token", + "required": true, + "schema": { + "maxLength": 16, + "minLength": 16, + "pattern": "^[A-Za-z0-9]+$", "type": "string" }, "style": "simple" } ], + "requestBody": { + "content": { + "application/octet-stream": {} + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IngestEndpointSecretOut" + "$ref": "#/components/schemas/IngestResponse" } } }, "description": "" }, + "204": { + "description": "no content" + }, "400": { "content": { "application/json": { @@ -33560,35 +34776,46 @@ "HTTPBearer": [] } ], - "summary": "Get Ingest Endpoint Secret", + "summary": "Ingest", "tags": [ - "Ingest Endpoint" + "Ingest Message" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/in/{token}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } - ] - } - }, - "/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate": { + ], + "x-hidden": true + }, "post": { - "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", + "description": "Non-legacy (using a token) ingest webhook.", + "operationId": "v1.ingest", "parameters": [ { - "description": "The Endpoint's ID or UID.", + "description": "The Source's ID.", "in": "path", - "name": "endpoint_id", + "name": "source_id", "required": true, "schema": { - "description": "The Endpoint's ID or UID.", - "example": "unique-identifier", - "maxLength": 256, - "minLength": 1, - "pattern": "^[a-zA-Z0-9\\-_.]+$", + "description": "The Source's ID.", + "example": "src_2yZwUhtgs5Ai8T9yRQJXA", + "maxLength": 26, + "minLength": 26, + "pattern": "^src_[A-Za-z0-9]{22}$", + "type": "string" + }, + "style": "simple" + }, + { + "in": "path", + "name": "token", + "required": true, + "schema": { + "maxLength": 16, + "minLength": 16, + "pattern": "^[A-Za-z0-9]+$", "type": "string" }, "style": "simple" @@ -33605,15 +34832,21 @@ ], "requestBody": { "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IngestEndpointSecretIn" - } - } + "application/octet-stream": {} }, "required": true }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IngestResponse" + } + } + }, + "description": "" + }, "204": { "description": "no content" }, @@ -33693,15 +34926,145 @@ "HTTPBearer": [] } ], - "summary": "Rotate Ingest Endpoint Secret", + "summary": "Ingest", "tags": [ - "Ingest Endpoint" + "Ingest Message" ], "x-codeSamples": [ { "label": "cURL", "lang": "Shell", - "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"key\": \"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD\"\n }'" + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/in/{token}' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ], + "x-hidden": true + } + }, + "/ingest/api/v1/source/{source_id}/token/rotate": { + "post": { + "description": "Rotate the Ingest Source's Url Token.\n\nThis will rotate the ingest source's token, which is used to\nconstruct the unique `ingestUrl` for the source. Previous tokens\nwill remain valid for 48 hours after rotation. The token can be\nrotated a maximum of three times within the 48-hour period.", + "operationId": "v1.ingest.source.rotate-token", + "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", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RotateTokenOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Rotate Ingest Token", + "tags": [ + "Ingest Source" + ], + "x-codeSamples": [ + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/ingest/api/v1/source/{source_id}/token/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" } ] } @@ -33798,6 +35161,7 @@ { "name": "Ingest", "tags": [ + "Ingest Source", "Ingest Endpoint" ] }, diff --git a/regen_openapi.py b/regen_openapi.py index 109054252..a201fd2f9 100755 --- a/regen_openapi.py +++ b/regen_openapi.py @@ -15,7 +15,7 @@ print("Python 3.11 or greater is required to run the codegen") exit(1) -OPENAPI_CODEGEN_IMAGE = "ghcr.io/svix/openapi-codegen:20250303-a07aa78" +OPENAPI_CODEGEN_IMAGE = "ghcr.io/svix/openapi-codegen:20250306-272" REPO_ROOT = pathlib.Path(__file__).parent.resolve() DEBUG = os.getenv("DEBUG") is not None GREEN = "\033[92m" diff --git a/rust/src/api/ingest.rs b/rust/src/api/ingest.rs index 3f87a6822..1884e3537 100644 --- a/rust/src/api/ingest.rs +++ b/rust/src/api/ingest.rs @@ -1,5 +1,10 @@ -use super::IngestEndpoint; -use crate::Configuration; +use super::{IngestEndpoint, IngestSource}; +use crate::{error::Result, models::*, Configuration}; + +#[derive(Default)] +pub struct IngestDashboardOptions { + pub idempotency_key: Option, +} pub struct Ingest<'a> { cfg: &'a Configuration, @@ -13,4 +18,28 @@ impl<'a> Ingest<'a> { pub fn endpoint(&self) -> IngestEndpoint<'a> { IngestEndpoint::new(self.cfg) } + + pub fn source(&self) -> IngestSource<'a> { + IngestSource::new(self.cfg) + } + + /// Get access to the Ingest Source Consumer Portal. + pub async fn dashboard( + &self, + source_id: String, + ingest_source_consumer_portal_access_in: IngestSourceConsumerPortalAccessIn, + options: Option, + ) -> Result { + let IngestDashboardOptions { idempotency_key } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/ingest/api/v1/source/{source_id}/dashboard", + ) + .with_path_param("source_id", source_id) + .with_optional_header_param("idempotency-key", idempotency_key) + .with_body_param(ingest_source_consumer_portal_access_in) + .execute(self.cfg) + .await + } } diff --git a/rust/src/api/ingest_source.rs b/rust/src/api/ingest_source.rs new file mode 100644 index 000000000..114eff902 --- /dev/null +++ b/rust/src/api/ingest_source.rs @@ -0,0 +1,120 @@ +use crate::{error::Result, models::*, Configuration}; + +#[derive(Default)] +pub struct IngestSourceListOptions { + /// Limit the number of returned items + pub limit: Option, + + /// The iterator returned from a prior invocation + pub iterator: Option, + + /// The sorting order of the returned items + pub order: Option, +} + +#[derive(Default)] +pub struct IngestSourceCreateOptions { + pub idempotency_key: Option, +} + +#[derive(Default)] +pub struct IngestSourceRotateTokenOptions { + pub idempotency_key: Option, +} + +pub struct IngestSource<'a> { + cfg: &'a Configuration, +} + +impl<'a> IngestSource<'a> { + pub(super) fn new(cfg: &'a Configuration) -> Self { + Self { cfg } + } + + /// List of all the organization's Ingest Sources. + pub async fn list( + &self, + options: Option, + ) -> Result { + let IngestSourceListOptions { + limit, + iterator, + order, + } = options.unwrap_or_default(); + + crate::request::Request::new(http1::Method::GET, "/ingest/api/v1/source") + .with_optional_query_param("limit", limit) + .with_optional_query_param("iterator", iterator) + .with_optional_query_param("order", order) + .execute(self.cfg) + .await + } + + /// Create Ingest Source. + pub async fn create( + &self, + ingest_source_in: IngestSourceIn, + options: Option, + ) -> Result { + let IngestSourceCreateOptions { idempotency_key } = options.unwrap_or_default(); + + crate::request::Request::new(http1::Method::POST, "/ingest/api/v1/source") + .with_optional_header_param("idempotency-key", idempotency_key) + .with_body_param(ingest_source_in) + .execute(self.cfg) + .await + } + + /// Get an Ingest Source by id or uid. + pub async fn get(&self, source_id: String) -> Result { + crate::request::Request::new(http1::Method::GET, "/ingest/api/v1/source/{source_id}") + .with_path_param("source_id", source_id) + .execute(self.cfg) + .await + } + + /// Update an Ingest Source. + pub async fn update( + &self, + source_id: String, + ingest_source_in: IngestSourceIn, + ) -> Result { + crate::request::Request::new(http1::Method::PUT, "/ingest/api/v1/source/{source_id}") + .with_path_param("source_id", source_id) + .with_body_param(ingest_source_in) + .execute(self.cfg) + .await + } + + /// Delete an Ingest Source. + pub async fn delete(&self, source_id: String) -> Result<()> { + crate::request::Request::new(http1::Method::DELETE, "/ingest/api/v1/source/{source_id}") + .with_path_param("source_id", source_id) + .returns_nothing() + .execute(self.cfg) + .await + } + + /// Rotate the Ingest Source's Url Token. + /// + /// This will rotate the ingest source's token, which is used to + /// construct the unique `ingestUrl` for the source. Previous tokens + /// will remain valid for 48 hours after rotation. The token can be + /// rotated a maximum of three times within the 48-hour period. + pub async fn rotate_token( + &self, + source_id: String, + options: Option, + ) -> Result { + let IngestSourceRotateTokenOptions { idempotency_key } = options.unwrap_or_default(); + + crate::request::Request::new( + http1::Method::POST, + "/ingest/api/v1/source/{source_id}/token/rotate", + ) + .with_path_param("source_id", source_id) + .with_optional_header_param("idempotency-key", idempotency_key) + .execute(self.cfg) + .await + } +} diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs index f0c7a0bf3..a4ab26ae8 100644 --- a/rust/src/api/mod.rs +++ b/rust/src/api/mod.rs @@ -12,6 +12,7 @@ mod endpoint; mod event_type; mod ingest; mod ingest_endpoint; +mod ingest_source; mod integration; mod message; mod message_attempt; @@ -42,6 +43,10 @@ pub use self::{ IngestEndpoint, IngestEndpointCreateOptions, IngestEndpointListOptions, IngestEndpointRotateSecretOptions, }, + ingest_source::{ + IngestSource, IngestSourceCreateOptions, IngestSourceListOptions, + IngestSourceRotateTokenOptions, + }, integration::{ Integration, IntegrationCreateOptions, IntegrationListOptions, IntegrationRotateKeyOptions, }, diff --git a/rust/src/models/adobe_sign_config.rs b/rust/src/models/adobe_sign_config.rs new file mode 100644 index 000000000..adfed72f3 --- /dev/null +++ b/rust/src/models/adobe_sign_config.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct AdobeSignConfig { + #[serde(rename = "clientId")] + pub client_id: String, +} + +impl AdobeSignConfig { + pub fn new(client_id: String) -> Self { + Self { client_id } + } +} diff --git a/rust/src/models/adobe_sign_config_out.rs b/rust/src/models/adobe_sign_config_out.rs new file mode 100644 index 000000000..efb87d35b --- /dev/null +++ b/rust/src/models/adobe_sign_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct AdobeSignConfigOut {} + +impl AdobeSignConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/connector_out.rs b/rust/src/models/connector_out.rs new file mode 100644 index 000000000..5f5c729fa --- /dev/null +++ b/rust/src/models/connector_out.rs @@ -0,0 +1,75 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +use super::connector_kind::ConnectorKind; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ConnectorOut { + #[serde(rename = "createdAt")] + pub created_at: String, + + pub description: String, + + #[serde(rename = "featureFlag")] + #[serde(skip_serializing_if = "Option::is_none")] + pub feature_flag: Option, + + #[serde(rename = "filterTypes")] + #[serde(skip_serializing_if = "Option::is_none")] + pub filter_types: Option>, + + /// The TransformationTemplate's ID. + pub id: String, + + pub instructions: String, + + #[serde(rename = "instructionsLink")] + #[serde(skip_serializing_if = "Option::is_none")] + pub instructions_link: Option, + + pub kind: ConnectorKind, + + pub logo: String, + + pub name: String, + + /// The Organization's ID. + #[serde(rename = "orgId")] + pub org_id: String, + + pub transformation: String, + + #[serde(rename = "updatedAt")] + pub updated_at: String, +} + +impl ConnectorOut { + pub fn new( + created_at: String, + description: String, + id: String, + instructions: String, + kind: ConnectorKind, + logo: String, + name: String, + org_id: String, + transformation: String, + updated_at: String, + ) -> Self { + Self { + created_at, + description, + feature_flag: None, + filter_types: None, + id, + instructions, + instructions_link: None, + kind, + logo, + name, + org_id, + transformation, + updated_at, + } + } +} diff --git a/rust/src/models/cron_config.rs b/rust/src/models/cron_config.rs new file mode 100644 index 000000000..5b1a297da --- /dev/null +++ b/rust/src/models/cron_config.rs @@ -0,0 +1,26 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct CronConfig { + /// Override the default content-type. + /// + /// Recommended if the payload is not JSON. + #[serde(rename = "contentType")] + #[serde(skip_serializing_if = "Option::is_none")] + pub content_type: Option, + + pub payload: String, + + pub schedule: String, +} + +impl CronConfig { + pub fn new(payload: String, schedule: String) -> Self { + Self { + content_type: None, + payload, + schedule, + } + } +} diff --git a/rust/src/models/docusign_config.rs b/rust/src/models/docusign_config.rs new file mode 100644 index 000000000..89a39f9f8 --- /dev/null +++ b/rust/src/models/docusign_config.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct DocusignConfig { + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl DocusignConfig { + pub fn new() -> Self { + Self { secret: None } + } +} diff --git a/rust/src/models/docusign_config_out.rs b/rust/src/models/docusign_config_out.rs new file mode 100644 index 000000000..33aaa96fc --- /dev/null +++ b/rust/src/models/docusign_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct DocusignConfigOut {} + +impl DocusignConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/environment_out.rs b/rust/src/models/environment_out.rs index 50f890906..285c8f287 100644 --- a/rust/src/models/environment_out.rs +++ b/rust/src/models/environment_out.rs @@ -1,7 +1,7 @@ // this file is @generated use serde::{Deserialize, Serialize}; -use super::{event_type_out::EventTypeOut, template_out::TemplateOut}; +use super::{connector_out::ConnectorOut, event_type_out::EventTypeOut}; #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct EnvironmentOut { @@ -15,7 +15,7 @@ pub struct EnvironmentOut { pub settings: Option, #[serde(rename = "transformationTemplates")] - pub transformation_templates: Vec, + pub transformation_templates: Vec, #[serde(skip_serializing_if = "Option::is_none")] pub version: Option, @@ -25,7 +25,7 @@ impl EnvironmentOut { pub fn new( created_at: String, event_types: Vec, - transformation_templates: Vec, + transformation_templates: Vec, ) -> Self { Self { created_at, diff --git a/rust/src/models/github_config.rs b/rust/src/models/github_config.rs new file mode 100644 index 000000000..e28754709 --- /dev/null +++ b/rust/src/models/github_config.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct GithubConfig { + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl GithubConfig { + pub fn new() -> Self { + Self { secret: None } + } +} diff --git a/rust/src/models/github_config_out.rs b/rust/src/models/github_config_out.rs new file mode 100644 index 000000000..93280a9a8 --- /dev/null +++ b/rust/src/models/github_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct GithubConfigOut {} + +impl GithubConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/hubspot_config.rs b/rust/src/models/hubspot_config.rs new file mode 100644 index 000000000..f1ff6785f --- /dev/null +++ b/rust/src/models/hubspot_config.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct HubspotConfig { + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl HubspotConfig { + pub fn new() -> Self { + Self { secret: None } + } +} diff --git a/rust/src/models/hubspot_config_out.rs b/rust/src/models/hubspot_config_out.rs new file mode 100644 index 000000000..4a0a38fea --- /dev/null +++ b/rust/src/models/hubspot_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct HubspotConfigOut {} + +impl HubspotConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/ingest_source_consumer_portal_access_in.rs b/rust/src/models/ingest_source_consumer_portal_access_in.rs new file mode 100644 index 000000000..a390586cd --- /dev/null +++ b/rust/src/models/ingest_source_consumer_portal_access_in.rs @@ -0,0 +1,25 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct IngestSourceConsumerPortalAccessIn { + /// How long the token will be valid for, in seconds. + /// + /// Valid values are between 1 hour and 7 days. The default is 7 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expiry: Option, + + /// Whether the app portal should be in read-only mode. + #[serde(rename = "readOnly")] + #[serde(skip_serializing_if = "Option::is_none")] + pub read_only: Option, +} + +impl IngestSourceConsumerPortalAccessIn { + pub fn new() -> Self { + Self { + expiry: None, + read_only: None, + } + } +} diff --git a/rust/src/models/ingest_source_in.rs b/rust/src/models/ingest_source_in.rs new file mode 100644 index 000000000..0215c877c --- /dev/null +++ b/rust/src/models/ingest_source_in.rs @@ -0,0 +1,57 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +use super::{ + adobe_sign_config::AdobeSignConfig, cron_config::CronConfig, docusign_config::DocusignConfig, + github_config::GithubConfig, hubspot_config::HubspotConfig, segment_config::SegmentConfig, + shopify_config::ShopifyConfig, slack_config::SlackConfig, stripe_config::StripeConfig, + svix_config::SvixConfig, zoom_config::ZoomConfig, +}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct IngestSourceIn { + pub name: String, + + /// The Source's UID. + #[serde(skip_serializing_if = "Option::is_none")] + pub uid: Option, + + #[serde(flatten)] + pub config: IngestSourceInConfig, +} + +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[serde(tag = "type", content = "config")] +pub enum IngestSourceInConfig { + GenericWebhook, + Cron(CronConfig), + AdobeSign(AdobeSignConfig), + Beehiiv(SvixConfig), + Brex(SvixConfig), + Clerk(SvixConfig), + Docusign(DocusignConfig), + Github(GithubConfig), + Guesty(SvixConfig), + Hubspot(HubspotConfig), + IncidentIo(SvixConfig), + Lithic(SvixConfig), + Nash(SvixConfig), + Pleo(SvixConfig), + Replicate(SvixConfig), + Resend(SvixConfig), + Safebase(SvixConfig), + Sardine(SvixConfig), + Segment(SegmentConfig), + Shopify(ShopifyConfig), + Slack(SlackConfig), + Stripe(StripeConfig), + Stych(SvixConfig), + Svix(SvixConfig), + Zoom(ZoomConfig), +} + +impl Default for IngestSourceInConfig { + fn default() -> Self { + Self::GenericWebhook + } +} diff --git a/rust/src/models/ingest_source_out.rs b/rust/src/models/ingest_source_out.rs new file mode 100644 index 000000000..9d0fe6888 --- /dev/null +++ b/rust/src/models/ingest_source_out.rs @@ -0,0 +1,72 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +use super::{ + adobe_sign_config_out::AdobeSignConfigOut, cron_config::CronConfig, + docusign_config_out::DocusignConfigOut, github_config_out::GithubConfigOut, + hubspot_config_out::HubspotConfigOut, segment_config_out::SegmentConfigOut, + shopify_config_out::ShopifyConfigOut, slack_config_out::SlackConfigOut, + stripe_config_out::StripeConfigOut, svix_config_out::SvixConfigOut, + zoom_config_out::ZoomConfigOut, +}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct IngestSourceOut { + #[serde(rename = "createdAt")] + pub created_at: String, + + /// The Source's ID. + pub id: String, + + #[serde(rename = "ingestUrl")] + #[serde(skip_serializing_if = "Option::is_none")] + pub ingest_url: Option, + + pub name: String, + + /// The Source's UID. + #[serde(skip_serializing_if = "Option::is_none")] + pub uid: Option, + + #[serde(rename = "updatedAt")] + pub updated_at: String, + + #[serde(flatten)] + pub config: IngestSourceOutConfig, +} + +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[serde(tag = "type", content = "config")] +pub enum IngestSourceOutConfig { + GenericWebhook, + Cron(CronConfig), + AdobeSign(AdobeSignConfigOut), + Beehiiv(SvixConfigOut), + Brex(SvixConfigOut), + Clerk(SvixConfigOut), + Docusign(DocusignConfigOut), + Github(GithubConfigOut), + Guesty(SvixConfigOut), + Hubspot(HubspotConfigOut), + IncidentIo(SvixConfigOut), + Lithic(SvixConfigOut), + Nash(SvixConfigOut), + Pleo(SvixConfigOut), + Replicate(SvixConfigOut), + Resend(SvixConfigOut), + Safebase(SvixConfigOut), + Sardine(SvixConfigOut), + Segment(SegmentConfigOut), + Shopify(ShopifyConfigOut), + Slack(SlackConfigOut), + Stripe(StripeConfigOut), + Stych(SvixConfigOut), + Svix(SvixConfigOut), + Zoom(ZoomConfigOut), +} + +impl Default for IngestSourceOutConfig { + fn default() -> Self { + Self::GenericWebhook + } +} diff --git a/rust/src/models/list_response_ingest_source_out.rs b/rust/src/models/list_response_ingest_source_out.rs new file mode 100644 index 000000000..d63fe2981 --- /dev/null +++ b/rust/src/models/list_response_ingest_source_out.rs @@ -0,0 +1,29 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +use super::ingest_source_out::IngestSourceOut; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ListResponseIngestSourceOut { + pub data: Vec, + + pub done: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub iterator: Option, + + #[serde(rename = "prevIterator")] + #[serde(skip_serializing_if = "Option::is_none")] + pub prev_iterator: Option, +} + +impl ListResponseIngestSourceOut { + pub fn new(data: Vec, done: bool) -> Self { + Self { + data, + done, + iterator: None, + prev_iterator: None, + } + } +} diff --git a/rust/src/models/mod.rs b/rust/src/models/mod.rs index 0f2ee24e8..aac34e787 100644 --- a/rust/src/models/mod.rs +++ b/rust/src/models/mod.rs @@ -1,6 +1,8 @@ // this file is @generated #![allow(clippy::too_many_arguments)] +pub mod adobe_sign_config; +pub mod adobe_sign_config_out; pub mod aggregate_event_types_out; pub mod app_portal_access_in; pub mod app_portal_access_out; @@ -15,7 +17,11 @@ pub mod background_task_status; pub mod background_task_type; pub mod connector_in; pub mod connector_kind; +pub mod connector_out; +pub mod cron_config; pub mod dashboard_access_out; +pub mod docusign_config; +pub mod docusign_config_out; pub mod endpoint_headers_in; pub mod endpoint_headers_out; pub mod endpoint_headers_patch_in; @@ -41,6 +47,10 @@ pub mod event_type_out; pub mod event_type_patch; pub mod event_type_update; pub mod expunge_all_contents_out; +pub mod github_config; +pub mod github_config_out; +pub mod hubspot_config; +pub mod hubspot_config_out; pub mod ingest_endpoint_headers_in; pub mod ingest_endpoint_headers_out; pub mod ingest_endpoint_in; @@ -48,6 +58,9 @@ pub mod ingest_endpoint_out; pub mod ingest_endpoint_secret_in; pub mod ingest_endpoint_secret_out; pub mod ingest_endpoint_update; +pub mod ingest_source_consumer_portal_access_in; +pub mod ingest_source_in; +pub mod ingest_source_out; pub mod integration_in; pub mod integration_key_out; pub mod integration_out; @@ -58,6 +71,7 @@ pub mod list_response_endpoint_message_out; pub mod list_response_endpoint_out; pub mod list_response_event_type_out; pub mod list_response_ingest_endpoint_out; +pub mod list_response_ingest_source_out; pub mod list_response_integration_out; pub mod list_response_message_attempt_out; pub mod list_response_message_endpoint_out; @@ -81,8 +95,20 @@ pub mod recover_in; pub mod recover_out; pub mod replay_in; pub mod replay_out; +pub mod rotate_token_out; +pub mod segment_config; +pub mod segment_config_out; +pub mod shopify_config; +pub mod shopify_config_out; +pub mod slack_config; +pub mod slack_config_out; pub mod status_code_class; -pub mod template_out; +pub mod stripe_config; +pub mod stripe_config_out; +pub mod svix_config; +pub mod svix_config_out; +pub mod zoom_config; +pub mod zoom_config_out; // not currently generated pub mod http_error_out; pub mod http_validation_error; @@ -93,6 +119,8 @@ pub mod validation_error; #[rustfmt::skip] pub use self::{ + adobe_sign_config::AdobeSignConfig, + adobe_sign_config_out::AdobeSignConfigOut, aggregate_event_types_out::AggregateEventTypesOut, app_portal_access_in::AppPortalAccessIn, app_portal_access_out::AppPortalAccessOut, @@ -107,7 +135,11 @@ pub use self::{ background_task_type::BackgroundTaskType, connector_in::ConnectorIn, connector_kind::ConnectorKind, + connector_out::ConnectorOut, + cron_config::CronConfig, dashboard_access_out::DashboardAccessOut, + docusign_config::DocusignConfig, + docusign_config_out::DocusignConfigOut, endpoint_headers_in::EndpointHeadersIn, endpoint_headers_out::EndpointHeadersOut, endpoint_headers_patch_in::EndpointHeadersPatchIn, @@ -133,6 +165,10 @@ pub use self::{ event_type_patch::EventTypePatch, event_type_update::EventTypeUpdate, expunge_all_contents_out::ExpungeAllContentsOut, + github_config::GithubConfig, + github_config_out::GithubConfigOut, + hubspot_config::HubspotConfig, + hubspot_config_out::HubspotConfigOut, ingest_endpoint_headers_in::IngestEndpointHeadersIn, ingest_endpoint_headers_out::IngestEndpointHeadersOut, ingest_endpoint_in::IngestEndpointIn, @@ -140,6 +176,9 @@ pub use self::{ ingest_endpoint_secret_in::IngestEndpointSecretIn, ingest_endpoint_secret_out::IngestEndpointSecretOut, ingest_endpoint_update::IngestEndpointUpdate, + ingest_source_consumer_portal_access_in::IngestSourceConsumerPortalAccessIn, + ingest_source_in::IngestSourceIn, + ingest_source_out::IngestSourceOut, integration_in::IntegrationIn, integration_key_out::IntegrationKeyOut, integration_out::IntegrationOut, @@ -150,6 +189,7 @@ pub use self::{ list_response_endpoint_out::ListResponseEndpointOut, list_response_event_type_out::ListResponseEventTypeOut, list_response_ingest_endpoint_out::ListResponseIngestEndpointOut, + list_response_ingest_source_out::ListResponseIngestSourceOut, list_response_integration_out::ListResponseIntegrationOut, list_response_message_attempt_out::ListResponseMessageAttemptOut, list_response_message_endpoint_out::ListResponseMessageEndpointOut, @@ -173,8 +213,20 @@ pub use self::{ recover_out::RecoverOut, replay_in::ReplayIn, replay_out::ReplayOut, + rotate_token_out::RotateTokenOut, + segment_config::SegmentConfig, + segment_config_out::SegmentConfigOut, + shopify_config::ShopifyConfig, + shopify_config_out::ShopifyConfigOut, + slack_config::SlackConfig, + slack_config_out::SlackConfigOut, status_code_class::StatusCodeClass, - template_out::TemplateOut, + stripe_config::StripeConfig, + stripe_config_out::StripeConfigOut, + svix_config::SvixConfig, + svix_config_out::SvixConfigOut, + zoom_config::ZoomConfig, + zoom_config_out::ZoomConfigOut, // not currently generated message_events_out::MessageEventsOut, message_attempt_endpoint_out::MessageAttemptEndpointOut, diff --git a/rust/src/models/rotate_token_out.rs b/rust/src/models/rotate_token_out.rs new file mode 100644 index 000000000..c0bcd7f00 --- /dev/null +++ b/rust/src/models/rotate_token_out.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct RotateTokenOut { + #[serde(rename = "ingestUrl")] + pub ingest_url: String, +} + +impl RotateTokenOut { + pub fn new(ingest_url: String) -> Self { + Self { ingest_url } + } +} diff --git a/rust/src/models/segment_config.rs b/rust/src/models/segment_config.rs new file mode 100644 index 000000000..bc692c1f1 --- /dev/null +++ b/rust/src/models/segment_config.rs @@ -0,0 +1,14 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SegmentConfig { + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} + +impl SegmentConfig { + pub fn new() -> Self { + Self { secret: None } + } +} diff --git a/rust/src/models/segment_config_out.rs b/rust/src/models/segment_config_out.rs new file mode 100644 index 000000000..1b0ca6ce5 --- /dev/null +++ b/rust/src/models/segment_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SegmentConfigOut {} + +impl SegmentConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/shopify_config.rs b/rust/src/models/shopify_config.rs new file mode 100644 index 000000000..93ac695ed --- /dev/null +++ b/rust/src/models/shopify_config.rs @@ -0,0 +1,13 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ShopifyConfig { + pub secret: String, +} + +impl ShopifyConfig { + pub fn new(secret: String) -> Self { + Self { secret } + } +} diff --git a/rust/src/models/shopify_config_out.rs b/rust/src/models/shopify_config_out.rs new file mode 100644 index 000000000..fca4bbc6f --- /dev/null +++ b/rust/src/models/shopify_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ShopifyConfigOut {} + +impl ShopifyConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/slack_config.rs b/rust/src/models/slack_config.rs new file mode 100644 index 000000000..dc39dfa79 --- /dev/null +++ b/rust/src/models/slack_config.rs @@ -0,0 +1,13 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SlackConfig { + pub secret: String, +} + +impl SlackConfig { + pub fn new(secret: String) -> Self { + Self { secret } + } +} diff --git a/rust/src/models/slack_config_out.rs b/rust/src/models/slack_config_out.rs new file mode 100644 index 000000000..938917095 --- /dev/null +++ b/rust/src/models/slack_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SlackConfigOut {} + +impl SlackConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/stripe_config.rs b/rust/src/models/stripe_config.rs new file mode 100644 index 000000000..b7f343b86 --- /dev/null +++ b/rust/src/models/stripe_config.rs @@ -0,0 +1,13 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct StripeConfig { + pub secret: String, +} + +impl StripeConfig { + pub fn new(secret: String) -> Self { + Self { secret } + } +} diff --git a/rust/src/models/stripe_config_out.rs b/rust/src/models/stripe_config_out.rs new file mode 100644 index 000000000..4e1d7d5b0 --- /dev/null +++ b/rust/src/models/stripe_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct StripeConfigOut {} + +impl StripeConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/svix_config.rs b/rust/src/models/svix_config.rs new file mode 100644 index 000000000..ac1aaf80f --- /dev/null +++ b/rust/src/models/svix_config.rs @@ -0,0 +1,13 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SvixConfig { + pub secret: String, +} + +impl SvixConfig { + pub fn new(secret: String) -> Self { + Self { secret } + } +} diff --git a/rust/src/models/svix_config_out.rs b/rust/src/models/svix_config_out.rs new file mode 100644 index 000000000..160f35d6a --- /dev/null +++ b/rust/src/models/svix_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct SvixConfigOut {} + +impl SvixConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/src/models/zoom_config.rs b/rust/src/models/zoom_config.rs new file mode 100644 index 000000000..748a87ab6 --- /dev/null +++ b/rust/src/models/zoom_config.rs @@ -0,0 +1,13 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ZoomConfig { + pub secret: String, +} + +impl ZoomConfig { + pub fn new(secret: String) -> Self { + Self { secret } + } +} diff --git a/rust/src/models/zoom_config_out.rs b/rust/src/models/zoom_config_out.rs new file mode 100644 index 000000000..aef6f7bdd --- /dev/null +++ b/rust/src/models/zoom_config_out.rs @@ -0,0 +1,11 @@ +// this file is @generated +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] +pub struct ZoomConfigOut {} + +impl ZoomConfigOut { + pub fn new() -> Self { + Self {} + } +} diff --git a/rust/templates/types/struct_enum.rs.jinja b/rust/templates/types/struct_enum.rs.jinja index b4a56c981..4054100b0 100644 --- a/rust/templates/types/struct_enum.rs.jinja +++ b/rust/templates/types/struct_enum.rs.jinja @@ -11,7 +11,7 @@ use super::{ {% set enum_type_name %}{{ type_name }}{{ type.content_field | to_upper_camel_case }}{% endset -%} {{ doc_comment }} - #[derive(Clone, Debug, Deserialize, Serialize)] + #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct {{ type_name }} { {% include "types/struct_fields.rs.jinja" %} @@ -26,7 +26,7 @@ use super::{ {% set enum_type_name = type_name %} {% endif %} -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[serde(tag = "{{ type.discriminator_field }}", content = "{{ type.content_field }}")] pub enum {{ enum_type_name }} { {% for variant in type.variants -%} @@ -36,3 +36,18 @@ pub enum {{ enum_type_name }} { {%- endif %}, {% endfor -%} } + +{# + unfortunately, it is not easy to disable the nonsense Default derives for new struct types, + and we have list responses containing struct-enums, so those also need to implement Default, + which then carries over to the enum type +-#} +{% set first_variant = type.variants[0] -%} +impl Default for {{ enum_type_name }} { + fn default() -> Self { + Self::{{ first_variant.name | to_upper_camel_case }} + {%- if first_variant.schema_ref is defined -%} + ({{ first_variant.schema_ref | to_upper_camel_case }}::default()) + {%- endif %} + } +}