HarvestClient

Struct HarvestClient 

Source
pub struct HarvestClient { /* private fields */ }

Implementations§

Source§

impl HarvestClient

Source

pub fn from_env() -> Self

Source§

impl HarvestClient

Source

pub fn new(url: &str, authentication: HarvestAuthentication) -> Self

Source

pub fn with_authentication(self, authentication: HarvestAuthentication) -> Self

Source

pub fn authenticate<'a>(&self, r: RequestBuilder<'a>) -> RequestBuilder<'a>

Source

pub fn with_middleware<M: Middleware + 'static>(self, middleware: M) -> Self

Source

pub fn list_clients(&self) -> ListClientsRequest<'_>

List all clients

Returns a list of your clients. The clients are returned sorted by creation date, with the most recently created clients appearing first.

The response contains an object with a clients property that contains an array of up to per_page clients. Each entry in the array is a separate client object. If no more clients are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your clients.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/clients/#list-all-clients.

Source

pub fn create_client(&self) -> CreateClientRequest<'_>

Create a client

Creates a new client object. Returns a client object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/clients/#create-a-client.

Source

pub fn retrieve_client(&self, client_id: &str) -> RetrieveClientRequest<'_>

Retrieve a client

Retrieves the client with the given ID. Returns a client object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/clients/#retrieve-a-client.

Source

pub fn delete_client(&self, client_id: &str) -> DeleteClientRequest<'_>

Delete a client

Delete a client. Deleting a client is only possible if it has no projects, invoices, or estimates associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/clients/#delete-a-client.

Source

pub fn update_client(&self, client_id: &str) -> UpdateClientRequest<'_>

Update a client

Updates the specific client by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a client object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/clients/#update-a-client.

Source

pub fn retrieve_company(&self) -> RetrieveCompanyRequest<'_>

Retrieve a company

Retrieves the company for the currently authenticated user. Returns a company object and a 200 OK response code.

See endpoint docs at https://help.getharvest.com/api-v2/company-api/company/company/#retrieve-a-company.

Source

pub fn update_company(&self) -> UpdateCompanyRequest<'_>

Update a company

Updates the company setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a company object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/company-api/company/company/#update-a-company.

Source

pub fn list_contacts(&self) -> ListContactsRequest<'_>

List all contacts

Returns a list of your contacts. The contacts are returned sorted by creation date, with the most recently created contacts appearing first.

The response contains an object with a contacts property that contains an array of up to per_page contacts. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your contacts.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/contacts/#list-all-contacts.

Source

pub fn create_contact(&self) -> CreateContactRequest<'_>

Create a contact

Creates a new contact object. Returns a contact object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/contacts/#create-a-contact.

Source

pub fn retrieve_contact(&self, contact_id: &str) -> RetrieveContactRequest<'_>

Retrieve a contact

Retrieves the contact with the given ID. Returns a contact object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/contacts/#retrieve-a-contact.

Source

pub fn delete_contact(&self, contact_id: &str) -> DeleteContactRequest<'_>

Delete a contact

Delete a contact. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/contacts/#delete-a-contact.

Source

pub fn update_contact(&self, contact_id: &str) -> UpdateContactRequest<'_>

Update a contact

Updates the specific contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a contact object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/clients-api/clients/contacts/#update-a-contact.

Source

pub fn list_estimate_item_categories( &self, ) -> ListEstimateItemCategoriesRequest<'_>

List all estimate item categories

Returns a list of your estimate item categories. The estimate item categories are returned sorted by creation date, with the most recently created estimate item categories appearing first.

The response contains an object with a estimate_item_categories property that contains an array of up to per_page estimate item categories. Each entry in the array is a separate estimate item category object. If no more estimate item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimate item categories.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#list-all-estimate-item-categories.

Source

pub fn create_estimate_item_category( &self, ) -> CreateEstimateItemCategoryRequest<'_>

Create an estimate item category

Creates a new estimate item category object. Returns an estimate item category object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#create-an-estimate-item-category.

Source

pub fn retrieve_estimate_item_category( &self, estimate_item_category_id: &str, ) -> RetrieveEstimateItemCategoryRequest<'_>

Retrieve an estimate item category

Retrieves the estimate item category with the given ID. Returns an estimate item category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#retrieve-an-estimate-item-category.

Source

pub fn delete_estimate_item_category( &self, estimate_item_category_id: &str, ) -> DeleteEstimateItemCategoryRequest<'_>

Delete an estimate item category

Delete an estimate item category. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#delete-an-estimate-item-category.

Source

pub fn update_estimate_item_category( &self, estimate_item_category_id: &str, ) -> UpdateEstimateItemCategoryRequest<'_>

Update an estimate item category

Updates the specific estimate item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate item category object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-item-categories/#update-an-estimate-item-category.

Source

pub fn list_estimates(&self) -> ListEstimatesRequest<'_>

List all estimates

Returns a list of your estimates. The estimates are returned sorted by issue date, with the most recently issued estimates appearing first.

The response contains an object with a estimates property that contains an array of up to per_page estimates. Each entry in the array is a separate estimate object. If no more estimates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your estimates.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#list-all-estimates.

Source

pub fn create_estimate(&self) -> CreateEstimateRequest<'_>

Create an estimate

Creates a new estimate object. Returns an estimate object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#create-an-estimate.

Source

pub fn retrieve_estimate( &self, estimate_id: &str, ) -> RetrieveEstimateRequest<'_>

Retrieve an estimate

Retrieves the estimate with the given ID. Returns an estimate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#retrieve-an-estimate.

Source

pub fn delete_estimate(&self, estimate_id: &str) -> DeleteEstimateRequest<'_>

Delete an estimate

Delete an estimate. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#delete-an-estimate.

Source

pub fn update_estimate(&self, estimate_id: &str) -> UpdateEstimateRequest<'_>

Update an estimate

Updates the specific estimate by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an estimate object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimates/#update-an-estimate.

Source

pub fn list_messages_for_estimate( &self, estimate_id: &str, ) -> ListMessagesForEstimateRequest<'_>

List all messages for an estimate

Returns a list of messages associated with a given estimate. The estimate messages are returned sorted by creation date, with the most recently created messages appearing first.

The response contains an object with an estimate_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#list-all-messages-for-an-estimate.

Source

pub fn create_estimate_message( &self, estimate_id: &str, ) -> CreateEstimateMessageRequest<'_>

Create an estimate message or change estimate status

Creates a new estimate message object. Returns an estimate message object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#create-an-estimate-message.

Source

pub fn delete_estimate_message( &self, estimate_id: &str, message_id: &str, ) -> DeleteEstimateMessageRequest<'_>

Delete an estimate message

Delete an estimate message. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/estimates-api/estimates/estimate-messages/#delete-an-estimate-message.

Source

pub fn list_expense_categories(&self) -> ListExpenseCategoriesRequest<'_>

List all expense categories

Returns a list of your expense categories. The expense categories are returned sorted by creation date, with the most recently created expense categories appearing first.

The response contains an object with a expense_categories property that contains an array of up to per_page expense categories. Each entry in the array is a separate expense category object. If no more expense categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expense categories.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#list-all-expense-categories.

Source

pub fn create_expense_category(&self) -> CreateExpenseCategoryRequest<'_>

Create an expense category

Creates a new expense category object. Returns an expense category object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#create-an-expense-category.

Source

pub fn retrieve_expense_category( &self, expense_category_id: &str, ) -> RetrieveExpenseCategoryRequest<'_>

Retrieve an expense category

Retrieves the expense category with the given ID. Returns an expense category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#retrieve-an-expense-category.

Source

pub fn delete_expense_category( &self, expense_category_id: &str, ) -> DeleteExpenseCategoryRequest<'_>

Delete an expense category

Delete an expense category. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#delete-an-expense-category.

Source

pub fn update_expense_category( &self, expense_category_id: &str, ) -> UpdateExpenseCategoryRequest<'_>

Update an expense category

Updates the specific expense category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense category object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expense-categories/#update-an-expense-category.

Source

pub fn list_expenses(&self) -> ListExpensesRequest<'_>

List all expenses

Returns a list of your expenses. If accessing this endpoint as an Administrator, all expenses in the account will be returned. If accessing this endpoint as a Manager, all expenses for assigned teammates and managed projects will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first.

The response contains an object with a expenses property that contains an array of up to per_page expenses. Each entry in the array is a separate expense object. If no more expenses are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expenses.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#list-all-expenses.

Source

pub fn create_expense(&self) -> CreateExpenseRequest<'_>

Create an expense

Creates a new expense object. Returns an expense object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#create-an-expense.

Source

pub fn retrieve_expense(&self, expense_id: &str) -> RetrieveExpenseRequest<'_>

Retrieve an expense

Retrieves the expense with the given ID. Returns an expense object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#retrieve-an-expense.

Source

pub fn delete_expense(&self, expense_id: &str) -> DeleteExpenseRequest<'_>

Delete an expense

Delete an expense. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#delete-an-expense.

Source

pub fn update_expense(&self, expense_id: &str) -> UpdateExpenseRequest<'_>

Update an expense

Updates the specific expense by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/expenses-api/expenses/expenses/#update-an-expense.

Source

pub fn list_invoice_item_categories( &self, ) -> ListInvoiceItemCategoriesRequest<'_>

List all invoice item categories

Returns a list of your invoice item categories. The invoice item categories are returned sorted by creation date, with the most recently created invoice item categories appearing first.

The response contains an object with a invoice_item_categories property that contains an array of up to per_page invoice item categories. Each entry in the array is a separate invoice item category object. If no more invoice item categories are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoice item categories.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#list-all-invoice-item-categories.

Source

pub fn create_invoice_item_category( &self, ) -> CreateInvoiceItemCategoryRequest<'_>

Create an invoice item category

Creates a new invoice item category object. Returns an invoice item category object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#create-an-invoice-item-category.

Source

pub fn retrieve_invoice_item_category( &self, invoice_item_category_id: &str, ) -> RetrieveInvoiceItemCategoryRequest<'_>

Retrieve an invoice item category

Retrieves the invoice item category with the given ID. Returns an invoice item category object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#retrieve-an-invoice-item-category.

Source

pub fn delete_invoice_item_category( &self, invoice_item_category_id: &str, ) -> DeleteInvoiceItemCategoryRequest<'_>

Delete an invoice item category

Delete an invoice item category. Deleting an invoice item category is only possible if use_as_service and use_as_expense are both false. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#delete-an-invoice-item-category.

Source

pub fn update_invoice_item_category( &self, invoice_item_category_id: &str, ) -> UpdateInvoiceItemCategoryRequest<'_>

Update an invoice item category

Updates the specific invoice item category by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice item category object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-item-categories/#update-an-invoice-item-category.

Source

pub fn list_invoices(&self) -> ListInvoicesRequest<'_>

List all invoices

Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first.

The response contains an object with a invoices property that contains an array of up to per_page invoices. Each entry in the array is a separate invoice object. If no more invoices are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoices.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#list-all-invoices.

Source

pub fn create_invoice(&self) -> CreateInvoiceRequest<'_>

Create an invoice

Creates a new invoice object. Returns an invoice object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#create-a-free-form-invoice.

Source

pub fn retrieve_invoice(&self, invoice_id: &str) -> RetrieveInvoiceRequest<'_>

Retrieve an invoice

Retrieves the invoice with the given ID. Returns an invoice object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#retrieve-an-invoice.

Source

pub fn delete_invoice(&self, invoice_id: &str) -> DeleteInvoiceRequest<'_>

Delete an invoice

Delete an invoice. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#delete-an-invoice.

Source

pub fn update_invoice(&self, invoice_id: &str) -> UpdateInvoiceRequest<'_>

Update an invoice

Updates the specific invoice by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoices/#update-an-invoice.

Source

pub fn list_messages_for_invoice( &self, invoice_id: &str, ) -> ListMessagesForInvoiceRequest<'_>

List all messages for an invoice

Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first.

The response contains an object with an invoice_messages property that contains an array of up to per_page messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#list-all-messages-for-an-invoice.

Source

pub fn create_invoice_message( &self, invoice_id: &str, ) -> CreateInvoiceMessageRequest<'_>

Create an invoice message or change invoice status

Creates a new invoice message object. Returns an invoice message object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#create-an-invoice-message.

Source

pub fn retrieve_invoice_message_subject_and_body_for_specific_invoice( &self, invoice_id: &str, ) -> RetrieveInvoiceMessageSubjectAndBodyForSpecificInvoiceRequest<'_>

Retrieve invoice message subject and body for specific invoice

Returns the subject and body text as configured in Harvest of an invoice message for a specific invoice and a 200 OK response code if the call succeeded. Does not create the invoice message. If no parameters are passed, will return the subject and body of a general invoice message for the specific invoice.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#retrieve-invoice-message-subject-and-body-for-specific-invoice.

Source

pub fn delete_invoice_message( &self, invoice_id: &str, message_id: &str, ) -> DeleteInvoiceMessageRequest<'_>

Delete an invoice message

Delete an invoice message. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-messages/#delete-an-invoice-message.

Source

pub fn list_payments_for_invoice( &self, invoice_id: &str, ) -> ListPaymentsForInvoiceRequest<'_>

List all payments for an invoice

Returns a list of payments associate with a given invoice. The payments are returned sorted by creation date, with the most recently created payments appearing first.

The response contains an object with an invoice_payments property that contains an array of up to per_page payments. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your payments.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#list-all-payments-for-an-invoice.

Source

pub fn create_invoice_payment( &self, invoice_id: &str, ) -> CreateInvoicePaymentRequest<'_>

Create an invoice payment

Creates a new invoice payment object. Returns an invoice payment object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#create-an-invoice-payment.

Source

pub fn delete_invoice_payment( &self, invoice_id: &str, payment_id: &str, ) -> DeleteInvoicePaymentRequest<'_>

Delete an invoice payment

Delete an invoice payment. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/invoices-api/invoices/invoice-payments/#delete-an-invoice-payment.

Source

pub fn list_projects(&self) -> ListProjectsRequest<'_>

List all projects

Returns a list of your projects. The projects are returned sorted by creation date, with the most recently created projects appearing first.

The response contains an object with a projects property that contains an array of up to per_page projects. Each entry in the array is a separate project object. If no more projects are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your projects.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/projects/#list-all-projects.

Source

pub fn create_project(&self) -> CreateProjectRequest<'_>

Create a project

Creates a new project object. Returns a project object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/projects/#create-a-project.

Source

pub fn retrieve_project(&self, project_id: &str) -> RetrieveProjectRequest<'_>

Retrieve a project

Retrieves the project with the given ID. Returns a project object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/projects/#retrieve-a-project.

Source

pub fn delete_project(&self, project_id: &str) -> DeleteProjectRequest<'_>

Delete a project

Deletes a project and any time entries or expenses tracked to it. However, invoices associated with the project will not be deleted. If you don’t want the project’s time entries and expenses to be deleted, you should archive the project instead.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/projects/#delete-a-project.

Source

pub fn update_project(&self, project_id: &str) -> UpdateProjectRequest<'_>

Update a project

Updates the specific project by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a project object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/projects/#update-a-project.

Source

pub fn list_task_assignments_for_specific_project( &self, project_id: &str, ) -> ListTaskAssignmentsForSpecificProjectRequest<'_>

List all task assignments for a specific project

Returns a list of your task assignments for the project identified by PROJECT_ID. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.

The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#list-all-task-assignments-for-a-specific-project.

Source

pub fn create_task_assignment( &self, project_id: &str, ) -> CreateTaskAssignmentRequest<'_>

Create a task assignment

Creates a new task assignment object. Returns a task assignment object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#create-a-task-assignment.

Source

pub fn retrieve_task_assignment( &self, project_id: &str, task_assignment_id: &str, ) -> RetrieveTaskAssignmentRequest<'_>

Retrieve a task assignment

Retrieves the task assignment with the given ID. Returns a task assignment object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#retrieve-a-task-assignment.

Source

pub fn delete_task_assignment( &self, project_id: &str, task_assignment_id: &str, ) -> DeleteTaskAssignmentRequest<'_>

Delete a task assignment

Delete a task assignment. Deleting a task assignment is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#delete-a-task-assignment.

Source

pub fn update_task_assignment( &self, project_id: &str, task_assignment_id: &str, ) -> UpdateTaskAssignmentRequest<'_>

Update a task assignment

Updates the specific task assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task assignment object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#update-a-task-assignment.

Source

pub fn list_user_assignments_for_specific_project( &self, project_id: &str, ) -> ListUserAssignmentsForSpecificProjectRequest<'_>

List all user assignments for a specific project

Returns a list of user assignments for the project identified by PROJECT_ID. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first.

The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#list-all-user-assignments-for-a-specific-project.

Source

pub fn create_user_assignment( &self, project_id: &str, ) -> CreateUserAssignmentRequest<'_>

Create a user assignment

Creates a new user assignment object. Returns a user assignment object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#create-a-user-assignment.

Source

pub fn retrieve_user_assignment( &self, project_id: &str, user_assignment_id: &str, ) -> RetrieveUserAssignmentRequest<'_>

Retrieve a user assignment

Retrieves the user assignment with the given ID. Returns a user assignment object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#retrieve-a-user-assignment.

Source

pub fn delete_user_assignment( &self, project_id: &str, user_assignment_id: &str, ) -> DeleteUserAssignmentRequest<'_>

Delete a user assignment

Delete a user assignment. Deleting a user assignment is only possible if it has no time entries or expenses associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#delete-a-user-assignment.

Source

pub fn update_user_assignment( &self, project_id: &str, user_assignment_id: &str, ) -> UpdateUserAssignmentRequest<'_>

Update a user assignment

Updates the specific user assignment by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user assignment object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#update-a-user-assignment.

Source

pub fn expense_categories_report( &self, from: &str, to: &str, ) -> ExpenseCategoriesReportRequest<'_>

Source

pub fn clients_expenses_report( &self, from: &str, to: &str, ) -> ClientsExpensesReportRequest<'_>

Source

pub fn projects_expenses_report( &self, from: &str, to: &str, ) -> ProjectsExpensesReportRequest<'_>

Source

pub fn team_expenses_report( &self, from: &str, to: &str, ) -> TeamExpensesReportRequest<'_>

Source

pub fn project_budget_report(&self) -> ProjectBudgetReportRequest<'_>

Project Budget Report

The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.

See endpoint docs at https://help.getharvest.com/api-v2/reports-api/reports/project-budget-report/#project-budget-report.

Source

pub fn clients_time_report( &self, from: &str, to: &str, ) -> ClientsTimeReportRequest<'_>

Source

pub fn projects_time_report( &self, from: &str, to: &str, ) -> ProjectsTimeReportRequest<'_>

Source

pub fn tasks_report(&self, from: &str, to: &str) -> TasksReportRequest<'_>

Source

pub fn team_time_report( &self, from: &str, to: &str, ) -> TeamTimeReportRequest<'_>

Source

pub fn uninvoiced_report( &self, from: &str, to: &str, ) -> UninvoicedReportRequest<'_>

Uninvoiced Report

The response contains an object with a results property that contains an array of up to per_page results. Each entry in the array is a separate result object. If no more results are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your results.

Note: Each request requires both the from and to parameters to be supplied in the URL’s query string. The timeframe supplied cannot exceed 1 year (365 days).

See endpoint docs at https://help.getharvest.com/api-v2/reports-api/reports/uninvoiced-report/#uninvoiced-report.

Source

pub fn list_roles(&self) -> ListRolesRequest<'_>

List all roles

Returns a list of roles in the account. The roles are returned sorted by creation date, with the most recently created roles appearing first.

The response contains an object with a roles property that contains an array of up to per_page roles. Each entry in the array is a separate role object. If no more roles are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your roles.

See endpoint docs at https://help.getharvest.com/api-v2/roles-api/roles/roles/#list-all-roles.

Source

pub fn create_role(&self) -> CreateRoleRequest<'_>

Create a role

Creates a new role object. Returns a role object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/roles-api/roles/roles/#create-a-role.

Source

pub fn retrieve_role(&self, role_id: &str) -> RetrieveRoleRequest<'_>

Retrieve a role

Retrieves the role with the given ID. Returns a role object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/roles-api/roles/roles/#retrieve-a-role.

Source

pub fn delete_role(&self, role_id: &str) -> DeleteRoleRequest<'_>

Delete a role

Delete a role. Deleting a role will unlink it from any users it was assigned to. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/roles-api/roles/roles/#delete-a-role.

Source

pub fn update_role(&self, role_id: &str) -> UpdateRoleRequest<'_>

Update a role

Updates the specific role by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a role object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/roles-api/roles/roles/#update-a-role.

Source

pub fn list_task_assignments(&self) -> ListTaskAssignmentsRequest<'_>

List all task assignments

Returns a list of your task assignments. The task assignments are returned sorted by creation date, with the most recently created task assignments appearing first.

The response contains an object with a task_assignments property that contains an array of up to per_page task assignments. Each entry in the array is a separate task assignment object. If no more task assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your task assignments.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/task-assignments/#list-all-task-assignments.

Source

pub fn list_tasks(&self) -> ListTasksRequest<'_>

List all tasks

Returns a list of your tasks. The tasks are returned sorted by creation date, with the most recently created tasks appearing first.

The response contains an object with a tasks property that contains an array of up to per_page tasks. Each entry in the array is a separate task object. If no more tasks are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your tasks.

See endpoint docs at https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#list-all-tasks.

Source

pub fn create_task(&self) -> CreateTaskRequest<'_>

Create a task

Creates a new task object. Returns a task object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#create-a-task.

Source

pub fn retrieve_task(&self, task_id: &str) -> RetrieveTaskRequest<'_>

Retrieve a task

Retrieves the task with the given ID. Returns a task object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#retrieve-a-task.

Source

pub fn delete_task(&self, task_id: &str) -> DeleteTaskRequest<'_>

Delete a task

Delete a task. Deleting a task is only possible if it has no time entries associated with it. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#delete-a-task.

Source

pub fn update_task(&self, task_id: &str) -> UpdateTaskRequest<'_>

Update a task

Updates the specific task by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a task object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/tasks-api/tasks/tasks/#update-a-task.

Source

pub fn list_time_entries(&self) -> ListTimeEntriesRequest<'_>

List all time entries

Returns a list of time entries. The time entries are returned sorted by spent_date date. At this time, the sort option can’t be customized.

The response contains an object with a time_entries property that contains an array of up to per_page time entries. Each entry in the array is a separate time entry object. If no more time entries are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your time entries.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#list-all-time-entries.

Source

pub fn create_time_entry(&self) -> CreateTimeEntryRequest<'_>

Create a time entry

Creates a new time entry object. Returns a time entry object and a 201 Created response code if the call succeeded.

You should only use this method to create time entries when your account is configured to track time via duration. You can verify this by visiting the Settings page in your Harvest account or by checking if wants_timestamp_timers is false in the Company API.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#create-a-time-entry-via-duration.

Source

pub fn retrieve_time_entry( &self, time_entry_id: &str, ) -> RetrieveTimeEntryRequest<'_>

Retrieve a time entry

Retrieves the time entry with the given ID. Returns a time entry object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#retrieve-a-time-entry.

Source

pub fn delete_time_entry( &self, time_entry_id: &str, ) -> DeleteTimeEntryRequest<'_>

Delete a time entry

Delete a time entry. Deleting a time entry is only possible if it’s not closed and the associated project and task haven’t been archived. However, Admins can delete closed entries. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#delete-a-time-entry.

Source

pub fn update_time_entry( &self, time_entry_id: &str, ) -> UpdateTimeEntryRequest<'_>

Update a time entry

Updates the specific time entry by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a time entry object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#update-a-time-entry.

Source

pub fn delete_time_entry_external_reference( &self, time_entry_id: &str, ) -> DeleteTimeEntryExternalReferenceRequest<'_>

Delete a time entry’s external reference

Delete a time entry’s external reference. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#delete-a-time-entrys-external-reference.

Source

pub fn restart_stopped_time_entry( &self, time_entry_id: &str, ) -> RestartStoppedTimeEntryRequest<'_>

Restart a stopped time entry

Restarting a time entry is only possible if it isn’t currently running. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#restart-a-stopped-time-entry.

Source

pub fn stop_running_time_entry( &self, time_entry_id: &str, ) -> StopRunningTimeEntryRequest<'_>

Stop a running time entry

Stopping a time entry is only possible if it’s currently running. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/#stop-a-running-time-entry.

Source

pub fn list_user_assignments(&self) -> ListUserAssignmentsRequest<'_>

List all user assignments

Returns a list of your projects user assignments, active and archived. The user assignments are returned sorted by creation date, with the most recently created user assignments appearing first.

The response contains an object with a user_assignments property that contains an array of up to per_page user assignments. Each entry in the array is a separate user assignment object. If no more user assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your user assignments.

See endpoint docs at https://help.getharvest.com/api-v2/projects-api/projects/user-assignments/#list-all-user-assignments.

Source

pub fn list_users(&self) -> ListUsersRequest<'_>

List all users

Returns a list of your users. The users are returned sorted by creation date, with the most recently created users appearing first.

The response contains an object with a users property that contains an array of up to per_page users. Each entry in the array is a separate user object. If no more users are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your users.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#list-all-users.

Source

pub fn create_user(&self) -> CreateUserRequest<'_>

Create a user

Creates a new user object and sends an invitation email to the address specified in the email parameter. Returns a user object and a 201 Created response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#create-a-user.

Source

pub fn retrieve_the_currently_authenticated_user( &self, ) -> RetrieveTheCurrentlyAuthenticatedUserRequest<'_>

Retrieve the currently authenticated user

Retrieves the currently authenticated user. Returns a user object and a 200 OK response code.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#retrieve-the-currently-authenticated-user.

Source

pub fn list_active_project_assignments_for_the_currently_authenticated_user( &self, ) -> ListActiveProjectAssignmentsForTheCurrentlyAuthenticatedUserRequest<'_>

List active project assignments for the currently authenticated user

Returns a list of your active project assignments for the currently authenticated user. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first.

The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/project-assignments/#list-active-project-assignments-for-the-currently-authenticated-user.

Source

pub fn retrieve_user(&self, user_id: &str) -> RetrieveUserRequest<'_>

Retrieve a user

Retrieves the user with the given ID. Returns a user object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#retrieve-a-user.

Source

pub fn delete_user(&self, user_id: &str) -> DeleteUserRequest<'_>

Delete a user

Delete a user. Deleting a user is only possible if they have no time entries or expenses associated with them. Returns a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#delete-a-user.

Source

pub fn update_user(&self, user_id: &str) -> UpdateUserRequest<'_>

Update a user

Updates the specific user by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns a user object and a 200 OK response code if the call succeeded.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/users/#update-a-user.

Source

pub fn list_billable_rates_for_specific_user( &self, user_id: &str, ) -> ListBillableRatesForSpecificUserRequest<'_>

List all billable rates for a specific user

Returns a list of billable rates for the user identified by USER_ID. The billable rates are returned sorted by start_date, with the oldest starting billable rates appearing first.

The response contains an object with a billable_rates property that contains an array of up to per_page billable rates. Each entry in the array is a separate billable rate object. If no more billable rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your billable rates.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/billable-rates/#list-all-billable-rates-for-a-specific-user.

Source

pub fn create_billable_rate( &self, user_id: &str, ) -> CreateBillableRateRequest<'_>

Create a billable rate

Creates a new billable rate object. Returns a billable rate object and a 201 Created response code if the call succeeded.

Creating a billable rate with no start_date will replace a user’s existing rate(s). Creating a billable rate with a start_date that is before a user’s existing rate(s) will replace those billable rates with the new one.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/billable-rates/#create-a-billable-rate.

Source

pub fn retrieve_billable_rate( &self, user_id: &str, billable_rate_id: &str, ) -> RetrieveBillableRateRequest<'_>

Retrieve a billable rate

Retrieves the billable rate with the given ID. Returns a billable rate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/billable-rates/#retrieve-a-billable-rate.

Source

pub fn list_cost_rates_for_specific_user( &self, user_id: &str, ) -> ListCostRatesForSpecificUserRequest<'_>

List all cost rates for a specific user

Returns a list of cost rates for the user identified by USER_ID. The cost rates are returned sorted by start_date, with the oldest starting cost rates appearing first.

The response contains an object with a cost_rates property that contains an array of up to per_page cost rates. Each entry in the array is a separate cost rate object. If no more cost rates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your cost rates.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/cost-rates/#list-all-cost-rates-for-a-specific-user.

Source

pub fn create_cost_rate(&self, user_id: &str) -> CreateCostRateRequest<'_>

Create a cost rate

Creates a new cost rate object. Returns a cost rate object and a 201 Created response code if the call succeeded.

Creating a cost rate with no start_date will replace a user’s existing rate(s). Creating a cost rate with a start_date that is before a user’s existing rate(s) will replace those cost rates with the new one.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/cost-rates/#create-a-cost-rate.

Source

pub fn retrieve_cost_rate( &self, user_id: &str, cost_rate_id: &str, ) -> RetrieveCostRateRequest<'_>

Retrieve a cost rate

Retrieves the cost rate with the given ID. Returns a cost rate object and a 200 OK response code if a valid identifier was provided.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/cost-rates/#retrieve-a-cost-rate.

Source

pub fn list_active_project_assignments( &self, user_id: &str, ) -> ListActiveProjectAssignmentsRequest<'_>

List active project assignments

Returns a list of active project assignments for the user identified by USER_ID. The project assignments are returned sorted by creation date, with the most recently created project assignments appearing first.

The response contains an object with a project_assignments property that contains an array of up to per_page project assignments. Each entry in the array is a separate project assignment object. If no more project assignments are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your project assignments.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/project-assignments/#list-active-project-assignments.

Source

pub fn list_assigned_teammates_for_specific_user( &self, user_id: &str, ) -> ListAssignedTeammatesForSpecificUserRequest<'_>

List all assigned teammates for a specific user

Returns a list of assigned teammates for the user identified by USER_ID. The USER_ID must belong to a user that is a Manager, if not, a 422 Unprocessable Entity status code will be returned.

The response contains an object with a teammates property that contains an array of up to per_page teammates. Each entry in the array is a separate teammate object. If no more teammates are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your teammates.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/teammates/#list-all-assigned-teammates-for-a-specific-user.

Source

pub fn update_user_assigned_teammates( &self, user_id: &str, ) -> UpdateUserAssignedTeammatesRequest<'_>

Update a user’s assigned teammates

Updates the the assigned teammates for a specific user. Returns list of assigned teammates and a 200 OK response code if the call succeeded. The USER_ID must belong to a user that is a Manager, if not, a 422 Unprocessable Entity status code will be returned.

Adding teammates for the first time will add the people_manager access role to the Manager. Any IDs not included in the teammate_ids that are currently assigned will be unassigned from the Manager. Use an empty array to unassign all users. This will also remove the people_manager access role from the Manager.

See endpoint docs at https://help.getharvest.com/api-v2/users-api/users/teammates/#update-a-users-assigned-teammates.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more