Skip to content

Commit 9ade1c3

Browse files
committed
go: Add OperationalWebhook resource
1 parent 063e117 commit 9ade1c3

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

codegen.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ output_dir = "java/lib/src/main/java/com/svix/models"
124124
[go]
125125
template_dir = "openapi-templates/go"
126126
extra_shell_commands = [
127-
"rm go/{environment,health,ingest_endpoint,ingest,ingest_source,operational_webhook}.go",
127+
"rm go/{environment,health,ingest_endpoint,ingest,ingest_source}.go",
128128
]
129129
[[go.task]]
130130
template = "openapi-templates/go/api_resource.go.jinja"

go/operational_webhook.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Package svix this file is @generated DO NOT EDIT
2+
package svix
3+
4+
type OperationalWebhook struct {
5+
Endpoint *OperationalWebhookEndpoint
6+
}
7+
8+
func newOperationalWebhook(client *SvixHttpClient) *OperationalWebhook {
9+
return &OperationalWebhook{
10+
Endpoint: newOperationalWebhookEndpoint(client),
11+
}
12+
}

go/svix.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type (
2424
Message *Message
2525
MessageAttempt *MessageAttempt
2626
Statistics *Statistics
27+
OperationalWebhook *OperationalWebhook
2728
OperationalWebhookEndpoint *OperationalWebhookEndpoint
2829
}
2930
)
@@ -61,6 +62,7 @@ func New(token string, options *SvixOptions) (*Svix, error) {
6162
Integration: newIntegration(&svixHttpClient),
6263
MessageAttempt: newMessageAttempt(&svixHttpClient),
6364
Statistics: newStatistics(&svixHttpClient),
65+
OperationalWebhook: newOperationalWebhook(&svixHttpClient),
6466
OperationalWebhookEndpoint: newOperationalWebhookEndpoint(&svixHttpClient),
6567
}
6668
return &svx, nil

openapi-templates/go/api_resource.go.jinja

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func new{{ resource_type_name }}(client *SvixHttpClient) *{{ resource_type_name
2626
return &{{ resource_type_name }}{
2727
{% if resource.operations | length > 0 -%}
2828
client: client,
29-
{%- endif %}
30-
{%- for name, sub in resource.subresources | items %}
31-
{{ name | to_lower_camel_case }}: new{{ sub.name | to_upper_camel_case }}(client),
32-
{%- endfor %}
29+
{% endif -%}
30+
{% for name, sub in resource.subresources | items -%}
31+
{{ name | to_upper_camel_case }}: new{{ sub.name | to_upper_camel_case }}(client),
32+
{% endfor -%}
3333
}
3434
}
3535

0 commit comments

Comments
 (0)