svix 1.61.0 → 1.61.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/svix/api/application.rb +6 -12
- data/lib/svix/api/authentication.rb +4 -8
- data/lib/svix/api/background_task.rb +2 -4
- data/lib/svix/api/endpoint.rb +17 -34
- data/lib/svix/api/environment.rb +2 -4
- data/lib/svix/api/event_type.rb +7 -14
- data/lib/svix/api/health.rb +1 -2
- data/lib/svix/api/ingest_endpoint.rb +100 -0
- data/lib/svix/api/integration.rb +7 -14
- data/lib/svix/api/message.rb +6 -11
- data/lib/svix/api/message_attempt.rb +7 -14
- data/lib/svix/api/operational_webhook_endpoint.rb +9 -18
- data/lib/svix/api/statistics.rb +2 -4
- data/lib/svix/models/endpoint_in.rb +4 -0
- data/lib/svix/models/expunge_all_contents_out.rb +55 -0
- data/lib/svix/models/ingest_endpoint_headers_in.rb +49 -0
- data/lib/svix/models/ingest_endpoint_headers_out.rb +52 -0
- data/lib/svix/models/ingest_endpoint_in.rb +64 -0
- data/lib/svix/models/ingest_endpoint_out.rb +70 -0
- data/lib/svix/models/ingest_endpoint_secret_in.rb +49 -0
- data/lib/svix/models/ingest_endpoint_secret_out.rb +49 -0
- data/lib/svix/models/ingest_endpoint_update.rb +61 -0
- data/lib/svix/models/list_response_ingest_endpoint_out.rb +58 -0
- data/lib/svix/version.rb +1 -1
- data/lib/svix.rb +10 -1
- data/templates/api_extra/application_create.rb +16 -0
- data/templates/api_extra/message.rb +26 -0
- data/templates/api_resource.rb.jinja +71 -0
- data/templates/component_type.rb.jinja +7 -0
- data/templates/summary.rb.jinja +41 -0
- data/templates/types/integer_enum.rb.jinja +37 -0
- data/templates/types/string_enum.rb.jinja +37 -0
- data/templates/types/struct.rb.jinja +87 -0
- metadata +20 -2
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Svix
|
6
|
+
class IngestEndpointUpdate
|
7
|
+
attr_accessor :description
|
8
|
+
attr_accessor :disabled
|
9
|
+
attr_accessor :metadata
|
10
|
+
attr_accessor :rate_limit
|
11
|
+
attr_accessor :uid
|
12
|
+
attr_accessor :url
|
13
|
+
|
14
|
+
ALL_FIELD ||= ["description", "disabled", "metadata", "rate_limit", "uid", "url"].freeze
|
15
|
+
private_constant :ALL_FIELD
|
16
|
+
|
17
|
+
def initialize(attributes = {})
|
18
|
+
unless attributes.is_a?(Hash)
|
19
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::IngestEndpointUpdate` new method")
|
20
|
+
end
|
21
|
+
|
22
|
+
attributes.each do |k, v|
|
23
|
+
unless ALL_FIELD.include?(k.to_s)
|
24
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::IngestEndpointUpdate")
|
25
|
+
end
|
26
|
+
|
27
|
+
instance_variable_set("@#{k}", v)
|
28
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.deserialize(attributes = {})
|
33
|
+
attributes = attributes.transform_keys(&:to_s)
|
34
|
+
attrs = Hash.new
|
35
|
+
attrs["description"] = attributes["description"]
|
36
|
+
attrs["disabled"] = attributes["disabled"]
|
37
|
+
attrs["metadata"] = attributes["metadata"]
|
38
|
+
attrs["rate_limit"] = attributes["rateLimit"]
|
39
|
+
attrs["uid"] = attributes["uid"]
|
40
|
+
attrs["url"] = attributes["url"]
|
41
|
+
new(attrs)
|
42
|
+
end
|
43
|
+
|
44
|
+
def serialize
|
45
|
+
out = Hash.new
|
46
|
+
out["description"] = Svix::serialize_primitive(@description) if @description
|
47
|
+
out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled
|
48
|
+
out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata
|
49
|
+
out["rateLimit"] = Svix::serialize_primitive(@rate_limit) if @rate_limit
|
50
|
+
out["uid"] = Svix::serialize_primitive(@uid) if @uid
|
51
|
+
out["url"] = Svix::serialize_primitive(@url) if @url
|
52
|
+
out
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serializes the object to a json string
|
56
|
+
# @return String
|
57
|
+
def to_json
|
58
|
+
JSON.dump(serialize)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Svix
|
6
|
+
class ListResponseIngestEndpointOut
|
7
|
+
attr_accessor :data
|
8
|
+
attr_accessor :done
|
9
|
+
attr_accessor :iterator
|
10
|
+
attr_accessor :prev_iterator
|
11
|
+
|
12
|
+
ALL_FIELD ||= ["data", "done", "iterator", "prev_iterator"].freeze
|
13
|
+
private_constant :ALL_FIELD
|
14
|
+
|
15
|
+
def initialize(attributes = {})
|
16
|
+
unless attributes.is_a?(Hash)
|
17
|
+
fail(
|
18
|
+
ArgumentError,
|
19
|
+
"The input argument (attributes) must be a hash in `Svix::ListResponseIngestEndpointOut` new method"
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
attributes.each do |k, v|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of Svix::ListResponseIngestEndpointOut")
|
26
|
+
end
|
27
|
+
|
28
|
+
instance_variable_set("@#{k}", v)
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.deserialize(attributes = {})
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
35
|
+
attrs = Hash.new
|
36
|
+
attrs["data"] = attributes["data"].map { |v| Svix::IngestEndpointOut.deserialize(v) }
|
37
|
+
attrs["done"] = attributes["done"]
|
38
|
+
attrs["iterator"] = attributes["iterator"]
|
39
|
+
attrs["prev_iterator"] = attributes["prevIterator"]
|
40
|
+
new(attrs)
|
41
|
+
end
|
42
|
+
|
43
|
+
def serialize
|
44
|
+
out = Hash.new
|
45
|
+
out["data"] = @data.map { |v| v.serialize } if @data
|
46
|
+
out["done"] = Svix::serialize_primitive(@done) if @done
|
47
|
+
out["iterator"] = Svix::serialize_primitive(@iterator) if @iterator
|
48
|
+
out["prevIterator"] = Svix::serialize_primitive(@prev_iterator) if @prev_iterator
|
49
|
+
out
|
50
|
+
end
|
51
|
+
|
52
|
+
# Serializes the object to a json string
|
53
|
+
# @return String
|
54
|
+
def to_json
|
55
|
+
JSON.dump(serialize)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/svix/version.rb
CHANGED
data/lib/svix.rb
CHANGED
@@ -15,6 +15,7 @@ require "svix/api/endpoint"
|
|
15
15
|
require "svix/api/environment"
|
16
16
|
require "svix/api/event_type"
|
17
17
|
require "svix/api/health"
|
18
|
+
require "svix/api/ingest_endpoint"
|
18
19
|
require "svix/api/integration"
|
19
20
|
require "svix/api/message"
|
20
21
|
require "svix/api/message_attempt"
|
@@ -61,7 +62,14 @@ require "svix/models/event_type_in"
|
|
61
62
|
require "svix/models/event_type_out"
|
62
63
|
require "svix/models/event_type_patch"
|
63
64
|
require "svix/models/event_type_update"
|
64
|
-
require "svix/models/
|
65
|
+
require "svix/models/expunge_all_contents_out"
|
66
|
+
require "svix/models/ingest_endpoint_headers_in"
|
67
|
+
require "svix/models/ingest_endpoint_headers_out"
|
68
|
+
require "svix/models/ingest_endpoint_in"
|
69
|
+
require "svix/models/ingest_endpoint_out"
|
70
|
+
require "svix/models/ingest_endpoint_secret_in"
|
71
|
+
require "svix/models/ingest_endpoint_secret_out"
|
72
|
+
require "svix/models/ingest_endpoint_update"
|
65
73
|
require "svix/models/integration_in"
|
66
74
|
require "svix/models/integration_key_out"
|
67
75
|
require "svix/models/integration_out"
|
@@ -71,6 +79,7 @@ require "svix/models/list_response_background_task_out"
|
|
71
79
|
require "svix/models/list_response_endpoint_message_out"
|
72
80
|
require "svix/models/list_response_endpoint_out"
|
73
81
|
require "svix/models/list_response_event_type_out"
|
82
|
+
require "svix/models/list_response_ingest_endpoint_out"
|
74
83
|
require "svix/models/list_response_integration_out"
|
75
84
|
require "svix/models/list_response_message_attempt_out"
|
76
85
|
require "svix/models/list_response_message_endpoint_out"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
def get_or_create(application_in, options = {})
|
2
|
+
options = options.transform_keys(&:to_s)
|
3
|
+
path = "/api/v1/app"
|
4
|
+
res = @client.execute_request(
|
5
|
+
"POST",
|
6
|
+
path,
|
7
|
+
query_params: {
|
8
|
+
"get_if_exists" => true
|
9
|
+
},
|
10
|
+
headers: {
|
11
|
+
"idempotency-key" => options["idempotency-key"]
|
12
|
+
},
|
13
|
+
body: application_in
|
14
|
+
)
|
15
|
+
ApplicationOut.deserialize(res)
|
16
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Creates a [`MessageIn`] with a raw string payload.
|
2
|
+
#
|
3
|
+
# The payload is not normalized on the server. Normally, payloads are required
|
4
|
+
# to be JSON, and Svix will minify the payload before sending the webhook
|
5
|
+
# (for example, by removing extraneous whitespace or unnecessarily escaped
|
6
|
+
# characters in strings). With this function, the payload will be sent
|
7
|
+
# "as is", without any minification or other processing.
|
8
|
+
#
|
9
|
+
# `attributes[:payload]` must be a string. An extra attribute `content_type`
|
10
|
+
# is accepted that sets the `content-type` header of the webhook sent by Svix,
|
11
|
+
# overwriting the default of `application/json` if specified. Other than that,
|
12
|
+
# the attributes are forwarded [`MessageIn.new`], so all the same ones are
|
13
|
+
# accepted.
|
14
|
+
def message_in_raw(attributes = {})
|
15
|
+
attributes[:transformations_params] ||= {}
|
16
|
+
attributes[:transformations_params][:rawPayload] = attributes[:payload]
|
17
|
+
attributes[:payload] = {}
|
18
|
+
|
19
|
+
content_type = attributes.delete(:content_type)
|
20
|
+
if content_type != nil
|
21
|
+
attributes[:transformations_params][:headers] ||= {}
|
22
|
+
attributes[:transformations_params][:headers][:"content-type"] = content_type
|
23
|
+
end
|
24
|
+
|
25
|
+
MessageIn.new(attributes)
|
26
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
{% set resource_type_name = resource.name | to_upper_camel_case -%}
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# This file is @generated
|
4
|
+
|
5
|
+
require 'net/http'
|
6
|
+
|
7
|
+
|
8
|
+
module Svix
|
9
|
+
{% if resource.name == "message" -%}
|
10
|
+
module_function
|
11
|
+
{% include "api_extra/message.rb" %}
|
12
|
+
{% endif -%}
|
13
|
+
class {{ resource_type_name }}
|
14
|
+
def initialize(client)
|
15
|
+
@client = client
|
16
|
+
end
|
17
|
+
{% for op in resource.operations %}
|
18
|
+
{% set func_args -%}
|
19
|
+
{# path params -#}
|
20
|
+
{%- for p in op.path_params -%}
|
21
|
+
{{ p | to_snake_case }},
|
22
|
+
{%- endfor -%}
|
23
|
+
{# request body -#}
|
24
|
+
{%- if op.request_body_schema_name is defined -%}
|
25
|
+
{{ op.request_body_schema_name | to_snake_case }},
|
26
|
+
{%- endif -%}
|
27
|
+
{# header/query params -#}
|
28
|
+
{%- if op | has_query_or_header_params -%}
|
29
|
+
options = {}
|
30
|
+
{%- endif -%}
|
31
|
+
{% endset -%}
|
32
|
+
|
33
|
+
def {{ op.name | to_snake_case }}({{ func_args | strip_trailing_comma }})
|
34
|
+
{% if op | has_query_or_header_params -%}
|
35
|
+
options = options.transform_keys(&:to_s)
|
36
|
+
{% endif -%}
|
37
|
+
{% if op.response_body_schema_name is defined -%}res = {% endif -%}
|
38
|
+
@client.execute_request(
|
39
|
+
"{{ op.method | upper }}",
|
40
|
+
"{{ op.path | generate_ruby_path_str(op.path_params) }}",
|
41
|
+
{% if op.query_params | length >0 -%}
|
42
|
+
query_params:{
|
43
|
+
{% for p in op.query_params -%}
|
44
|
+
"{{ p.name }}" => options["{{ p.name }}"],
|
45
|
+
{% endfor -%}
|
46
|
+
},
|
47
|
+
{% endif -%}
|
48
|
+
{% if op.header_params | length >0 -%}
|
49
|
+
headers:{
|
50
|
+
{% for p in op.header_params -%}
|
51
|
+
"{{ p.name }}" => options["{{ p.name }}"],
|
52
|
+
{% endfor -%}
|
53
|
+
},
|
54
|
+
{% endif -%}
|
55
|
+
{% if op.request_body_schema_name is defined -%}
|
56
|
+
body: {{ op.request_body_schema_name | to_snake_case }},
|
57
|
+
{% endif -%}
|
58
|
+
)
|
59
|
+
{% if op.response_body_schema_name is defined -%}
|
60
|
+
{{ op.response_body_schema_name | to_upper_camel_case }}.deserialize res
|
61
|
+
{% endif %}
|
62
|
+
end
|
63
|
+
|
64
|
+
{% set extra_path -%}
|
65
|
+
api_extra/{{ resource.name | to_snake_case }}_{{ op.name | to_snake_case }}.rb
|
66
|
+
{%- endset -%}
|
67
|
+
{% include extra_path ignore missing %}
|
68
|
+
|
69
|
+
{% endfor -%}
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
|
4
|
+
require "json"
|
5
|
+
require "openssl"
|
6
|
+
require "base64"
|
7
|
+
require "uri"
|
8
|
+
require "logger"
|
9
|
+
|
10
|
+
{% macro require_api(resource) -%}
|
11
|
+
{% if resource.operations | length > 0 -%}
|
12
|
+
require "svix/api/{{ resource.name | to_snake_case }}"
|
13
|
+
{% endif -%}
|
14
|
+
{% endmacro -%}
|
15
|
+
|
16
|
+
|
17
|
+
# API
|
18
|
+
{% for resource in api.resources -%}
|
19
|
+
{{ require_api(resource) -}}
|
20
|
+
{% for _resource_name, resource in resource.subresources | items -%}
|
21
|
+
{{ require_api(resource) -}}
|
22
|
+
{% endfor -%}
|
23
|
+
{% endfor -%}
|
24
|
+
|
25
|
+
# Models
|
26
|
+
{% for type in types -%}
|
27
|
+
require "svix/models/{{ type | to_snake_case }}"
|
28
|
+
{% endfor -%}
|
29
|
+
|
30
|
+
# Core
|
31
|
+
require "svix/api_error"
|
32
|
+
require "svix/errors"
|
33
|
+
require "svix/svix"
|
34
|
+
require "svix/util"
|
35
|
+
require "svix/version"
|
36
|
+
require "svix/webhook"
|
37
|
+
require "svix/http_error_out"
|
38
|
+
require "svix/http_validation_error"
|
39
|
+
require "svix/validation_error"
|
40
|
+
require "svix/svix_http_client.rb"
|
41
|
+
require "svix/internal"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
{% set class_ty = type.name | to_upper_camel_case -%}
|
4
|
+
|
5
|
+
module Svix
|
6
|
+
{% if type.description is defined -%}
|
7
|
+
{{ type.description | to_doc_comment(style="ruby") | indent(4) }}
|
8
|
+
{% endif -%}
|
9
|
+
class {{ class_ty }}
|
10
|
+
{% for name, value in type.variants -%}
|
11
|
+
{{ name | to_upper_snake_case }} = {{ value }}.freeze
|
12
|
+
{% endfor %}
|
13
|
+
def self.all_vars
|
14
|
+
@all_vars ||= [
|
15
|
+
{%- for name, value in type.variants -%}
|
16
|
+
{{ name | to_upper_snake_case }},
|
17
|
+
{%- endfor -%}
|
18
|
+
].freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(value)
|
22
|
+
unless {{ class_ty }}.all_vars.include?(value)
|
23
|
+
raise "Invalid ENUM value '#{value}' for class #{{ class_ty }}"
|
24
|
+
end
|
25
|
+
@value = value
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.deserialize(value)
|
29
|
+
return value if {{ class_ty }}.all_vars.include?(value)
|
30
|
+
raise "Invalid ENUM value '#{value}' for class #{{ class_ty }}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def serialize
|
34
|
+
@value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
{% set class_ty = type.name | to_upper_camel_case -%}
|
4
|
+
|
5
|
+
module Svix
|
6
|
+
{% if type.description is defined -%}
|
7
|
+
{{ type.description | to_doc_comment(style="ruby") | indent(4) }}
|
8
|
+
{% endif -%}
|
9
|
+
class {{ class_ty }}
|
10
|
+
{% for value in type.values -%}
|
11
|
+
{{ value | to_upper_snake_case }} = "{{ value }}".freeze
|
12
|
+
{% endfor %}
|
13
|
+
def self.all_vars
|
14
|
+
@all_vars ||= [
|
15
|
+
{%- for value in type.values -%}
|
16
|
+
{{ value | to_upper_snake_case }},
|
17
|
+
{%- endfor -%}
|
18
|
+
].freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(value)
|
22
|
+
unless {{ class_ty }}.all_vars.include?(value)
|
23
|
+
raise "Invalid ENUM value '#{value}' for class #{{ class_ty }}"
|
24
|
+
end
|
25
|
+
@value = value
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.deserialize(value)
|
29
|
+
return value if {{ class_ty }}.all_vars.include?(value)
|
30
|
+
raise "Invalid ENUM value '#{value}' for class #{{ class_ty }}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def serialize
|
34
|
+
@value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file is @generated
|
3
|
+
{% set class_ty = type.name | to_upper_camel_case -%}
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Svix
|
7
|
+
{% if type.description is defined -%}
|
8
|
+
{{ type.description | to_doc_comment(style="ruby") | indent(4) }}
|
9
|
+
{% endif -%}
|
10
|
+
class {{ class_ty }}
|
11
|
+
{% for field in type.fields -%}
|
12
|
+
attr_accessor :{{ field.name | to_snake_case }}
|
13
|
+
{% endfor %}
|
14
|
+
ALL_FIELD ||= [
|
15
|
+
{%- for f in type.fields -%}
|
16
|
+
"{{ f.name | to_snake_case }}"{% if not loop.last %},{% endif %}
|
17
|
+
{%- endfor -%}
|
18
|
+
].freeze
|
19
|
+
private_constant :ALL_FIELD
|
20
|
+
|
21
|
+
def initialize(attributes = {})
|
22
|
+
unless attributes.is_a?(Hash)
|
23
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Svix::{{ class_ty }}` new method"
|
24
|
+
end
|
25
|
+
attributes.each do |k, v|
|
26
|
+
unless ALL_FIELD.include? k.to_s
|
27
|
+
fail ArgumentError, "The field #{k} is not part of Svix::{{ class_ty }}"
|
28
|
+
end
|
29
|
+
instance_variable_set("@#{k}", v)
|
30
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.deserialize(attributes = {})
|
35
|
+
attributes = attributes.transform_keys(&:to_s)
|
36
|
+
attrs = Hash.new
|
37
|
+
{% for field in type.fields -%}
|
38
|
+
{% set val_expr %}attributes['{{ field.name }}']{% endset -%}
|
39
|
+
{% set not_nil_check = "" -%}
|
40
|
+
{% if not field.required -%}
|
41
|
+
{% set not_nil_check %}if {{ val_expr }}{% endset -%}
|
42
|
+
{% endif -%}
|
43
|
+
|
44
|
+
{% if (field.type.is_set() or field.type.is_list()) and field.type.inner_type().is_schema_ref() -%}
|
45
|
+
{% set val_expr -%}
|
46
|
+
attributes['{{ field.name }}'].map { | v | Svix::{{ field.type.inner_type().to_ruby() }}.deserialize v } {{ not_nil_check }}
|
47
|
+
{%- endset -%}
|
48
|
+
{% elif field.type.is_schema_ref() -%}
|
49
|
+
{% set val_expr -%}
|
50
|
+
Svix::{{ field.type.to_ruby() }}.deserialize(attributes['{{ field.name }}']) {{ not_nil_check }}
|
51
|
+
{%- endset -%}
|
52
|
+
{% elif field.type.is_datetime() -%}
|
53
|
+
{% set val_expr %}DateTime.rfc3339({{ val_expr }}).to_time {{ not_nil_check }}{% endset -%}
|
54
|
+
{% endif -%}
|
55
|
+
attrs['{{ field.name | to_snake_case }}'] = {{ val_expr }}
|
56
|
+
{% endfor -%}
|
57
|
+
new attrs
|
58
|
+
end
|
59
|
+
|
60
|
+
def serialize
|
61
|
+
out = Hash.new
|
62
|
+
{% for field in type.fields -%}
|
63
|
+
{% set val_expr %}@{{ field.name | to_snake_case }}{% endset -%}
|
64
|
+
|
65
|
+
{% if (field.type.is_set() or field.type.is_list()) and field.type.inner_type().is_schema_ref() -%}
|
66
|
+
{% set val_expr %}{{ val_expr }}.map { | v | v.serialize }{% endset -%}
|
67
|
+
{% elif field.type.is_schema_ref() -%}
|
68
|
+
{% set val_expr %}{{ val_expr }}.serialize{% endset -%}
|
69
|
+
{% else -%}
|
70
|
+
{% set val_expr %}Svix::serialize_primitive({{ val_expr }}){% endset -%}
|
71
|
+
{% endif -%}
|
72
|
+
{% if type.name is endingwith "Patch" and field.nullable -%}
|
73
|
+
out['{{ field.name }}'] = {{ val_expr }} if @__{{ field.name | to_snake_case }}_is_defined
|
74
|
+
{% else -%}
|
75
|
+
out['{{ field.name }}'] = {{ val_expr }} if @{{ field.name | to_snake_case }}
|
76
|
+
{% endif -%}
|
77
|
+
{% endfor -%}
|
78
|
+
out
|
79
|
+
end
|
80
|
+
|
81
|
+
# Serializes the object to a json string
|
82
|
+
# @return String
|
83
|
+
def to_json
|
84
|
+
JSON.dump(serialize)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.61.
|
4
|
+
version: 1.61.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svix
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/svix/api/environment.rb
|
71
71
|
- lib/svix/api/event_type.rb
|
72
72
|
- lib/svix/api/health.rb
|
73
|
+
- lib/svix/api/ingest_endpoint.rb
|
73
74
|
- lib/svix/api/integration.rb
|
74
75
|
- lib/svix/api/message.rb
|
75
76
|
- lib/svix/api/message_attempt.rb
|
@@ -120,6 +121,14 @@ files:
|
|
120
121
|
- lib/svix/models/event_type_patch.rb
|
121
122
|
- lib/svix/models/event_type_update.rb
|
122
123
|
- lib/svix/models/expung_all_contents_out.rb
|
124
|
+
- lib/svix/models/expunge_all_contents_out.rb
|
125
|
+
- lib/svix/models/ingest_endpoint_headers_in.rb
|
126
|
+
- lib/svix/models/ingest_endpoint_headers_out.rb
|
127
|
+
- lib/svix/models/ingest_endpoint_in.rb
|
128
|
+
- lib/svix/models/ingest_endpoint_out.rb
|
129
|
+
- lib/svix/models/ingest_endpoint_secret_in.rb
|
130
|
+
- lib/svix/models/ingest_endpoint_secret_out.rb
|
131
|
+
- lib/svix/models/ingest_endpoint_update.rb
|
123
132
|
- lib/svix/models/integration_in.rb
|
124
133
|
- lib/svix/models/integration_key_out.rb
|
125
134
|
- lib/svix/models/integration_out.rb
|
@@ -129,6 +138,7 @@ files:
|
|
129
138
|
- lib/svix/models/list_response_endpoint_message_out.rb
|
130
139
|
- lib/svix/models/list_response_endpoint_out.rb
|
131
140
|
- lib/svix/models/list_response_event_type_out.rb
|
141
|
+
- lib/svix/models/list_response_ingest_endpoint_out.rb
|
132
142
|
- lib/svix/models/list_response_integration_out.rb
|
133
143
|
- lib/svix/models/list_response_message_attempt_out.rb
|
134
144
|
- lib/svix/models/list_response_message_endpoint_out.rb
|
@@ -161,6 +171,14 @@ files:
|
|
161
171
|
- lib/svix/version.rb
|
162
172
|
- lib/svix/webhook.rb
|
163
173
|
- svix.gemspec
|
174
|
+
- templates/api_extra/application_create.rb
|
175
|
+
- templates/api_extra/message.rb
|
176
|
+
- templates/api_resource.rb.jinja
|
177
|
+
- templates/component_type.rb.jinja
|
178
|
+
- templates/summary.rb.jinja
|
179
|
+
- templates/types/integer_enum.rb.jinja
|
180
|
+
- templates/types/string_enum.rb.jinja
|
181
|
+
- templates/types/struct.rb.jinja
|
164
182
|
homepage: https://www.svix.com
|
165
183
|
licenses:
|
166
184
|
- MIT
|