hookbridge 1.8.0 → 2.0.0
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/lib/hookbridge/client.rb +0 -36
- data/lib/hookbridge/types.rb +0 -12
- data/lib/hookbridge/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e43edda9d74a75ca6005e9841c11e15c4b86e754672e5b32a25e86a89fa05a61
|
|
4
|
+
data.tar.gz: 2a63f65079ca7b8d6534c172a046c18ffa76440383364360fa3e06c7ef2a52b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b658a40aacb1fda031c62c597afdd5fba906ddce885168657a2fd2468dedf66d9e2d1f6754b10f5213e5e0f10ca646d09387390e4cf82ebd5b1f8de83ba6d28
|
|
7
|
+
data.tar.gz: 295eeb0da5480e9cdc8daf9c5e26feace41721e39b460b4320a3098c51780cc9ef497d59700c690b7e684d43abeba46322800d9e2f74d549c3d3bb111adc6f11
|
data/lib/hookbridge/client.rb
CHANGED
|
@@ -128,32 +128,6 @@ module HookBridge
|
|
|
128
128
|
true
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
def list_projects
|
|
132
|
-
extract_data(request(:get, "/v1/projects")).map { |project| Project.new(project) }
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def create_project(name:, rate_limit_default: nil)
|
|
136
|
-
body = { name: name }
|
|
137
|
-
body[:rate_limit_default] = rate_limit_default if rate_limit_default
|
|
138
|
-
Project.new(extract_data(request(:post, "/v1/projects", body)))
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
def get_project(project_id)
|
|
142
|
-
Project.new(extract_data(request(:get, "/v1/projects/#{project_id}")))
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
def update_project(project_id, name: nil, rate_limit_default: nil)
|
|
146
|
-
body = {}
|
|
147
|
-
body[:name] = name if name
|
|
148
|
-
body[:rate_limit_default] = rate_limit_default if rate_limit_default
|
|
149
|
-
Project.new(extract_data(request(:put, "/v1/projects/#{project_id}", body)))
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
def delete_project(project_id)
|
|
153
|
-
request(:delete, "/v1/projects/#{project_id}")
|
|
154
|
-
true
|
|
155
|
-
end
|
|
156
|
-
|
|
157
131
|
def create_endpoint(url:, description: nil, hmac_enabled: nil, rate_limit_rps: 0, burst: 0, headers: nil)
|
|
158
132
|
body = { url: url }
|
|
159
133
|
body[:description] = description if description
|
|
@@ -340,16 +314,6 @@ module HookBridge
|
|
|
340
314
|
PullTimeSeriesMetrics.new(extract_data(request(:get, "/v1/pull-metrics/timeseries", nil, params)))
|
|
341
315
|
end
|
|
342
316
|
|
|
343
|
-
def create_checkout(plan:, interval:)
|
|
344
|
-
CheckoutSession.new(extract_data(request(:post, "/v1/billing/checkout", { plan: plan, interval: interval })))
|
|
345
|
-
end
|
|
346
|
-
|
|
347
|
-
def create_portal(return_url: nil)
|
|
348
|
-
body = {}
|
|
349
|
-
body[:return_url] = return_url if return_url
|
|
350
|
-
PortalSession.new(extract_data(request(:post, "/v1/billing/portal", body)))
|
|
351
|
-
end
|
|
352
|
-
|
|
353
317
|
def get_usage_history(limit: 12, offset: 0)
|
|
354
318
|
response = request(:get, "/v1/billing/usage-history", nil, { limit: limit, offset: offset })
|
|
355
319
|
UsageHistoryResponse.new(extract_data(response), extract_meta(response))
|
data/lib/hookbridge/types.rb
CHANGED
|
@@ -217,18 +217,6 @@ module HookBridge
|
|
|
217
217
|
end
|
|
218
218
|
end
|
|
219
219
|
|
|
220
|
-
class Project < BaseModel
|
|
221
|
-
def initialize(data)
|
|
222
|
-
super(data, time_fields: %w[created_at])
|
|
223
|
-
end
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
class CheckoutSession < BaseModel
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
class PortalSession < BaseModel
|
|
230
|
-
end
|
|
231
|
-
|
|
232
220
|
class UsageHistoryRow < BaseModel
|
|
233
221
|
def initialize(data)
|
|
234
222
|
super(data, date_fields: %w[period_start period_end])
|
data/lib/hookbridge/version.rb
CHANGED