Skip to content

Latest commit

 

History

History
500 lines (375 loc) · 18.6 KB

ProjectApi.md

File metadata and controls

500 lines (375 loc) · 18.6 KB

kimai_python.ProjectApi

All URIs are relative to //demo-plugins.kimai.org/

Method HTTP request Description
api_projects_get GET /api/projects Returns a collection of projects.
api_projects_id_get GET /api/projects/{id} Returns one project
api_projects_id_meta_patch PATCH /api/projects/{id}/meta Sets the value of a meta-field for an existing project
api_projects_id_patch PATCH /api/projects/{id} Update an existing project
api_projects_id_rates_get GET /api/projects/{id}/rates Returns a collection of all rates for one project
api_projects_id_rates_post POST /api/projects/{id}/rates Adds a new rate to an project
api_projects_id_rates_rate_id_delete DELETE /api/projects/{id}/rates/{rateId} Deletes one rate for an project
api_projects_post POST /api/projects Creates a new project

api_projects_get

list[ProjectCollection] api_projects_get(customer=customer, customers=customers, visible=visible, start=start, end=end, ignore_dates=ignore_dates, global_activities=global_activities, order=order, order_by=order_by, term=term)

Returns a collection of projects.

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
customer = 'customer_example' # str | Customer ID to filter projects (optional)
customers = 'customers_example' # str | Comma separated list of customer IDs to filter projects (optional)
visible = 'visible_example' # str | Visibility status to filter projects. Allowed values: 1=visible, 2=hidden, 3=both (default: 1) (optional)
start = 'start_example' # str | Only projects that started before this date will be included. Allowed format: HTML5 (default: now, if end is also empty) (optional)
end = 'end_example' # str | Only projects that ended after this date will be included. Allowed format: HTML5 (default: now, if start is also empty) (optional)
ignore_dates = 'ignore_dates_example' # str | If set, start and end are completely ignored. Allowed values: 1 (default: off) (optional)
global_activities = 'global_activities_example' # str | If given, filters projects by their 'global activity' support. Allowed values: 1 (supports global activities) and 0 (without global activities) (default: all) (optional)
order = 'order_example' # str | The result order. Allowed values: ASC, DESC (default: ASC) (optional)
order_by = 'order_by_example' # str | The field by which results will be ordered. Allowed values: id, name, customer (default: name) (optional)
term = 'term_example' # str | Free search term (optional)

try:
    # Returns a collection of projects.
    api_response = api_instance.api_projects_get(customer=customer, customers=customers, visible=visible, start=start, end=end, ignore_dates=ignore_dates, global_activities=global_activities, order=order, order_by=order_by, term=term)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_get: %s\n" % e)

Parameters

Name Type Description Notes
customer str Customer ID to filter projects [optional]
customers str Comma separated list of customer IDs to filter projects [optional]
visible str Visibility status to filter projects. Allowed values: 1=visible, 2=hidden, 3=both (default: 1) [optional]
start str Only projects that started before this date will be included. Allowed format: HTML5 (default: now, if end is also empty) [optional]
end str Only projects that ended after this date will be included. Allowed format: HTML5 (default: now, if start is also empty) [optional]
ignore_dates str If set, start and end are completely ignored. Allowed values: 1 (default: off) [optional]
global_activities str If given, filters projects by their 'global activity' support. Allowed values: 1 (supports global activities) and 0 (without global activities) (default: all) [optional]
order str The result order. Allowed values: ASC, DESC (default: ASC) [optional]
order_by str The field by which results will be ordered. Allowed values: id, name, customer (default: name) [optional]
term str Free search term [optional]

Return type

list[ProjectCollection]

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_get

ProjectEntity api_projects_id_get(id)

Returns one project

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
id = 'id_example' # str | 

try:
    # Returns one project
    api_response = api_instance.api_projects_id_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str

Return type

ProjectEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_meta_patch

ProjectEntity api_projects_id_meta_patch(id, body=body)

Sets the value of a meta-field for an existing project

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
id = 56 # int | Project record ID to set the meta-field value for
body = kimai_python.IdMetaBody2() # IdMetaBody2 |  (optional)

try:
    # Sets the value of a meta-field for an existing project
    api_response = api_instance.api_projects_id_meta_patch(id, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_meta_patch: %s\n" % e)

Parameters

Name Type Description Notes
id int Project record ID to set the meta-field value for
body IdMetaBody2 [optional]

Return type

ProjectEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_patch

ProjectEntity api_projects_id_patch(body, id)

Update an existing project

Update an existing project, you can pass all or just a subset of all attributes

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
body = kimai_python.ProjectEditForm() # ProjectEditForm | 
id = 56 # int | Project ID to update

try:
    # Update an existing project
    api_response = api_instance.api_projects_id_patch(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_patch: %s\n" % e)

Parameters

Name Type Description Notes
body ProjectEditForm
id int Project ID to update

Return type

ProjectEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_rates_get

list[ProjectRate] api_projects_id_rates_get(id)

Returns a collection of all rates for one project

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
id = 56 # int | The project whose rates will be returned

try:
    # Returns a collection of all rates for one project
    api_response = api_instance.api_projects_id_rates_get(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_rates_get: %s\n" % e)

Parameters

Name Type Description Notes
id int The project whose rates will be returned

Return type

list[ProjectRate]

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_rates_post

ProjectRate api_projects_id_rates_post(body, id)

Adds a new rate to an project

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
body = kimai_python.ProjectRateForm() # ProjectRateForm | 
id = 56 # int | The project to add the rate for

try:
    # Adds a new rate to an project
    api_response = api_instance.api_projects_id_rates_post(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_rates_post: %s\n" % e)

Parameters

Name Type Description Notes
body ProjectRateForm
id int The project to add the rate for

Return type

ProjectRate

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_id_rates_rate_id_delete

api_projects_id_rates_rate_id_delete(id, rate_id)

Deletes one rate for an project

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
id = 56 # int | The project whose rate will be removed
rate_id = 56 # int | The rate to remove

try:
    # Deletes one rate for an project
    api_instance.api_projects_id_rates_rate_id_delete(id, rate_id)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_id_rates_rate_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id int The project whose rate will be removed
rate_id int The rate to remove

Return type

void (empty response body)

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

api_projects_post

ProjectEntity api_projects_post(body)

Creates a new project

Creates a new project and returns it afterwards

Example

from __future__ import print_function
import time
import kimai_python
from kimai_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: apiToken
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer'
# Configure API key authorization: apiUser
configuration = kimai_python.Configuration()
configuration.api_key['X-AUTH-USER'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-AUTH-USER'] = 'Bearer'

# create an instance of the API class
api_instance = kimai_python.ProjectApi(kimai_python.ApiClient(configuration))
body = kimai_python.ProjectEditForm() # ProjectEditForm | 

try:
    # Creates a new project
    api_response = api_instance.api_projects_post(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ProjectApi->api_projects_post: %s\n" % e)

Parameters

Name Type Description Notes
body ProjectEditForm

Return type

ProjectEntity

Authorization

apiToken, apiUser

HTTP request headers

  • Content-Type: /
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]