Class: ContactsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/contacts.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ ContactsClient

Initialize the ContactsClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



22
23
24
# File 'lib/lockstep_sdk/clients/contacts.rb', line 22

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_contactsObject

Creates one or more contacts from a given model.

A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Parameters:

  • body (ContactModel)

    The Contacts to create



65
66
67
68
# File 'lib/lockstep_sdk/clients/contacts.rb', line 65

def create_contacts()
    path = "/api/v1/Contacts"
    @lockstepsdk.request(:post, path, body, nil)
end

#disable_contact(id:) ⇒ Object

Disable the Contact referred to by this unique identifier.

A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Contact to disable; NOT the customer's ERP key



54
55
56
57
58
# File 'lib/lockstep_sdk/clients/contacts.rb', line 54

def disable_contact(id:)
    path = "/api/v1/Contacts/#{id}"
    params = {}
    @lockstepsdk.request(:delete, path, nil, params)
end

#query_contacts(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object

Queries Contacts for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Parameters:



79
80
81
82
83
# File 'lib/lockstep_sdk/clients/contacts.rb', line 79

def query_contacts(filter:, include_param:, order:, pageSize:, pageNumber:)
    path = "/api/v1/Contacts/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_contact(id:, include_param:) ⇒ Object

Retrieves the Contact specified by this unique identifier, optionally including nested data sets. A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this Contact; NOT the customer's ERP key

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Attachments, CustomFields, Notes



31
32
33
34
35
# File 'lib/lockstep_sdk/clients/contacts.rb', line 31

def retrieve_contact(id:, include_param:)
    path = "/api/v1/Contacts/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#update_contact(id:) ⇒ Object

Updates a contact that matches the specified id with the requested information.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired. A Contact contains information about a person or role within a Company. You can use Contacts to track information about who is responsible for a specific project, who handles invoices, or information about which role at a particular customer or vendor you should speak with about invoices.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the Contact to update; NOT the customer's ERP key

  • body (object)

    A list of changes to apply to this Contact



43
44
45
46
47
# File 'lib/lockstep_sdk/clients/contacts.rb', line 43

def update_contact(id:)
    path = "/api/v1/Contacts/#{id}"
    params = {}
    @lockstepsdk.request(:patch, path, body, params)
end