Sha256: 3f8882fd76a0c2e62a0095eb690c6c25a2790c7d5e00f4a80d3eb0fc607721f5

Contents?: true

Size: 571 Bytes

Versions: 3

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true
class Zendesk2::UpdateTicketForm
  include Zendesk2::Request

  request_method :put
  request_path { |r| "/ticket_forms/#{r.ticket_form_id}.json" }
  request_body { |r| { 'ticket_form' => r.ticket_form_params } }

  def ticket_form_id
    params.fetch('ticket_form').fetch('id')
  end

  def ticket_form_params
    Cistern::Hash.slice(params.fetch('ticket_form'), *Zendesk2::CreateTicketForm.accepted_attributes)
  end

  def mock
    mock_response('ticket_form' => find!(:ticket_forms, ticket_form_id).merge!(ticket_form_params))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zendesk2-1.15.0 lib/zendesk2/update_ticket_form.rb
zendesk2-1.13.1 lib/zendesk2/update_ticket_form.rb
zendesk2-1.13.0 lib/zendesk2/update_ticket_form.rb