Class: Zendesk2::TicketForm

Inherits:
Object
  • Object
show all
Extended by:
Attributes
Includes:
Model
Defined in:
lib/zendesk2/ticket_form.rb

Instance Attribute Summary

Attributes included from Model

#errors

Instance Method Summary collapse

Methods included from Attributes

assoc_accessor, assoc_reader, assoc_writer

Methods included from Model

#destroy, #destroyed?, #missing_attributes, #save, #update!

Instance Method Details

#activeBoolean

Returns If the form is set as active.

Returns:

  • (Boolean)

    If the form is set as active



21
# File 'lib/zendesk2/ticket_form.rb', line 21

attribute :active, type: :boolean

#defaultBoolean

Returns Is the form the default form for this account.

Returns:

  • (Boolean)

    Is the form the default form for this account



25
# File 'lib/zendesk2/ticket_form.rb', line 25

attribute :default, type: :boolean

#destroy!Object



47
48
49
50
51
# File 'lib/zendesk2/ticket_form.rb', line 47

def destroy!
  requires :identity

  cistern.destroy_ticket_form('ticket_form' => { 'id' => identity })
end

#display_nameString

Returns The name of the form that is displayed to an end user.

Returns:

  • (String)

    The name of the form that is displayed to an end user



15
# File 'lib/zendesk2/ticket_form.rb', line 15

attribute :display_name, type: :string

#end_user_visibleBoolean

Returns Is the form visible to the end user.

Returns:

  • (Boolean)

    Is the form visible to the end user



23
# File 'lib/zendesk2/ticket_form.rb', line 23

attribute :end_user_visible, type: :boolean

#idinteger

Returns Automatically assigned upon creation.

Returns:

  • (integer)

    Automatically assigned upon creation



8
# File 'lib/zendesk2/ticket_form.rb', line 8

identity :id, type: :integer

#in_all_brandsBoolean

Returns Is the form available for use in all brands on this account.

Returns:

  • (Boolean)

    Is the form available for use in all brands on this account



29
# File 'lib/zendesk2/ticket_form.rb', line 29

attribute :in_all_brands, type: :boolean

#nameString

Returns The name of the form.

Returns:

  • (String)

    The name of the form



11
# File 'lib/zendesk2/ticket_form.rb', line 11

attribute :name, type: :string

#positionInteger

Returns The position of this form among other forms in the account, i.e. dropdown.

Returns:

  • (Integer)

    The position of this form among other forms in the account, i.e. dropdown



19
# File 'lib/zendesk2/ticket_form.rb', line 19

attribute :position, type: :integer

#raw_display_nameString

Returns The dynamic content placeholder, if present, or the “display_name” value, if not.

Returns:

  • (String)

    The dynamic content placeholder, if present, or the “display_name” value, if not



17
# File 'lib/zendesk2/ticket_form.rb', line 17

attribute :raw_display_name, type: :string

#raw_nameString

Returns The dynamic content placeholder, if present, or the “name” value, if not.

Returns:

  • (String)

    The dynamic content placeholder, if present, or the “name” value, if not



13
# File 'lib/zendesk2/ticket_form.rb', line 13

attribute :raw_name, type: :string

#restricted_brand_idsArray

Returns ids of all brands that this ticket form is restricted to.

Returns:

  • (Array)

    ids of all brands that this ticket form is restricted to



31
# File 'lib/zendesk2/ticket_form.rb', line 31

attribute :restricted_brand_ids, type: :array

#save!Object



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/zendesk2/ticket_form.rb', line 33

def save!
  data = if new_record?
           requires :name

           cistern.create_ticket_form('ticket_form' => attributes)
         else
           requires :identity

           cistern.update_ticket_form('ticket_form' => attributes)
         end.body['ticket_form']

  merge_attributes(data)
end

#ticket_field_idsArray

Returns ids of all ticket fields which are in this ticket form.

Returns:

  • (Array)

    ids of all ticket fields which are in this ticket form



27
# File 'lib/zendesk2/ticket_form.rb', line 27

attribute :ticket_field_ids, type: :array