diff options
Diffstat (limited to 'app/graphql/mutations/alert_management/http_integration/reset_token.rb')
-rw-r--r-- | app/graphql/mutations/alert_management/http_integration/reset_token.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/graphql/mutations/alert_management/http_integration/reset_token.rb b/app/graphql/mutations/alert_management/http_integration/reset_token.rb new file mode 100644 index 00000000000..eefab156825 --- /dev/null +++ b/app/graphql/mutations/alert_management/http_integration/reset_token.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Mutations + module AlertManagement + module HttpIntegration + class ResetToken < HttpIntegrationBase + graphql_name 'HttpIntegrationResetToken' + + argument :id, Types::GlobalIDType[::AlertManagement::HttpIntegration], + required: true, + description: "The id of the integration to mutate" + + def resolve(id:) + integration = authorized_find!(id: id) + + response ::AlertManagement::HttpIntegrations::UpdateService.new( + integration, + current_user, + regenerate_token: true + ).execute + end + end + end + end +end |