Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reset_token.rb « prometheus_integration « alert_management « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 33a12405583c28bb7b4812de7819087d7a2a080f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Mutations
  module AlertManagement
    module PrometheusIntegration
      class ResetToken < PrometheusIntegrationBase
        graphql_name 'PrometheusIntegrationResetToken'

        argument :id, Types::GlobalIDType[::Integrations::Prometheus],
                 required: true,
                 description: "The ID of the integration to mutate."

        def resolve(id:)
          integration = authorized_find!(id: id)

          result = ::Projects::Operations::UpdateService.new(
            integration.project,
            current_user,
            token_attributes
          ).execute

          response integration, result
        end
      end
    end
  end
end