debian-mirror-gitlab/app/graphql/mutations/alert_management/http_integration/update.rb

34 lines
980 B
Ruby
Raw Normal View History

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-03-08 18:12:59 +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,
2021-03-08 18:12:59 +05:30
description: "The name of the integration."
2021-01-29 00:20:46 +05:30
argument :active, GraphQL::BOOLEAN_TYPE,
required: false,
2021-03-08 18:12:59 +05:30
description: "Whether the integration is receiving alerts."
2021-01-29 00:20:46 +05:30
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