Class: Teamleader::ExtendedApi

Inherits:
Api
  • Object
show all
Defined in:
lib/teamleader/extended_api.rb

Overview

The Api class is a 1-1 mapping with Teamleader API v1 The ExtendedApi adds some utility methods

Instance Method Summary collapse

Methods inherited from Api

#add_company, #add_contact, #add_creditnote, #add_deal, #add_invoice, #add_note, #add_product, #add_ticket, #add_ticket_message, #book_draft_invoice, #delete_company, #delete_contact, #delete_invoice, #delete_product, #download_creditnote_pdf, #download_invoice_pdf, #get_all_deal_phase_changes, #get_bookkeeping_accounts, #get_business_types, #get_companies, #get_company, #get_contact, #get_contact_company_relations, #get_contacts, #get_contacts_by_company, #get_creditnote, #get_creditnotes, #get_creditnotes_by_project, #get_deal, #get_deal_phase_changes, #get_deal_phases, #get_deal_sources, #get_deals, #get_deals_by_contact_or_company, #get_deals_by_project, #get_departments, #get_invoice, #get_invoice_cloud_url, #get_invoice_reminder_template_content, #get_invoice_reminder_templates, #get_invoices, #get_invoices_by_deal, #get_invoices_by_project, #get_notes, #get_product, #get_products, #get_tags, #get_ticket, #get_ticket_cloud_url, #get_ticket_message, #get_ticket_messages, #get_tickets, #get_users, #initialize, #link_contact_to_company, #send_invoice, #send_sale_to_client, #update_company, #update_contact, #update_deal, #update_deal_items, #update_invoice, #update_invoice_comments, #update_invoice_payment_status, #update_product, #update_ticket

Methods included from Subscriptions

#add_subscription, #delete_subscription, #get_invoices_by_subscription, #get_related_subscriptions_by_invoice, #get_subscription, #get_subscriptions, #get_subscriptions_by_contact_or_company, #get_subscriptions_by_deal, #update_subscription

Methods included from Calls

#add_callback, #get_call, #get_calls

Methods included from Projects

#add_project, #get_project, #get_projects, #get_projects_by_client, #update_project

Methods included from Files

#delete_file, #download_file, #get_file_info, #get_files, #upload_file

Methods included from CustomFields

#add_custom_field_option, #get_custom_field_info, #get_custom_fields

Constructor Details

This class inherits a constructor from Teamleader::Api

Instance Method Details

#get_all_subscriptions(**args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/teamleader/extended_api.rb', line 6

def get_all_subscriptions(**args)
  subscriptions = []
  pageno = 0
  loop do
    results = self.get_subscriptions((args || {}).merge({pageno: pageno, amount: 100}))
    subscriptions.concat(results)
    pageno += 1
    break if results.length == 0
  end
  subscriptions
end