Sha256: 3b77160abc0fa09c495b0bd68cf6dbf6bff9bcf81dc8838ee7459cd6b1c1cd07

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true
class Zendesk2::UpdateHelpCenterTranslation
  include Zendesk2::Request
  include Zendesk2::HelpCenter::TranslationSource::Request

  request_method :put
  request_body { |r| { 'translation' => r.translation_params } }
  request_path { |r| "/help_center/#{r.source_type_url}/#{r.source_id}/translations/#{r.locale}.json" }

  def translation_params
    Cistern::Hash.slice(params.fetch('translation'), *Zendesk2::CreateHelpCenterTranslation.accepted_attributes)
  end

  def mock
    mock_response('translation' => find!(:help_center_translations, mock_translation_key).merge!(translation_params))
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zendesk2-1.15.0 lib/zendesk2/help_center/update_help_center_translation.rb
zendesk2-1.13.1 lib/zendesk2/help_center/update_help_center_translation.rb
zendesk2-1.13.0 lib/zendesk2/help_center/update_help_center_translation.rb
zendesk2-1.12.0 lib/zendesk2/help_center/update_help_center_translation.rb
zendesk2-1.11.0 lib/zendesk2/help_center/update_help_center_translation.rb
zendesk2-1.10.0 lib/zendesk2/help_center/update_help_center_translation.rb