Skip to content

Latest commit

 

History

History
406 lines (310 loc) · 14.6 KB

ActivitiesApi.md

File metadata and controls

406 lines (310 loc) · 14.6 KB

pyjama.ActivitiesApi

All URIs are relative to http://<jama_endpoint>/rest/latest

Method HTTP request Description
get_activit_affected_items GET /activities/{activityId}/affecteditems Get all items affected by the activity with the specified ID
get_activities GET /activities Get all activities in the project with the specified ID
get_activity GET /activities/{activityId} Get the activity with the specified ID
restore_items POST /activities/{activityId}/restore Restore item(s) associated with a delete activity.

get_activit_affected_items

ItemDataListWrapper get_activit_affected_items(activity_id)

Get all items affected by the activity with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import activities_api
from pyjama.model.item_data_list_wrapper import ItemDataListWrapper
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basic
configuration = pyjama.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = activities_api.ActivitiesApi(api_client)
    activity_id = 1 # int | 
    start_at = 1 # int |  (optional)
    max_results = 1 # int | If not set, this defaults to 20. This cannot be larger than 50 (optional)
    include = [
        "include_example",
    ] # [str] | Links to include as full objects in the linked map (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get all items affected by the activity with the specified ID
        api_response = api_instance.get_activit_affected_items(activity_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activit_affected_items: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all items affected by the activity with the specified ID
        api_response = api_instance.get_activit_affected_items(activity_id, start_at=start_at, max_results=max_results, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activit_affected_items: %s\n" % e)

Parameters

Name Type Description Notes
activity_id int
start_at int [optional]
max_results int If not set, this defaults to 20. This cannot be larger than 50 [optional]
include [str] Links to include as full objects in the linked map [optional]

Return type

ItemDataListWrapper

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

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

get_activities

ActivityDataListWrapper get_activities(project)

Get all activities in the project with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import activities_api
from pyjama.model.activity_data_list_wrapper import ActivityDataListWrapper
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basic
configuration = pyjama.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = activities_api.ActivitiesApi(api_client)
    project = 1 # int | 
    event_type = [
        "CREATE",
    ] # [str] | Event type to filter on. More than one event type can be chosen (optional)
    object_type = [
        "PROJECT",
    ] # [str] | Object type to filter on. More than one object type can be chosen (optional)
    item_type = [
        1,
    ] # [int] | ID of item type to filter on. More than one item type can be chosen (optional)
    date = [
        "date_example",
    ] # [str] | Filter datetime fields after a single date or within a range of values. Provide one or two values in ISO8601 format (milliseconds or seconds) - \"yyyy-MM-dd'T'HH:mm:ss.SSSZ\" or \"yyyy-MM-dd'T'HH:mm:ssZ\" (optional)
    delete_events = True # bool | Get item delete events only (optional)
    start_at = 1 # int |  (optional)
    max_results = 1 # int | If not set, this defaults to 20. This cannot be larger than 50 (optional)
    include = [
        "include_example",
    ] # [str] | Links to include as full objects in the linked map (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get all activities in the project with the specified ID
        api_response = api_instance.get_activities(project)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activities: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all activities in the project with the specified ID
        api_response = api_instance.get_activities(project, event_type=event_type, object_type=object_type, item_type=item_type, date=date, delete_events=delete_events, start_at=start_at, max_results=max_results, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activities: %s\n" % e)

Parameters

Name Type Description Notes
project int
event_type [str] Event type to filter on. More than one event type can be chosen [optional]
object_type [str] Object type to filter on. More than one object type can be chosen [optional]
item_type [int] ID of item type to filter on. More than one item type can be chosen [optional]
date [str] Filter datetime fields after a single date or within a range of values. Provide one or two values in ISO8601 format (milliseconds or seconds) - &quot;yyyy-MM-dd'T'HH:mm:ss.SSSZ&quot; or &quot;yyyy-MM-dd'T'HH:mm:ssZ&quot; [optional]
delete_events bool Get item delete events only [optional]
start_at int [optional]
max_results int If not set, this defaults to 20. This cannot be larger than 50 [optional]
include [str] Links to include as full objects in the linked map [optional]

Return type

ActivityDataListWrapper

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

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

get_activity

ActivityDataWrapper get_activity(activity_id)

Get the activity with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import activities_api
from pyjama.model.activity_data_wrapper import ActivityDataWrapper
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basic
configuration = pyjama.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = activities_api.ActivitiesApi(api_client)
    activity_id = 1 # int | 
    include = [
        "include_example",
    ] # [str] | Links to include as full objects in the linked map (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get the activity with the specified ID
        api_response = api_instance.get_activity(activity_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activity: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get the activity with the specified ID
        api_response = api_instance.get_activity(activity_id, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->get_activity: %s\n" % e)

Parameters

Name Type Description Notes
activity_id int
include [str] Links to include as full objects in the linked map [optional]

Return type

ActivityDataWrapper

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

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

restore_items

AbstractRestResponse restore_items(activity_id)

Restore item(s) associated with a delete activity.

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import activities_api
from pyjama.model.abstract_rest_response import AbstractRestResponse
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basic
configuration = pyjama.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = activities_api.ActivitiesApi(api_client)
    activity_id = 1 # int | 

    # example passing only required values which don't have defaults set
    try:
        # Restore item(s) associated with a delete activity.
        api_response = api_instance.restore_items(activity_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling ActivitiesApi->restore_items: %s\n" % e)

Parameters

Name Type Description Notes
activity_id int

Return type

AbstractRestResponse

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 successful operation -

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