Class: Zendesk2::Forum

Inherits:
Object
  • Object
show all
Extended by:
Attributes
Includes:
Model
Defined in:
lib/zendesk2/forum.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

#accessString

Returns Who has access to this forum, valid values: “everybody”, “logged-in users” or “agents only”.

Returns:

  • (String)

    Who has access to this forum, valid values: “everybody”, “logged-in users” or “agents only”



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

attribute :access, type: :string

#category_idFixnum

Returns Category this forum is in.

Returns:

  • (Fixnum)

    Category this forum is in



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

attribute :category_id, type: :integer

#created_atTime

Returns The time the forum was created.

Returns:

  • (Time)

    The time the forum was created



35
# File 'lib/zendesk2/forum.rb', line 35

attribute :created_at, type: :time

#descriptionString

Returns A description of the forum.

Returns:

  • (String)

    A description of the forum



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

attribute :description, type: :string

#destroy!Object



42
43
44
45
46
# File 'lib/zendesk2/forum.rb', line 42

def destroy!
  requires :identity

  cistern.destroy_forum('forum' => { 'id' => identity })
end

#forum_typeString

Returns The type of the topics in this forum, valid values: “articles”, “ideas” or “questions”.

Returns:

  • (String)

    The type of the topics in this forum, valid values: “articles”, “ideas” or “questions”



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

attribute :forum_type, type: :string

#idFixnum

Returns Automatically assigned upon creation.

Returns:

  • (Fixnum)

    Automatically assigned upon creation



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

identity :id, type: :integer

#locale_idFixnum

Returns User locale id this forum is restricted to.

Returns:

  • (Fixnum)

    User locale id this forum is restricted to



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

attribute :locale_id, type: :integer

#lockedBoolean

Returns Whether this forum is locked such that new entries and comments cannot be made.

Returns:

  • (Boolean)

    Whether this forum is locked such that new entries and comments cannot be made



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

attribute :locked, type: :boolean

#nameString

Returns The name of the forum.

Returns:

  • (String)

    The name of the forum



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

attribute :name, type: :string

#organization_idFixnum

Returns Organization this forum is restricted to.

Returns:

  • (Fixnum)

    Organization this forum is restricted to



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

attribute :organization_id, type: :integer

#positionFixnum

Returns The position of this forum relative to other forums in the same category.

Returns:

  • (Fixnum)

    The position of this forum relative to other forums in the same category



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

attribute :position, type: :integer

#save!Object



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/zendesk2/forum.rb', line 48

def save!
  response = if new_record?
               requires :name

               cistern.create_forum('forum' => attributes)
             else
               requires :identity

               cistern.update_forum('forum' => attributes)
             end

  merge_attributes(response.body['forum'])
end

#tagsArray

Returns Restrict access to end-users and organizations with all these tags.

Returns:

  • (Array)

    Restrict access to end-users and organizations with all these tags



33
# File 'lib/zendesk2/forum.rb', line 33

attribute :tags, type: :array

#unanswered_topicsFixnum

Returns Contains the number of unanswered questions if this forum’s topics are questions.

Returns:

  • (Fixnum)

    Contains the number of unanswered questions if this forum’s topics are questions.



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

attribute :unanswered_topics, type: :integer

#updated_atTime

Returns The time of the last update of the forum.

Returns:

  • (Time)

    The time of the last update of the forum



37
# File 'lib/zendesk2/forum.rb', line 37

attribute :updated_at, type: :time

#urlString

Returns The API url of this forum.

Returns:

  • (String)

    The API url of this forum



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

attribute :url, type: :string