diff options
Diffstat (limited to 'app/graphql/mutations/alert_management/http_integration/update.rb')
-rw-r--r-- | app/graphql/mutations/alert_management/http_integration/update.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/graphql/mutations/alert_management/http_integration/update.rb b/app/graphql/mutations/alert_management/http_integration/update.rb new file mode 100644 index 00000000000..309c45b04ac --- /dev/null +++ b/app/graphql/mutations/alert_management/http_integration/update.rb @@ -0,0 +1,33 @@ +# 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, + args.slice(:name, :active) + ).execute + end + end + end + end +end |