fizzy-sdk 0.1.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 +7 -0
- data/.rubocop.yml +18 -0
- data/Rakefile +26 -0
- data/fizzy-sdk.gemspec +45 -0
- data/lib/fizzy/auth_strategy.rb +38 -0
- data/lib/fizzy/bulkhead.rb +68 -0
- data/lib/fizzy/cache.rb +101 -0
- data/lib/fizzy/chain_hooks.rb +45 -0
- data/lib/fizzy/circuit_breaker.rb +115 -0
- data/lib/fizzy/client.rb +212 -0
- data/lib/fizzy/config.rb +143 -0
- data/lib/fizzy/cookie_auth.rb +27 -0
- data/lib/fizzy/errors.rb +291 -0
- data/lib/fizzy/generated/metadata.json +1341 -0
- data/lib/fizzy/generated/services/boards_service.rb +91 -0
- data/lib/fizzy/generated/services/cards_service.rb +313 -0
- data/lib/fizzy/generated/services/columns_service.rb +69 -0
- data/lib/fizzy/generated/services/comments_service.rb +68 -0
- data/lib/fizzy/generated/services/devices_service.rb +35 -0
- data/lib/fizzy/generated/services/identity_service.rb +19 -0
- data/lib/fizzy/generated/services/miscellaneous_service.rb +256 -0
- data/lib/fizzy/generated/services/notifications_service.rb +65 -0
- data/lib/fizzy/generated/services/pins_service.rb +19 -0
- data/lib/fizzy/generated/services/reactions_service.rb +80 -0
- data/lib/fizzy/generated/services/sessions_service.rb +58 -0
- data/lib/fizzy/generated/services/steps_service.rb +69 -0
- data/lib/fizzy/generated/services/tags_service.rb +20 -0
- data/lib/fizzy/generated/services/uploads_service.rb +24 -0
- data/lib/fizzy/generated/services/users_service.rb +52 -0
- data/lib/fizzy/generated/services/webhooks_service.rb +83 -0
- data/lib/fizzy/generated/types.rb +988 -0
- data/lib/fizzy/hooks.rb +70 -0
- data/lib/fizzy/http.rb +411 -0
- data/lib/fizzy/logger_hooks.rb +46 -0
- data/lib/fizzy/magic_link_flow.rb +57 -0
- data/lib/fizzy/noop_hooks.rb +9 -0
- data/lib/fizzy/operation_info.rb +17 -0
- data/lib/fizzy/rate_limiter.rb +68 -0
- data/lib/fizzy/request_info.rb +10 -0
- data/lib/fizzy/request_result.rb +14 -0
- data/lib/fizzy/resilience.rb +59 -0
- data/lib/fizzy/security.rb +103 -0
- data/lib/fizzy/services/base_service.rb +116 -0
- data/lib/fizzy/static_token_provider.rb +24 -0
- data/lib/fizzy/token_provider.rb +42 -0
- data/lib/fizzy/version.rb +6 -0
- data/lib/fizzy/webhooks/verify.rb +36 -0
- data/lib/fizzy.rb +95 -0
- data/scripts/generate-metadata.rb +105 -0
- data/scripts/generate-services.rb +681 -0
- data/scripts/generate-types.rb +160 -0
- metadata +252 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Fizzy
|
|
4
|
+
module Services
|
|
5
|
+
# Service for Webhooks operations
|
|
6
|
+
#
|
|
7
|
+
# @generated from OpenAPI spec
|
|
8
|
+
class WebhooksService < BaseService
|
|
9
|
+
|
|
10
|
+
# list operation
|
|
11
|
+
# @param account_id [String] account id ID
|
|
12
|
+
# @param board_id [String] board id ID
|
|
13
|
+
# @return [Hash] response data
|
|
14
|
+
def list(account_id:, board_id:)
|
|
15
|
+
with_operation(service: "webhooks", operation: "ListWebhooks", is_mutation: false, resource_id: board_id) do
|
|
16
|
+
http_get("/#{account_id}/boards/#{board_id}/webhooks.json").json
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# create operation
|
|
21
|
+
# @param account_id [String] account id ID
|
|
22
|
+
# @param board_id [String] board id ID
|
|
23
|
+
# @param name [String] name
|
|
24
|
+
# @param url [String] url
|
|
25
|
+
# @param subscribed_actions [Array, nil] subscribed actions
|
|
26
|
+
# @return [Hash] response data
|
|
27
|
+
def create(account_id:, board_id:, name:, url:, subscribed_actions: nil)
|
|
28
|
+
with_operation(service: "webhooks", operation: "CreateWebhook", is_mutation: true, resource_id: board_id) do
|
|
29
|
+
http_post("/#{account_id}/boards/#{board_id}/webhooks.json", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# get operation
|
|
34
|
+
# @param account_id [String] account id ID
|
|
35
|
+
# @param board_id [String] board id ID
|
|
36
|
+
# @param webhook_id [String] webhook id ID
|
|
37
|
+
# @return [Hash] response data
|
|
38
|
+
def get(account_id:, board_id:, webhook_id:)
|
|
39
|
+
with_operation(service: "webhooks", operation: "GetWebhook", is_mutation: false, resource_id: webhook_id) do
|
|
40
|
+
http_get("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}").json
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# update operation
|
|
45
|
+
# @param account_id [String] account id ID
|
|
46
|
+
# @param board_id [String] board id ID
|
|
47
|
+
# @param webhook_id [String] webhook id ID
|
|
48
|
+
# @param name [String, nil] name
|
|
49
|
+
# @param url [String, nil] url
|
|
50
|
+
# @param subscribed_actions [Array, nil] subscribed actions
|
|
51
|
+
# @return [Hash] response data
|
|
52
|
+
def update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil)
|
|
53
|
+
with_operation(service: "webhooks", operation: "UpdateWebhook", is_mutation: true, resource_id: webhook_id) do
|
|
54
|
+
http_patch("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# delete operation
|
|
59
|
+
# @param account_id [String] account id ID
|
|
60
|
+
# @param board_id [String] board id ID
|
|
61
|
+
# @param webhook_id [String] webhook id ID
|
|
62
|
+
# @return [void]
|
|
63
|
+
def delete(account_id:, board_id:, webhook_id:)
|
|
64
|
+
with_operation(service: "webhooks", operation: "DeleteWebhook", is_mutation: true, resource_id: webhook_id) do
|
|
65
|
+
http_delete("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}")
|
|
66
|
+
nil
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# activate operation
|
|
71
|
+
# @param account_id [String] account id ID
|
|
72
|
+
# @param board_id [String] board id ID
|
|
73
|
+
# @param webhook_id [String] webhook id ID
|
|
74
|
+
# @return [void]
|
|
75
|
+
def activate(account_id:, board_id:, webhook_id:)
|
|
76
|
+
with_operation(service: "webhooks", operation: "ActivateWebhook", is_mutation: true, resource_id: webhook_id) do
|
|
77
|
+
http_post("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}/activation.json", retryable: true)
|
|
78
|
+
nil
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|