Class: CompaniesClient
- Inherits:
-
Object
- Object
- CompaniesClient
- Defined in:
- lib/lockstep_sdk/clients/companies.rb
Instance Method Summary collapse
-
#create_companies ⇒ Object
Creates one or more Companies from a given model.
-
#disable_company(id:) ⇒ Object
Disable the Company referred to by this unique identifier.
-
#initialize(lockstepsdk) ⇒ CompaniesClient
constructor
Initialize the CompaniesClient class with a lockstepsdk instance.
-
#query_companies(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object
Queries Companies for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.
-
#query_customer_summary(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object
Queries Customer Summaries for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.
-
#retrieve_company(id:, include_param:) ⇒ Object
Retrieves the Company specified by this unique identifier, optionally including nested data sets.
-
#retrieve_customer_detail(id:) ⇒ Object
Retrieves the Customer Details specified by this unique identifier, optionally including nested data sets.
-
#update_company(id:) ⇒ Object
Updates a Company that matches the specified id with the requested information.
Constructor Details
#initialize(lockstepsdk) ⇒ CompaniesClient
Initialize the CompaniesClient class with a lockstepsdk instance.
22 23 24 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 22 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#create_companies ⇒ Object
Creates one or more Companies from a given model. A Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.
See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
71 72 73 74 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 71 def create_companies() path = "/api/v1/Companies" @lockstepsdk.request(:post, path, body, nil) end |
#disable_company(id:) ⇒ Object
Disable the Company referred to by this unique identifier.
A Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.
See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
60 61 62 63 64 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 60 def disable_company(id:) path = "/api/v1/Companies/#{id}" params = {} @lockstepsdk.request(:delete, path, nil, params) end |
#query_companies(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object
Queries Companies 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 Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.
See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
87 88 89 90 91 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 87 def query_companies(filter:, include_param:, order:, pageSize:, pageNumber:) path = "/api/v1/Companies/query" params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber} @lockstepsdk.request(:get, path, nil, params) end |
#query_customer_summary(filter:, include_param:, order:, pageSize:, pageNumber:) ⇒ Object
Queries Customer Summaries 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. The Customer Summary View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the Customer Summary Model. See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
102 103 104 105 106 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 102 def query_customer_summary(filter:, include_param:, order:, pageSize:, pageNumber:) path = "/api/v1/Companies/views/customer-summary" params = {:filter => filter, :include => include_param, :order => order, :pageSize => pageSize, :pageNumber => pageNumber} @lockstepsdk.request(:get, path, nil, params) end |
#retrieve_company(id:, include_param:) ⇒ Object
Retrieves the Company specified by this unique identifier, optionally including nested data sets. A Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.
See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
33 34 35 36 37 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 33 def retrieve_company(id:, include_param:) path = "/api/v1/Companies/#{id}" params = {:include => include_param} @lockstepsdk.request(:get, path, nil, params) end |
#retrieve_customer_detail(id:) ⇒ Object
Retrieves the Customer Details specified by this unique identifier, optionally including nested data sets. The Customer Detail View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the Customer Detail Model. See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
111 112 113 114 115 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 111 def retrieve_customer_detail(id:) path = "/api/v1/Companies/views/customer-details/#{id}" params = {} @lockstepsdk.request(:get, path, nil, params) end |
#update_company(id:) ⇒ Object
Updates a Company 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 Company represents a customer, a vendor, or a company within the organization of the account holder. Companies can have parents and children, representing an organizational hierarchy of corporate entities. You can use Companies to track projects and financial data under this Company label.
See [Vendors, Customers, and Companies](developer.lockstep.io/docs/companies-customers-and-vendors) for more information.
47 48 49 50 51 |
# File 'lib/lockstep_sdk/clients/companies.rb', line 47 def update_company(id:) path = "/api/v1/Companies/#{id}" params = {} @lockstepsdk.request(:patch, path, body, params) end |