leal 0.0.12 → 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.
- checksums.yaml +4 -4
- data/.fern/metadata.json +2 -2
- data/lib/leal/cards/types/create_cards_request_card.rb +2 -0
- data/lib/leal/cards/types/create_cards_response.rb +2 -0
- data/lib/leal/cards/types/get_cards_response.rb +2 -0
- data/lib/leal/cards/types/list_cards_response_item.rb +2 -0
- data/lib/leal/cards/types/update_cards_request_card.rb +2 -0
- data/lib/leal/cards/types/update_cards_response.rb +2 -0
- data/lib/leal/client.rb +6 -1
- data/lib/leal/version.rb +1 -1
- data/lib/leal/webhook_subscriptions/client.rb +316 -0
- data/lib/leal/webhook_subscriptions/types/delete_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +13 -0
- data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +13 -0
- data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_id_response.rb +41 -0
- data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_request.rb +13 -0
- data/lib/leal/webhook_subscriptions/types/get_api_v1accounts_account_id_webhook_subscriptions_response_item.rb +39 -0
- data/lib/leal/webhook_subscriptions/types/patch_api_v1accounts_account_id_webhook_subscriptions_id_request.rb +25 -0
- data/lib/leal/webhook_subscriptions/types/patch_api_v1accounts_account_id_webhook_subscriptions_id_response.rb +39 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret_request.rb +13 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_rotate_secret_response.rb +41 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_test_request.rb +13 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_id_test_response.rb +17 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_request.rb +23 -0
- data/lib/leal/webhook_subscriptions/types/post_api_v1accounts_account_id_webhook_subscriptions_response.rb +41 -0
- data/lib/leal.rb +14 -0
- data/reference.md +602 -0
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3a2732500c8c1b1883576904d52230e44d4519f0cb028d7daededbc33136971
|
|
4
|
+
data.tar.gz: 02f7a1b104b6f134429e874a40fd9c280bd1019dd83b8d18380a5ec23abe3118
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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": "
|
|
5
|
+
"originGitCommit": "cf2e805c2a9dd96e6e7e0632ed8a5e47243a8d4f",
|
|
6
6
|
"originGitCommitIsDirty": false,
|
|
7
7
|
"invokedBy": "ci",
|
|
8
8
|
"ciProvider": "github",
|
|
9
|
-
"sdkVersion": "0.0.
|
|
9
|
+
"sdkVersion": "0.0.14"
|
|
10
10
|
}
|
|
@@ -30,6 +30,8 @@ module Leal
|
|
|
30
30
|
|
|
31
31
|
field :strip_color, -> { String }, optional: true, nullable: false
|
|
32
32
|
|
|
33
|
+
field :strip_opacity, -> { Integer }, optional: true, nullable: false
|
|
34
|
+
|
|
33
35
|
field :strip_preset, -> { String }, optional: true, nullable: false
|
|
34
36
|
|
|
35
37
|
field :strip_type, -> { String }, optional: true, nullable: false
|
|
@@ -40,6 +40,8 @@ module Leal
|
|
|
40
40
|
|
|
41
41
|
field :strip_color, -> { String }, optional: false, nullable: false
|
|
42
42
|
|
|
43
|
+
field :strip_opacity, -> { Integer }, optional: false, nullable: false
|
|
44
|
+
|
|
43
45
|
field :strip_preset, -> { String }, optional: false, nullable: false
|
|
44
46
|
|
|
45
47
|
field :strip_type, -> { String }, optional: false, nullable: false
|
|
@@ -40,6 +40,8 @@ module Leal
|
|
|
40
40
|
|
|
41
41
|
field :strip_color, -> { String }, optional: false, nullable: false
|
|
42
42
|
|
|
43
|
+
field :strip_opacity, -> { Integer }, optional: false, nullable: false
|
|
44
|
+
|
|
43
45
|
field :strip_preset, -> { String }, optional: false, nullable: false
|
|
44
46
|
|
|
45
47
|
field :strip_type, -> { String }, optional: false, nullable: false
|
|
@@ -40,6 +40,8 @@ module Leal
|
|
|
40
40
|
|
|
41
41
|
field :strip_color, -> { String }, optional: false, nullable: false
|
|
42
42
|
|
|
43
|
+
field :strip_opacity, -> { Integer }, optional: false, nullable: false
|
|
44
|
+
|
|
43
45
|
field :strip_preset, -> { String }, optional: false, nullable: false
|
|
44
46
|
|
|
45
47
|
field :strip_type, -> { String }, optional: false, nullable: false
|
|
@@ -30,6 +30,8 @@ module Leal
|
|
|
30
30
|
|
|
31
31
|
field :strip_color, -> { String }, optional: true, nullable: false
|
|
32
32
|
|
|
33
|
+
field :strip_opacity, -> { Integer }, optional: true, nullable: false
|
|
34
|
+
|
|
33
35
|
field :strip_preset, -> { String }, optional: true, nullable: false
|
|
34
36
|
|
|
35
37
|
field :strip_type, -> { String }, optional: true, nullable: false
|
|
@@ -40,6 +40,8 @@ module Leal
|
|
|
40
40
|
|
|
41
41
|
field :strip_color, -> { String }, optional: false, nullable: false
|
|
42
42
|
|
|
43
|
+
field :strip_opacity, -> { Integer }, optional: false, nullable: false
|
|
44
|
+
|
|
43
45
|
field :strip_preset, -> { String }, optional: false, nullable: false
|
|
44
46
|
|
|
45
47
|
field :strip_type, -> { String }, optional: false, nullable: false
|
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.
|
|
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
|
@@ -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
|