class Zendesk2::HelpCenter::Section

Public Instance Methods

access_policy() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 67
def access_policy
  requires :identity

  response = cistern.get_help_center_access_policy(section_id: identity).body['access_policy']
  response['section_id'] = identity

  cistern.help_center_access_policy(response)
end
articles() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 61
def articles
  requires :identity

  cistern.help_center_articles(section_id: identity)
end
destroy!() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 41
def destroy!
  requires :identity

  cistern.destroy_help_center_section('section' => { 'id' => identity })
end
save!() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 47
def save!
  response = if new_record?
               requires :name, :locale, :category_id

               cistern.create_help_center_section('section' => attributes)
             else
               requires :identity

               cistern.update_help_center_section('section' => attributes)
             end

  merge_attributes(response.body['section'])
end
subscriptions() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 76
def subscriptions
  requires :identity

  cistern.help_center_subscriptions(content_id: identity, content_type: 'section')
end
translations() click to toggle source
# File lib/zendesk2/help_center/section.rb, line 82
def translations
  requires :identity

  cistern.help_center_translations(source_id: identity, source_type: 'Section')
end