validate_configuration_inbound.rb 819 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Channel::Email::ValidateConfigurationInbound < Channel::Email::BaseConfiguration
  4. description 'Validate an inbound email channel configuration by trying to fetch email'
  5. argument :inbound_configuration, Gql::Types::Input::Channel::Email::InboundConfigurationInputType, 'Configuration to validate'
  6. field :success, Boolean, description: 'Was the validation successful?'
  7. field :mailbox_stats, Gql::Types::Channel::Email::InboundMailboxStatsType, description: 'Inbound mailbox data'
  8. def resolve(inbound_configuration:)
  9. internal_result = EmailHelper::Probe.inbound(map_type_to_config(inbound_configuration))
  10. map_probe_result(internal_result, field_prefix: :inbound)
  11. end
  12. end
  13. end