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

36 lines
1.1 KiB
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-10-27 15:23:28 +05:30
description: "ID of the integration to mutate."
2021-01-29 00:20:46 +05:30
2021-10-27 15:23:28 +05:30
argument :name, GraphQL::Types::String,
2021-01-29 00:20:46 +05:30
required: false,
2021-10-27 15:23:28 +05:30
description: "Name of the integration."
2021-01-29 00:20:46 +05:30
2021-10-27 15:23:28 +05:30
argument :active, GraphQL::Types::Boolean,
2021-01-29 00:20:46 +05:30
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,
2021-03-11 19:13:27 +05:30
http_integration_params(integration.project, args)
2021-01-29 00:20:46 +05:30
).execute
end
end
end
end
end
2021-03-11 19:13:27 +05:30
2021-06-08 01:23:25 +05:30
Mutations::AlertManagement::HttpIntegration::Update.prepend_mod_with('Mutations::AlertManagement::HttpIntegration::Update')