Class: ContactsClient
- Inherits:
-
Object
- Object
- ContactsClient
- Defined in:
- lib/lockstep_sdk/clients/contacts.rb
Instance Method Summary collapse
-
#create_contacts ⇒ Object
Creates one or more contacts from a given model.
-
#disable_contact(id:) ⇒ Object
Disable the Contact referred to by this unique identifier.
-
#initialize(lockstepsdk) ⇒ ContactsClient
constructor
Initialize the ContactsClient class with a lockstepsdk instance.
-
#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.
-
#retrieve_contact(id:, include_param:) ⇒ Object
Retrieves the Contact specified by this unique identifier, optionally including nested data sets.
-
#update_contact(id:) ⇒ Object
Updates a contact that matches the specified id with the requested information.
Constructor Details
#initialize(lockstepsdk) ⇒ ContactsClient
Initialize the ContactsClient class with a lockstepsdk instance.
22 23 24 |
# File 'lib/lockstep_sdk/clients/contacts.rb', line 22 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#create_contacts ⇒ Object
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.
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.
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.
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.
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.
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 |