Class: Hivehook::Resources::DestinationService
Constant Summary
collapse
- FRAGMENT =
"id name url signingSecret status type typeConfig timeoutMs rateLimitRps headers authType deliveryMode ordered blockedDeliveryId healthScore disabledReason healthConfig { windowHours disableBelow } outputFormat createdAt"
Instance Method Summary
collapse
Methods inherited from BaseService
#initialize
Instance Method Details
#create(input) ⇒ Object
23
24
25
26
|
# File 'lib/hivehook/resources/destination_service.rb', line 23
def create(input)
query = "mutation($input: CreateDestinationInput!) { createDestination(input: $input) { #{FRAGMENT} } }"
@transport.execute(query, { "input" => input })["createDestination"]
end
|
#delete(id) ⇒ Object
33
34
35
36
|
# File 'lib/hivehook/resources/destination_service.rb', line 33
def delete(id)
query = "mutation($id: UUID!) { deleteDestination(id: $id) }"
@transport.execute(query, { "id" => id })["deleteDestination"]
end
|
#get(id) ⇒ Object
18
19
20
21
|
# File 'lib/hivehook/resources/destination_service.rb', line 18
def get(id)
query = "query($id: UUID!) { destination(id: $id) { #{FRAGMENT} } }"
@transport.execute(query, { "id" => id })["destination"]
end
|
#list(options = {}) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/hivehook/resources/destination_service.rb', line 8
def list(options = {})
query = "query($status: DestinationStatus, $search: String, $limit: Int, $offset: Int, $after: String, $first: Int) {
destinations(status: $status, search: $search, limit: $limit, offset: $offset, after: $after, first: $first) {
nodes { #{FRAGMENT} }
pageInfo { total limit offset endCursor hasNextPage }
}
}"
@transport.execute(query, build_variables(options, %w[status search limit offset after first]))["destinations"]
end
|
#rotate_secret(id) ⇒ Object
38
39
40
41
|
# File 'lib/hivehook/resources/destination_service.rb', line 38
def rotate_secret(id)
query = "mutation($id: UUID!) { rotateDestinationSecret(id: $id) { #{FRAGMENT} } }"
@transport.execute(query, { "id" => id })["rotateDestinationSecret"]
end
|
#update(id, input) ⇒ Object
28
29
30
31
|
# File 'lib/hivehook/resources/destination_service.rb', line 28
def update(id, input)
query = "mutation($id: UUID!, $input: UpdateDestinationInput!) { updateDestination(id: $id, input: $input) { #{FRAGMENT} } }"
@transport.execute(query, { "id" => id, "input" => input })["updateDestination"]
end
|