Subversion Repository Public Repository

insightly-api

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections.Generic;
using TS.Insightly.API.Contract;

namespace TS.Insightly.API.Interface
{
    /// <summary>
    /// Interface for Contacts access via the API.
    /// </summary>
    internal interface IContactController
    {
        /// <summary>
        /// Gets the contact for the unique contact ID.
        /// Note that the Id is not the Id shown for the contact in the web browser, but
        /// the contact Id that is unique to insightly.
        /// </summary>
        /// <param name="contactId">The contact unique identifier.</param>
        /// <returns>The contact for the given id.</returns>
        Contact GetContact(int contactId);

        /// <summary>
        /// Gets the contacts for email address.
        /// </summary>
        /// <param name="emailAddress">The email address.</param>
        /// <returns>List of contacts with a matching email address or empty list if no matches found.</returns>
        List<Contact> GetContactsForEmail(string emailAddress);

        /// <summary>
        /// Adds the new contact.
        /// </summary>
        /// <param name="newContact">The new contact.</param>
        /// <returns>The added contact if successful.</returns>
        Contact AddNewContact(Contact newContact);

        /// <summary>
        /// Adds the new contact if a contact does not already exist for the same email, 
        /// first and last names as the given contact.
        /// </summary>
        /// <param name="newContact">The new contact.</param>
        /// <returns>Structure containing details of the add.</returns>
        InsightlyAPI.ContactAddResult AddNewContactIfNotExists(Contact newContact);

        /// <summary>
        /// Deletes the contact.
        /// Note that the Id is not the Id shown for the contact in the web browser, but
        /// the contact Id that is unique to insightly.
        /// </summary>
        /// <param name="contactId">The contact unique identifier.</param>
        /// <returns><code>true</code> If the contact was deleted.</returns>
        bool DeleteContact(int contactId);
    }
}

Commits for insightly-api/trunk/Insightly/Interface/IContactController.cs

Diff revisions: vs.
Revision Author Commited Message
15 HadleyHope picture HadleyHope Tue 01 Oct, 2013 13:47:15 +0000

Refactored, added Ninject to load controllers for each part of the API.
InsightlyAPI class is now a true facade for the API.