svix 1.61.0 → 1.61.2

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application.rb +6 -12
  4. data/lib/svix/api/authentication.rb +4 -8
  5. data/lib/svix/api/background_task.rb +2 -4
  6. data/lib/svix/api/endpoint.rb +17 -34
  7. data/lib/svix/api/environment.rb +2 -4
  8. data/lib/svix/api/event_type.rb +7 -14
  9. data/lib/svix/api/health.rb +1 -2
  10. data/lib/svix/api/ingest_endpoint.rb +100 -0
  11. data/lib/svix/api/integration.rb +7 -14
  12. data/lib/svix/api/message.rb +6 -11
  13. data/lib/svix/api/message_attempt.rb +7 -14
  14. data/lib/svix/api/operational_webhook_endpoint.rb +9 -18
  15. data/lib/svix/api/statistics.rb +2 -4
  16. data/lib/svix/models/endpoint_in.rb +4 -0
  17. data/lib/svix/models/expunge_all_contents_out.rb +55 -0
  18. data/lib/svix/models/ingest_endpoint_headers_in.rb +49 -0
  19. data/lib/svix/models/ingest_endpoint_headers_out.rb +52 -0
  20. data/lib/svix/models/ingest_endpoint_in.rb +64 -0
  21. data/lib/svix/models/ingest_endpoint_out.rb +70 -0
  22. data/lib/svix/models/ingest_endpoint_secret_in.rb +49 -0
  23. data/lib/svix/models/ingest_endpoint_secret_out.rb +49 -0
  24. data/lib/svix/models/ingest_endpoint_update.rb +61 -0
  25. data/lib/svix/models/list_response_ingest_endpoint_out.rb +58 -0
  26. data/lib/svix/version.rb +1 -1
  27. data/lib/svix.rb +10 -1
  28. data/templates/api_extra/application_create.rb +16 -0
  29. data/templates/api_extra/message.rb +26 -0
  30. data/templates/api_resource.rb.jinja +71 -0
  31. data/templates/component_type.rb.jinja +7 -0
  32. data/templates/summary.rb.jinja +41 -0
  33. data/templates/types/integer_enum.rb.jinja +37 -0
  34. data/templates/types/string_enum.rb.jinja +37 -0
  35. data/templates/types/struct.rb.jinja +87 -0
  36. metadata +20 -2
@@ -39,10 +39,9 @@ module Svix
39
39
 
40
40
  def list(app_id, options = {})
41
41
  options = options.transform_keys(&:to_s)
42
- path = "/api/v1/app/#{app_id}/msg"
43
42
  res = @client.execute_request(
44
43
  "GET",
45
- path,
44
+ "/api/v1/app/#{app_id}/msg",
46
45
  query_params: {
47
46
  "limit" => options["limit"],
48
47
  "iterator" => options["iterator"],
@@ -59,10 +58,9 @@ module Svix
59
58
 
60
59
  def create(app_id, message_in, options = {})
61
60
  options = options.transform_keys(&:to_s)
62
- path = "/api/v1/app/#{app_id}/msg"
63
61
  res = @client.execute_request(
64
62
  "POST",
65
- path,
63
+ "/api/v1/app/#{app_id}/msg",
66
64
  query_params: {
67
65
  "with_content" => options["with_content"]
68
66
  },
@@ -76,23 +74,21 @@ module Svix
76
74
 
77
75
  def expunge_all_contents(app_id, options = {})
78
76
  options = options.transform_keys(&:to_s)
79
- path = "/api/v1/app/#{app_id}/msg/expunge-all-contents"
80
77
  res = @client.execute_request(
81
78
  "POST",
82
- path,
79
+ "/api/v1/app/#{app_id}/msg/expunge-all-contents",
83
80
  headers: {
84
81
  "idempotency-key" => options["idempotency-key"]
85
82
  }
86
83
  )
87
- ExpungAllContentsOut.deserialize(res)
84
+ ExpungeAllContentsOut.deserialize(res)
88
85
  end
89
86
 
90
87
  def get(app_id, msg_id, options = {})
91
88
  options = options.transform_keys(&:to_s)
92
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}"
93
89
  res = @client.execute_request(
94
90
  "GET",
95
- path,
91
+ "/api/v1/app/#{app_id}/msg/#{msg_id}",
96
92
  query_params: {
97
93
  "with_content" => options["with_content"]
98
94
  }
@@ -101,10 +97,9 @@ module Svix
101
97
  end
102
98
 
103
99
  def expunge_content(app_id, msg_id)
104
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}/content"
105
100
  @client.execute_request(
106
101
  "DELETE",
107
- path
102
+ "/api/v1/app/#{app_id}/msg/#{msg_id}/content"
108
103
  )
109
104
  end
110
105
 
@@ -11,10 +11,9 @@ module Svix
11
11
 
12
12
  def list_by_endpoint(app_id, endpoint_id, options = {})
13
13
  options = options.transform_keys(&:to_s)
14
- path = "/api/v1/app/#{app_id}/attempt/endpoint/#{endpoint_id}"
15
14
  res = @client.execute_request(
16
15
  "GET",
17
- path,
16
+ "/api/v1/app/#{app_id}/attempt/endpoint/#{endpoint_id}",
18
17
  query_params: {
19
18
  "limit" => options["limit"],
20
19
  "iterator" => options["iterator"],
@@ -34,10 +33,9 @@ module Svix
34
33
 
35
34
  def list_by_msg(app_id, msg_id, options = {})
36
35
  options = options.transform_keys(&:to_s)
37
- path = "/api/v1/app/#{app_id}/attempt/msg/#{msg_id}"
38
36
  res = @client.execute_request(
39
37
  "GET",
40
- path,
38
+ "/api/v1/app/#{app_id}/attempt/msg/#{msg_id}",
41
39
  query_params: {
42
40
  "limit" => options["limit"],
43
41
  "iterator" => options["iterator"],
@@ -57,10 +55,9 @@ module Svix
57
55
 
58
56
  def list_attempted_messages(app_id, endpoint_id, options = {})
59
57
  options = options.transform_keys(&:to_s)
60
- path = "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/msg"
61
58
  res = @client.execute_request(
62
59
  "GET",
63
- path,
60
+ "/api/v1/app/#{app_id}/endpoint/#{endpoint_id}/msg",
64
61
  query_params: {
65
62
  "limit" => options["limit"],
66
63
  "iterator" => options["iterator"],
@@ -77,28 +74,25 @@ module Svix
77
74
  end
78
75
 
79
76
  def get(app_id, msg_id, attempt_id)
80
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}"
81
77
  res = @client.execute_request(
82
78
  "GET",
83
- path
79
+ "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}"
84
80
  )
85
81
  MessageAttemptOut.deserialize(res)
86
82
  end
87
83
 
88
84
  def expunge_content(app_id, msg_id, attempt_id)
89
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}/content"
90
85
  @client.execute_request(
91
86
  "DELETE",
92
- path
87
+ "/api/v1/app/#{app_id}/msg/#{msg_id}/attempt/#{attempt_id}/content"
93
88
  )
94
89
  end
95
90
 
96
91
  def list_attempted_destinations(app_id, msg_id, options = {})
97
92
  options = options.transform_keys(&:to_s)
98
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint"
99
93
  res = @client.execute_request(
100
94
  "GET",
101
- path,
95
+ "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint",
102
96
  query_params: {
103
97
  "limit" => options["limit"],
104
98
  "iterator" => options["iterator"]
@@ -109,10 +103,9 @@ module Svix
109
103
 
110
104
  def resend(app_id, msg_id, endpoint_id, options = {})
111
105
  options = options.transform_keys(&:to_s)
112
- path = "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint/#{endpoint_id}/resend"
113
106
  @client.execute_request(
114
107
  "POST",
115
- path,
108
+ "/api/v1/app/#{app_id}/msg/#{msg_id}/endpoint/#{endpoint_id}/resend",
116
109
  headers: {
117
110
  "idempotency-key" => options["idempotency-key"]
118
111
  }
@@ -11,10 +11,9 @@ module Svix
11
11
 
12
12
  def list(options = {})
13
13
  options = options.transform_keys(&:to_s)
14
- path = "/api/v1/operational-webhook/endpoint"
15
14
  res = @client.execute_request(
16
15
  "GET",
17
- path,
16
+ "/api/v1/operational-webhook/endpoint",
18
17
  query_params: {
19
18
  "limit" => options["limit"],
20
19
  "iterator" => options["iterator"],
@@ -26,10 +25,9 @@ module Svix
26
25
 
27
26
  def create(operational_webhook_endpoint_in, options = {})
28
27
  options = options.transform_keys(&:to_s)
29
- path = "/api/v1/operational-webhook/endpoint"
30
28
  res = @client.execute_request(
31
29
  "POST",
32
- path,
30
+ "/api/v1/operational-webhook/endpoint",
33
31
  headers: {
34
32
  "idempotency-key" => options["idempotency-key"]
35
33
  },
@@ -39,65 +37,58 @@ module Svix
39
37
  end
40
38
 
41
39
  def get(endpoint_id)
42
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}"
43
40
  res = @client.execute_request(
44
41
  "GET",
45
- path
42
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}"
46
43
  )
47
44
  OperationalWebhookEndpointOut.deserialize(res)
48
45
  end
49
46
 
50
47
  def update(endpoint_id, operational_webhook_endpoint_update)
51
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}"
52
48
  res = @client.execute_request(
53
49
  "PUT",
54
- path,
50
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}",
55
51
  body: operational_webhook_endpoint_update
56
52
  )
57
53
  OperationalWebhookEndpointOut.deserialize(res)
58
54
  end
59
55
 
60
56
  def delete(endpoint_id)
61
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}"
62
57
  @client.execute_request(
63
58
  "DELETE",
64
- path
59
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}"
65
60
  )
66
61
  end
67
62
 
68
63
  def get_headers(endpoint_id)
69
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}/headers"
70
64
  res = @client.execute_request(
71
65
  "GET",
72
- path
66
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}/headers"
73
67
  )
74
68
  OperationalWebhookEndpointHeadersOut.deserialize(res)
75
69
  end
76
70
 
77
71
  def update_headers(endpoint_id, operational_webhook_endpoint_headers_in)
78
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}/headers"
79
72
  @client.execute_request(
80
73
  "PUT",
81
- path,
74
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}/headers",
82
75
  body: operational_webhook_endpoint_headers_in
83
76
  )
84
77
  end
85
78
 
86
79
  def get_secret(endpoint_id)
87
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}/secret"
88
80
  res = @client.execute_request(
89
81
  "GET",
90
- path
82
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}/secret"
91
83
  )
92
84
  OperationalWebhookEndpointSecretOut.deserialize(res)
93
85
  end
94
86
 
95
87
  def rotate_secret(endpoint_id, operational_webhook_endpoint_secret_in, options = {})
96
88
  options = options.transform_keys(&:to_s)
97
- path = "/api/v1/operational-webhook/endpoint/#{endpoint_id}/secret/rotate"
98
89
  @client.execute_request(
99
90
  "POST",
100
- path,
91
+ "/api/v1/operational-webhook/endpoint/#{endpoint_id}/secret/rotate",
101
92
  headers: {
102
93
  "idempotency-key" => options["idempotency-key"]
103
94
  },
@@ -11,10 +11,9 @@ module Svix
11
11
 
12
12
  def aggregate_app_stats(app_usage_stats_in, options = {})
13
13
  options = options.transform_keys(&:to_s)
14
- path = "/api/v1/stats/usage/app"
15
14
  res = @client.execute_request(
16
15
  "POST",
17
- path,
16
+ "/api/v1/stats/usage/app",
18
17
  headers: {
19
18
  "idempotency-key" => options["idempotency-key"]
20
19
  },
@@ -24,10 +23,9 @@ module Svix
24
23
  end
25
24
 
26
25
  def aggregate_event_types
27
- path = "/api/v1/stats/usage/event-types"
28
26
  res = @client.execute_request(
29
27
  "PUT",
30
- path
28
+ "/api/v1/stats/usage/event-types"
31
29
  )
32
30
  AggregateEventTypesOut.deserialize(res)
33
31
  end
@@ -8,6 +8,7 @@ module Svix
8
8
  attr_accessor :description
9
9
  attr_accessor :disabled
10
10
  attr_accessor :filter_types
11
+ attr_accessor :headers
11
12
  attr_accessor :metadata
12
13
  attr_accessor :rate_limit
13
14
  attr_accessor :secret
@@ -20,6 +21,7 @@ module Svix
20
21
  "description",
21
22
  "disabled",
22
23
  "filter_types",
24
+ "headers",
23
25
  "metadata",
24
26
  "rate_limit",
25
27
  "secret",
@@ -51,6 +53,7 @@ module Svix
51
53
  attrs["description"] = attributes["description"]
52
54
  attrs["disabled"] = attributes["disabled"]
53
55
  attrs["filter_types"] = attributes["filterTypes"]
56
+ attrs["headers"] = attributes["headers"]
54
57
  attrs["metadata"] = attributes["metadata"]
55
58
  attrs["rate_limit"] = attributes["rateLimit"]
56
59
  attrs["secret"] = attributes["secret"]
@@ -66,6 +69,7 @@ module Svix
66
69
  out["description"] = Svix::serialize_primitive(@description) if @description
67
70
  out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled
68
71
  out["filterTypes"] = Svix::serialize_primitive(@filter_types) if @filter_types
72
+ out["headers"] = Svix::serialize_primitive(@headers) if @headers
69
73
  out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata
70
74
  out["rateLimit"] = Svix::serialize_primitive(@rate_limit) if @rate_limit
71
75
  out["secret"] = Svix::serialize_primitive(@secret) if @secret
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class ExpungeAllContentsOut
7
+ attr_accessor :id
8
+ attr_accessor :status
9
+ attr_accessor :task
10
+
11
+ ALL_FIELD ||= ["id", "status", "task"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(
17
+ ArgumentError,
18
+ "The input argument (attributes) must be a hash in `Svix::ExpungeAllContentsOut` new method"
19
+ )
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::ExpungeAllContentsOut")
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["id"] = attributes["id"]
36
+ attrs["status"] = Svix::BackgroundTaskStatus.deserialize(attributes["status"])
37
+ attrs["task"] = Svix::BackgroundTaskType.deserialize(attributes["task"])
38
+ new(attrs)
39
+ end
40
+
41
+ def serialize
42
+ out = Hash.new
43
+ out["id"] = Svix::serialize_primitive(@id) if @id
44
+ out["status"] = @status.serialize if @status
45
+ out["task"] = @task.serialize if @task
46
+ out
47
+ end
48
+
49
+ # Serializes the object to a json string
50
+ # @return String
51
+ def to_json
52
+ JSON.dump(serialize)
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointHeadersIn
7
+ attr_accessor :headers
8
+
9
+ ALL_FIELD ||= ["headers"].freeze
10
+ private_constant :ALL_FIELD
11
+
12
+ def initialize(attributes = {})
13
+ unless attributes.is_a?(Hash)
14
+ fail(
15
+ ArgumentError,
16
+ "The input argument (attributes) must be a hash in `Svix::IngestEndpointHeadersIn` new method"
17
+ )
18
+ end
19
+
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestEndpointHeadersIn")
23
+ end
24
+
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
27
+ end
28
+ end
29
+
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["headers"] = attributes["headers"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["headers"] = Svix::serialize_primitive(@headers) if @headers
40
+ out
41
+ end
42
+
43
+ # Serializes the object to a json string
44
+ # @return String
45
+ def to_json
46
+ JSON.dump(serialize)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointHeadersOut
7
+ attr_accessor :headers
8
+ attr_accessor :sensitive
9
+
10
+ ALL_FIELD ||= ["headers", "sensitive"].freeze
11
+ private_constant :ALL_FIELD
12
+
13
+ def initialize(attributes = {})
14
+ unless attributes.is_a?(Hash)
15
+ fail(
16
+ ArgumentError,
17
+ "The input argument (attributes) must be a hash in `Svix::IngestEndpointHeadersOut` new method"
18
+ )
19
+ end
20
+
21
+ attributes.each do |k, v|
22
+ unless ALL_FIELD.include?(k.to_s)
23
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestEndpointHeadersOut")
24
+ end
25
+
26
+ instance_variable_set("@#{k}", v)
27
+ instance_variable_set("@__#{k}_is_defined", true)
28
+ end
29
+ end
30
+
31
+ def self.deserialize(attributes = {})
32
+ attributes = attributes.transform_keys(&:to_s)
33
+ attrs = Hash.new
34
+ attrs["headers"] = attributes["headers"]
35
+ attrs["sensitive"] = attributes["sensitive"]
36
+ new(attrs)
37
+ end
38
+
39
+ def serialize
40
+ out = Hash.new
41
+ out["headers"] = Svix::serialize_primitive(@headers) if @headers
42
+ out["sensitive"] = Svix::serialize_primitive(@sensitive) if @sensitive
43
+ out
44
+ end
45
+
46
+ # Serializes the object to a json string
47
+ # @return String
48
+ def to_json
49
+ JSON.dump(serialize)
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointIn
7
+ attr_accessor :description
8
+ attr_accessor :disabled
9
+ attr_accessor :metadata
10
+ attr_accessor :rate_limit
11
+ attr_accessor :secret
12
+ attr_accessor :uid
13
+ attr_accessor :url
14
+
15
+ ALL_FIELD ||= ["description", "disabled", "metadata", "rate_limit", "secret", "uid", "url"].freeze
16
+ private_constant :ALL_FIELD
17
+
18
+ def initialize(attributes = {})
19
+ unless attributes.is_a?(Hash)
20
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::IngestEndpointIn` new method")
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::IngestEndpointIn")
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["description"] = attributes["description"]
37
+ attrs["disabled"] = attributes["disabled"]
38
+ attrs["metadata"] = attributes["metadata"]
39
+ attrs["rate_limit"] = attributes["rateLimit"]
40
+ attrs["secret"] = attributes["secret"]
41
+ attrs["uid"] = attributes["uid"]
42
+ attrs["url"] = attributes["url"]
43
+ new(attrs)
44
+ end
45
+
46
+ def serialize
47
+ out = Hash.new
48
+ out["description"] = Svix::serialize_primitive(@description) if @description
49
+ out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled
50
+ out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata
51
+ out["rateLimit"] = Svix::serialize_primitive(@rate_limit) if @rate_limit
52
+ out["secret"] = Svix::serialize_primitive(@secret) if @secret
53
+ out["uid"] = Svix::serialize_primitive(@uid) if @uid
54
+ out["url"] = Svix::serialize_primitive(@url) if @url
55
+ out
56
+ end
57
+
58
+ # Serializes the object to a json string
59
+ # @return String
60
+ def to_json
61
+ JSON.dump(serialize)
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointOut
7
+ attr_accessor :created_at
8
+ attr_accessor :description
9
+ attr_accessor :disabled
10
+ attr_accessor :id
11
+ attr_accessor :metadata
12
+ attr_accessor :rate_limit
13
+ attr_accessor :uid
14
+ attr_accessor :updated_at
15
+ attr_accessor :url
16
+
17
+ ALL_FIELD ||= ["created_at", "description", "disabled", "id", "metadata", "rate_limit", "uid", "updated_at", "url"].freeze
18
+ private_constant :ALL_FIELD
19
+
20
+ def initialize(attributes = {})
21
+ unless attributes.is_a?(Hash)
22
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::IngestEndpointOut` new method")
23
+ end
24
+
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::IngestEndpointOut")
28
+ end
29
+
30
+ instance_variable_set("@#{k}", v)
31
+ instance_variable_set("@__#{k}_is_defined", true)
32
+ end
33
+ end
34
+
35
+ def self.deserialize(attributes = {})
36
+ attributes = attributes.transform_keys(&:to_s)
37
+ attrs = Hash.new
38
+ attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
39
+ attrs["description"] = attributes["description"]
40
+ attrs["disabled"] = attributes["disabled"]
41
+ attrs["id"] = attributes["id"]
42
+ attrs["metadata"] = attributes["metadata"]
43
+ attrs["rate_limit"] = attributes["rateLimit"]
44
+ attrs["uid"] = attributes["uid"]
45
+ attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
46
+ attrs["url"] = attributes["url"]
47
+ new(attrs)
48
+ end
49
+
50
+ def serialize
51
+ out = Hash.new
52
+ out["createdAt"] = Svix::serialize_primitive(@created_at) if @created_at
53
+ out["description"] = Svix::serialize_primitive(@description) if @description
54
+ out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled
55
+ out["id"] = Svix::serialize_primitive(@id) if @id
56
+ out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata
57
+ out["rateLimit"] = Svix::serialize_primitive(@rate_limit) if @rate_limit
58
+ out["uid"] = Svix::serialize_primitive(@uid) if @uid
59
+ out["updatedAt"] = Svix::serialize_primitive(@updated_at) if @updated_at
60
+ out["url"] = Svix::serialize_primitive(@url) if @url
61
+ out
62
+ end
63
+
64
+ # Serializes the object to a json string
65
+ # @return String
66
+ def to_json
67
+ JSON.dump(serialize)
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointSecretIn
7
+ attr_accessor :key
8
+
9
+ ALL_FIELD ||= ["key"].freeze
10
+ private_constant :ALL_FIELD
11
+
12
+ def initialize(attributes = {})
13
+ unless attributes.is_a?(Hash)
14
+ fail(
15
+ ArgumentError,
16
+ "The input argument (attributes) must be a hash in `Svix::IngestEndpointSecretIn` new method"
17
+ )
18
+ end
19
+
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestEndpointSecretIn")
23
+ end
24
+
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
27
+ end
28
+ end
29
+
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["key"] = attributes["key"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["key"] = Svix::serialize_primitive(@key) if @key
40
+ out
41
+ end
42
+
43
+ # Serializes the object to a json string
44
+ # @return String
45
+ def to_json
46
+ JSON.dump(serialize)
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module Svix
6
+ class IngestEndpointSecretOut
7
+ attr_accessor :key
8
+
9
+ ALL_FIELD ||= ["key"].freeze
10
+ private_constant :ALL_FIELD
11
+
12
+ def initialize(attributes = {})
13
+ unless attributes.is_a?(Hash)
14
+ fail(
15
+ ArgumentError,
16
+ "The input argument (attributes) must be a hash in `Svix::IngestEndpointSecretOut` new method"
17
+ )
18
+ end
19
+
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of Svix::IngestEndpointSecretOut")
23
+ end
24
+
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
27
+ end
28
+ end
29
+
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["key"] = attributes["key"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["key"] = Svix::serialize_primitive(@key) if @key
40
+ out
41
+ end
42
+
43
+ # Serializes the object to a json string
44
+ # @return String
45
+ def to_json
46
+ JSON.dump(serialize)
47
+ end
48
+ end
49
+ end