debian-mirror-gitlab/app/graphql/mutations/alert_management/http_integration/update.rb
2021-03-11 19:13:27 +05:30

35 lines
1.1 KiB
Ruby

# frozen_string_literal: true
module Mutations
module AlertManagement
module HttpIntegration
class Update < HttpIntegrationBase
graphql_name 'HttpIntegrationUpdate'
argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration],
required: true,
description: "The ID of the integration to mutate."
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,
http_integration_params(integration.project, args)
).execute
end
end
end
end
end
Mutations::AlertManagement::HttpIntegration::Update.prepend_if_ee('::EE::Mutations::AlertManagement::HttpIntegration::Update')