2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module AlertManagement
|
|
|
|
module HttpIntegration
|
|
|
|
class Update < HttpIntegrationBase
|
|
|
|
graphql_name 'HttpIntegrationUpdate'
|
|
|
|
|
|
|
|
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
|
|
|
|
required: true,
|
2021-02-22 17:27:13 +05:30
|
|
|
description: "The ID of the integration to mutate"
|
2021-01-29 00:20:46 +05:30
|
|
|
|
|
|
|
argument :name, GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: "The name of the integration"
|
|
|
|
|
|
|
|
argument :active, GraphQL::BOOLEAN_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: "Whether the integration is receiving alerts"
|
|
|
|
|
|
|
|
def resolve(args)
|
|
|
|
integration = authorized_find!(id: args[:id])
|
|
|
|
|
|
|
|
response ::AlertManagement::HttpIntegrations::UpdateService.new(
|
|
|
|
integration,
|
|
|
|
current_user,
|
|
|
|
args.slice(:name, :active)
|
|
|
|
).execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|