leal 0.0.13 → 0.0.14

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 (21) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/lib/leal/client.rb +6 -1
  4. data/lib/leal/version.rb +1 -1
  5. data/lib/leal/webhook_subscriptions/client.rb +316 -0
  6. data/lib/leal/webhook_subscriptions/types/delete_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +13 -0
  7. data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +13 -0
  8. data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_id_response.rb +41 -0
  9. data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_request.rb +13 -0
  10. data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_response_item.rb +39 -0
  11. data/lib/leal/webhook_subscriptions/types/patch_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +25 -0
  12. data/lib/leal/webhook_subscriptions/types/patch_api_v1accounts_account_id_webhook_subscriptions_id_response.rb +39 -0
  13. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret_request.rb +13 -0
  14. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret_response.rb +41 -0
  15. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_test_request.rb +13 -0
  16. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_test_response.rb +17 -0
  17. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_request.rb +23 -0
  18. data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_response.rb +41 -0
  19. data/lib/leal.rb +14 -0
  20. data/reference.md +602 -0
  21. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee8d806e7b8d6d98d79269b844354f11972d4842fea558feef41eb7a92fc3ab7
4
- data.tar.gz: ae8293b72e84f8186bd7bd102f490eaaf70ec1cb2e46e335f796b7fd624747a3
3
+ metadata.gz: e3a2732500c8c1b1883576904d52230e44d4519f0cb028d7daededbc33136971
4
+ data.tar.gz: 02f7a1b104b6f134429e874a40fd9c280bd1019dd83b8d18380a5ec23abe3118
5
5
  SHA512:
6
- metadata.gz: 5f05c8a8eb64dcbac004d421662624b39527676a75e0ad1191b462cb4168659280cec29163b00049b3a61de223f5a65a4cea02c7b9c57cb84b617f408f261a32
7
- data.tar.gz: c85f0932c3447e362f535de0f35a1e5511ab1c00093e50a422d2e11d994b820dda19faf71b362a64ba90e7201750ecb305b76c21adb44dd046fafaf548170fbc
6
+ metadata.gz: 2eae523c1952ea245b021ecc561b83b11e72473c079e21b48750b28139eb323002c7d4118c73f2ec4827de16984672e20e43c60c0441d07d1b9f213d55075787
7
+ data.tar.gz: 9d5ab64ba2e5184d295af1c73c2d99d0eabc8522f80845e895188a8835fa2b649c93046b2782ee76afdb0771e9aba0d34aa059717fcede8a951490318d99959c
data/.fern/metadata.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "cliVersion": "5.102.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
4
  "generatorVersion": "1.23.2",
5
- "originGitCommit": "f13b96a1f212cbefc16ceb19311812ac4423ff44",
5
+ "originGitCommit": "cf2e805c2a9dd96e6e7e0632ed8a5e47243a8d4f",
6
6
  "originGitCommitIsDirty": false,
7
7
  "invokedBy": "ci",
8
8
  "ciProvider": "github",
9
- "sdkVersion": "0.0.13"
9
+ "sdkVersion": "0.0.14"
10
10
  }
data/lib/leal/client.rb CHANGED
@@ -11,7 +11,7 @@ module Leal
11
11
  @raw_client = Leal::Internal::Http::RawClient.new(
12
12
  base_url: base_url || Leal::Environment::PRODUCTION,
13
13
  headers: {
14
- "User-Agent" => "leal/0.0.13",
14
+ "User-Agent" => "leal/0.0.14",
15
15
  "X-Fern-Language" => "Ruby",
16
16
  Authorization: "Bearer #{token}"
17
17
  },
@@ -54,6 +54,11 @@ module Leal
54
54
  @rewards ||= Leal::Rewards::Client.new(client: @raw_client)
55
55
  end
56
56
 
57
+ # @return [Leal::WebhookSubscriptions::Client]
58
+ def webhook_subscriptions
59
+ @webhook_subscriptions ||= Leal::WebhookSubscriptions::Client.new(client: @raw_client)
60
+ end
61
+
57
62
  # @return [Leal::Status::Client]
58
63
  def status
59
64
  @status ||= Leal::Status::Client.new(client: @raw_client)
data/lib/leal/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leal
4
- VERSION = "0.0.13"
4
+ VERSION = "0.0.14"
5
5
  end
@@ -0,0 +1,316 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ class Client
6
+ # @param client [Leal::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Returns every webhook subscription for the store, oldest first. Signing secrets are not included; fetch a single
14
+ # subscription to read its secret.
15
+ #
16
+ # @param request_options [Hash]
17
+ # @param params [Hash]
18
+ # @option request_options [String] :base_url
19
+ # @option request_options [Hash{String => Object}] :additional_headers
20
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
21
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
22
+ # @option request_options [Integer] :timeout_in_seconds
23
+ # @option params [Integer] :account_id
24
+ # @option params [String, nil] :event
25
+ #
26
+ # @example
27
+ # client.webhook_subscriptions.get_api_v1accounts_account_id_webhook_subscriptions(account_id: 1)
28
+ #
29
+ # @return [Array[Leal::WebhookSubscriptions::Types::GetAPIV1AccountsAccountIDWebhookSubscriptionsResponseItem]]
30
+ def get_api_v1accounts_account_id_webhook_subscriptions(request_options: {}, **params)
31
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
32
+ query_params = {}
33
+ query_params["event"] = params[:event] if params.key?(:event)
34
+
35
+ request = Leal::Internal::JSON::Request.new(
36
+ base_url: request_options[:base_url],
37
+ method: "GET",
38
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions",
39
+ query: query_params,
40
+ request_options: request_options
41
+ )
42
+ begin
43
+ response = @client.send(request)
44
+ rescue Net::HTTPRequestTimeout
45
+ raise Leal::Errors::TimeoutError
46
+ end
47
+ code = response.code.to_i
48
+ return if code.between?(200, 299)
49
+
50
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
51
+ raise error_class.new(response.body, code: code)
52
+ end
53
+
54
+ # Subscribes a URL to one or more events. The response includes the signing `secret`; store it to
55
+ # verify deliveries. The URL must be publicly reachable over https.
56
+ #
57
+ # Events: `customer.created`, `customer.updated`, `customer_card.created`, `stamp.earned`, `stamp.removed`,
58
+ # `reward.unlocked`, `reward.redeemed`, or `*` for all of them.
59
+ #
60
+ # @param request_options [Hash]
61
+ # @param params [Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsRequest]
62
+ # @option request_options [String] :base_url
63
+ # @option request_options [Hash{String => Object}] :additional_headers
64
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
65
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
66
+ # @option request_options [Integer] :timeout_in_seconds
67
+ # @option params [Integer] :account_id
68
+ #
69
+ # @example
70
+ # client.webhook_subscriptions.post_api_v1accounts_account_id_webhook_subscriptions(
71
+ # account_id: 1,
72
+ # target_url: "target_url"
73
+ # )
74
+ #
75
+ # @return [Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsResponse]
76
+ def post_api_v1accounts_account_id_webhook_subscriptions(request_options: {}, **params)
77
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
78
+ request_data = Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsRequest.new(params).to_h
79
+ non_body_param_names = %w[account_id]
80
+ body = request_data.except(*non_body_param_names)
81
+
82
+ request = Leal::Internal::JSON::Request.new(
83
+ base_url: request_options[:base_url],
84
+ method: "POST",
85
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions",
86
+ body: body,
87
+ request_options: request_options
88
+ )
89
+ begin
90
+ response = @client.send(request)
91
+ rescue Net::HTTPRequestTimeout
92
+ raise Leal::Errors::TimeoutError
93
+ end
94
+ code = response.code.to_i
95
+ if code.between?(200, 299)
96
+ Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsResponse.load(response.body)
97
+ else
98
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
99
+ raise error_class.new(response.body, code: code)
100
+ end
101
+ end
102
+
103
+ # Returns a single subscription, including its signing secret and the result of the most recent delivery.
104
+ #
105
+ # @param request_options [Hash]
106
+ # @param params [Hash]
107
+ # @option request_options [String] :base_url
108
+ # @option request_options [Hash{String => Object}] :additional_headers
109
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
110
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
111
+ # @option request_options [Integer] :timeout_in_seconds
112
+ # @option params [Integer] :account_id
113
+ # @option params [Integer] :id
114
+ #
115
+ # @example
116
+ # client.webhook_subscriptions.get_api_v1accounts_account_id_webhook_subscriptions_id(
117
+ # account_id: 1,
118
+ # id: 1
119
+ # )
120
+ #
121
+ # @return [Leal::WebhookSubscriptions::Types::GetAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse]
122
+ def get_api_v1accounts_account_id_webhook_subscriptions_id(request_options: {}, **params)
123
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
124
+ request = Leal::Internal::JSON::Request.new(
125
+ base_url: request_options[:base_url],
126
+ method: "GET",
127
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions/#{URI.encode_uri_component(params[:id].to_s)}",
128
+ request_options: request_options
129
+ )
130
+ begin
131
+ response = @client.send(request)
132
+ rescue Net::HTTPRequestTimeout
133
+ raise Leal::Errors::TimeoutError
134
+ end
135
+ code = response.code.to_i
136
+ if code.between?(200, 299)
137
+ Leal::WebhookSubscriptions::Types::GetAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse.load(response.body)
138
+ else
139
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
140
+ raise error_class.new(response.body, code: code)
141
+ end
142
+ end
143
+
144
+ # Stops deliveries and deletes the subscription. This cannot be undone.
145
+ #
146
+ # @param request_options [Hash]
147
+ # @param params [Hash]
148
+ # @option request_options [String] :base_url
149
+ # @option request_options [Hash{String => Object}] :additional_headers
150
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
151
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
152
+ # @option request_options [Integer] :timeout_in_seconds
153
+ # @option params [Integer] :account_id
154
+ # @option params [Integer] :id
155
+ #
156
+ # @example
157
+ # client.webhook_subscriptions.delete_api_v1accounts_account_id_webhook_subscriptions_id(
158
+ # account_id: 1,
159
+ # id: 1
160
+ # )
161
+ #
162
+ # @return [untyped]
163
+ def delete_api_v1accounts_account_id_webhook_subscriptions_id(request_options: {}, **params)
164
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
165
+ request = Leal::Internal::JSON::Request.new(
166
+ base_url: request_options[:base_url],
167
+ method: "DELETE",
168
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions/#{URI.encode_uri_component(params[:id].to_s)}",
169
+ request_options: request_options
170
+ )
171
+ begin
172
+ response = @client.send(request)
173
+ rescue Net::HTTPRequestTimeout
174
+ raise Leal::Errors::TimeoutError
175
+ end
176
+ code = response.code.to_i
177
+ return if code.between?(200, 299)
178
+
179
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
180
+ raise error_class.new(response.body, code: code)
181
+ end
182
+
183
+ # Changes the URL, events, label or payload format, or turns the subscription off and on. Re-enabling a
184
+ # subscription that was disabled for failing clears its failure state.
185
+ #
186
+ # @param request_options [Hash]
187
+ # @param params [Leal::WebhookSubscriptions::Types::PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDRequest]
188
+ # @option request_options [String] :base_url
189
+ # @option request_options [Hash{String => Object}] :additional_headers
190
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
191
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
192
+ # @option request_options [Integer] :timeout_in_seconds
193
+ # @option params [Integer] :account_id
194
+ # @option params [Integer] :id
195
+ #
196
+ # @example
197
+ # client.webhook_subscriptions.patch_api_v1accounts_account_id_webhook_subscriptions_id(
198
+ # account_id: 1,
199
+ # id: 1
200
+ # )
201
+ #
202
+ # @return [Leal::WebhookSubscriptions::Types::PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse]
203
+ def patch_api_v1accounts_account_id_webhook_subscriptions_id(request_options: {}, **params)
204
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
205
+ request_data = Leal::WebhookSubscriptions::Types::PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDRequest.new(params).to_h
206
+ non_body_param_names = %w[account_id id]
207
+ body = request_data.except(*non_body_param_names)
208
+
209
+ request = Leal::Internal::JSON::Request.new(
210
+ base_url: request_options[:base_url],
211
+ method: "PATCH",
212
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions/#{URI.encode_uri_component(params[:id].to_s)}",
213
+ body: body,
214
+ request_options: request_options
215
+ )
216
+ begin
217
+ response = @client.send(request)
218
+ rescue Net::HTTPRequestTimeout
219
+ raise Leal::Errors::TimeoutError
220
+ end
221
+ code = response.code.to_i
222
+ if code.between?(200, 299)
223
+ Leal::WebhookSubscriptions::Types::PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse.load(response.body)
224
+ else
225
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
226
+ raise error_class.new(response.body, code: code)
227
+ end
228
+ end
229
+
230
+ # Replaces the subscription's signing secret. Deliveries are signed with the new secret straight away, so update
231
+ # your receiver at the same time.
232
+ #
233
+ # @param request_options [Hash]
234
+ # @param params [Hash]
235
+ # @option request_options [String] :base_url
236
+ # @option request_options [Hash{String => Object}] :additional_headers
237
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
238
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
239
+ # @option request_options [Integer] :timeout_in_seconds
240
+ # @option params [Integer] :account_id
241
+ # @option params [Integer] :id
242
+ #
243
+ # @example
244
+ # client.webhook_subscriptions.post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret(
245
+ # account_id: 1,
246
+ # id: 1
247
+ # )
248
+ #
249
+ # @return [Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsIDRotateSecretResponse]
250
+ def post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret(request_options: {}, **params)
251
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
252
+ request = Leal::Internal::JSON::Request.new(
253
+ base_url: request_options[:base_url],
254
+ method: "POST",
255
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions/#{URI.encode_uri_component(params[:id].to_s)}/rotate_secret",
256
+ request_options: request_options
257
+ )
258
+ begin
259
+ response = @client.send(request)
260
+ rescue Net::HTTPRequestTimeout
261
+ raise Leal::Errors::TimeoutError
262
+ end
263
+ code = response.code.to_i
264
+ if code.between?(200, 299)
265
+ Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsIDRotateSecretResponse.load(response.body)
266
+ else
267
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
268
+ raise error_class.new(response.body, code: code)
269
+ end
270
+ end
271
+
272
+ # Immediately sends a signed `webhook.test` event to the subscription's URL and reports what
273
+ # happened, so you can check your endpoint and signature verification without waiting for real
274
+ # activity. Test events are not retried and do not count towards disabling the subscription.
275
+ #
276
+ # @param request_options [Hash]
277
+ # @param params [Hash]
278
+ # @option request_options [String] :base_url
279
+ # @option request_options [Hash{String => Object}] :additional_headers
280
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
281
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
282
+ # @option request_options [Integer] :timeout_in_seconds
283
+ # @option params [Integer] :account_id
284
+ # @option params [Integer] :id
285
+ #
286
+ # @example
287
+ # client.webhook_subscriptions.post_api_v1accounts_account_id_webhook_subscriptions_id_test(
288
+ # account_id: 1,
289
+ # id: 1
290
+ # )
291
+ #
292
+ # @return [Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsIDTestResponse]
293
+ def post_api_v1accounts_account_id_webhook_subscriptions_id_test(request_options: {}, **params)
294
+ params = Leal::Internal::Types::Utils.normalize_keys(params)
295
+ request = Leal::Internal::JSON::Request.new(
296
+ base_url: request_options[:base_url],
297
+ method: "POST",
298
+ path: "api/v1/accounts/#{URI.encode_uri_component(params[:account_id].to_s)}/webhook_subscriptions/#{URI.encode_uri_component(params[:id].to_s)}/test",
299
+ request_options: request_options
300
+ )
301
+ begin
302
+ response = @client.send(request)
303
+ rescue Net::HTTPRequestTimeout
304
+ raise Leal::Errors::TimeoutError
305
+ end
306
+ code = response.code.to_i
307
+ if code.between?(200, 299)
308
+ Leal::WebhookSubscriptions::Types::PostAPIV1AccountsAccountIDWebhookSubscriptionsIDTestResponse.load(response.body)
309
+ else
310
+ error_class = Leal::Errors::ResponseError.subclass_for_code(code)
311
+ raise error_class.new(response.body, code: code)
312
+ end
313
+ end
314
+ end
315
+ end
316
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class DeleteAPIV1AccountsAccountIDWebhookSubscriptionsIDRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :id, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class GetAPIV1AccountsAccountIDWebhookSubscriptionsIDRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :id, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class GetAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :created_at, -> { String }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: false, nullable: false
12
+
13
+ field :disabled_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :disabled_reason, -> { String }, optional: false, nullable: false
16
+
17
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
18
+
19
+ field :event, -> { String }, optional: false, nullable: false
20
+
21
+ field :events, -> { Internal::Types::Array[String] }, optional: false, nullable: false
22
+
23
+ field :id, -> { Integer }, optional: false, nullable: false
24
+
25
+ field :last_delivery_at, -> { String }, optional: false, nullable: false
26
+
27
+ field :last_delivery_error, -> { String }, optional: false, nullable: false
28
+
29
+ field :last_delivery_status, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :payload_format, -> { String }, optional: false, nullable: false
32
+
33
+ field :secret, -> { String }, optional: false, nullable: false
34
+
35
+ field :target_url, -> { String }, optional: false, nullable: false
36
+
37
+ field :updated_at, -> { String }, optional: false, nullable: false
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class GetAPIV1AccountsAccountIDWebhookSubscriptionsRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :event, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class GetAPIV1AccountsAccountIDWebhookSubscriptionsResponseItem < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :created_at, -> { String }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: false, nullable: false
12
+
13
+ field :disabled_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :disabled_reason, -> { String }, optional: false, nullable: false
16
+
17
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
18
+
19
+ field :event, -> { String }, optional: false, nullable: false
20
+
21
+ field :events, -> { Internal::Types::Array[String] }, optional: false, nullable: false
22
+
23
+ field :id, -> { Integer }, optional: false, nullable: false
24
+
25
+ field :last_delivery_at, -> { String }, optional: false, nullable: false
26
+
27
+ field :last_delivery_error, -> { String }, optional: false, nullable: false
28
+
29
+ field :last_delivery_status, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :payload_format, -> { String }, optional: false, nullable: false
32
+
33
+ field :target_url, -> { String }, optional: false, nullable: false
34
+
35
+ field :updated_at, -> { String }, optional: false, nullable: false
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :id, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: true, nullable: false
12
+
13
+ field :enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+
15
+ field :event, -> { String }, optional: true, nullable: false
16
+
17
+ field :events, -> { Internal::Types::Array[String] }, optional: true, nullable: false
18
+
19
+ field :payload_format, -> { String }, optional: true, nullable: false
20
+
21
+ field :target_url, -> { String }, optional: true, nullable: false
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PatchAPIV1AccountsAccountIDWebhookSubscriptionsIDResponse < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :created_at, -> { String }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: false, nullable: false
12
+
13
+ field :disabled_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :disabled_reason, -> { String }, optional: false, nullable: false
16
+
17
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
18
+
19
+ field :event, -> { String }, optional: false, nullable: false
20
+
21
+ field :events, -> { Internal::Types::Array[String] }, optional: false, nullable: false
22
+
23
+ field :id, -> { Integer }, optional: false, nullable: false
24
+
25
+ field :last_delivery_at, -> { String }, optional: false, nullable: false
26
+
27
+ field :last_delivery_error, -> { String }, optional: false, nullable: false
28
+
29
+ field :last_delivery_status, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :payload_format, -> { String }, optional: false, nullable: false
32
+
33
+ field :target_url, -> { String }, optional: false, nullable: false
34
+
35
+ field :updated_at, -> { String }, optional: false, nullable: false
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PostAPIV1AccountsAccountIDWebhookSubscriptionsIDRotateSecretRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :id, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PostAPIV1AccountsAccountIDWebhookSubscriptionsIDRotateSecretResponse < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :created_at, -> { String }, optional: false, nullable: false
10
+
11
+ field :description, -> { String }, optional: false, nullable: false
12
+
13
+ field :disabled_at, -> { String }, optional: false, nullable: false
14
+
15
+ field :disabled_reason, -> { String }, optional: false, nullable: false
16
+
17
+ field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
18
+
19
+ field :event, -> { String }, optional: false, nullable: false
20
+
21
+ field :events, -> { Internal::Types::Array[String] }, optional: false, nullable: false
22
+
23
+ field :id, -> { Integer }, optional: false, nullable: false
24
+
25
+ field :last_delivery_at, -> { String }, optional: false, nullable: false
26
+
27
+ field :last_delivery_error, -> { String }, optional: false, nullable: false
28
+
29
+ field :last_delivery_status, -> { Integer }, optional: false, nullable: false
30
+
31
+ field :payload_format, -> { String }, optional: false, nullable: false
32
+
33
+ field :secret, -> { String }, optional: false, nullable: false
34
+
35
+ field :target_url, -> { String }, optional: false, nullable: false
36
+
37
+ field :updated_at, -> { String }, optional: false, nullable: false
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PostAPIV1AccountsAccountIDWebhookSubscriptionsIDTestRequest < Internal::Types::Model
7
+ field :account_id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :id, -> { Integer }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Leal
4
+ module WebhookSubscriptions
5
+ module Types
6
+ class PostAPIV1AccountsAccountIDWebhookSubscriptionsIDTestResponse < Internal::Types::Model
7
+ field :delivered, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+
9
+ field :error, -> { String }, optional: false, nullable: false
10
+
11
+ field :event_id, -> { String }, optional: false, nullable: false
12
+
13
+ field :status, -> { Integer }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end