Class: ContactsClient
- Inherits:
-
Object
- Object
- ContactsClient
- Defined in:
- lib/lockstep_sdk/clients/contacts_client.rb
Instance Method Summary collapse
-
#create_contacts(body:) ⇒ Object
Creates one or more contacts from a given model.
-
#delete_contact(id:) ⇒ Object
Delete the Contact referred to by this unique identifier.
-
#delete_contacts(body:) ⇒ Object
Delete the Contacts referred to by these unique identifiers.
-
#initialize(connection) ⇒ ContactsClient
constructor
Initialize the ContactsClient class with an API client instance.
-
#query_contacts(filter:, include_param:, order:, page_size:, page_number:) ⇒ 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:, body:) ⇒ Object
Updates a contact that matches the specified id with the requested information.
Constructor Details
#initialize(connection) ⇒ ContactsClient
Initialize the ContactsClient class with an API client instance.
22 23 24 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 22 def initialize(connection) @connection = connection end |
Instance Method Details
#create_contacts(body:) ⇒ 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.
71 72 73 74 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 71 def create_contacts(body:) path = "/api/v1/Contacts" @connection.request(:post, path, body, nil) end |
#delete_contact(id:) ⇒ Object
Delete 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.
60 61 62 63 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 60 def delete_contact(id:) path = "/api/v1/Contacts/#{id}" @connection.request(:delete, path, nil, nil) end |
#delete_contacts(body:) ⇒ Object
Delete the Contacts referred to by these unique identifiers.
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.
82 83 84 85 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 82 def delete_contacts(body:) path = "/api/v1/Contacts" @connection.request(:delete, path, body, nil) end |
#query_contacts(filter:, include_param:, order:, page_size:, page_number:) ⇒ 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.
99 100 101 102 103 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 99 def query_contacts(filter:, include_param:, order:, page_size:, page_number:) path = "/api/v1/Contacts/query" params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number} @connection.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.
34 35 36 37 38 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 34 def retrieve_contact(id:, include_param:) path = "/api/v1/Contacts/#{id}" params = {:include => include_param} @connection.request(:get, path, nil, params) end |
#update_contact(id:, body:) ⇒ 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.
49 50 51 52 |
# File 'lib/lockstep_sdk/clients/contacts_client.rb', line 49 def update_contact(id:, body:) path = "/api/v1/Contacts/#{id}" @connection.request(:patch, path, body.to_camelback_keys.to_json, nil) end |