Skip to content

Latest commit

 

History

History
738 lines (548 loc) · 23.5 KB

UsergroupsApi.md

File metadata and controls

738 lines (548 loc) · 23.5 KB

pyjama.UsergroupsApi

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

Method HTTP request Description
add_user_group POST /usergroups Create a new user group
add_user_to_group POST /usergroups/{id}/users Add an existing user to the user group with the specified ID
delete_user_group DELETE /usergroups/{id} Delete the user group with the specified ID
get_group GET /usergroups/{id} Get the user group with the specified ID
get_group_users GET /usergroups/{id}/users Get all users for the user group with the specified ID
get_user_groups GET /usergroups Get all user groups
remove_user_from_group DELETE /usergroups/{id}/users/{userId} Remove an existing user from the user group with the specified ID
update_user_group PUT /usergroups/{id} Update the user group with the specified ID

add_user_group

CreatedResponse add_user_group(body)

Create a new user group

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.request_user_group import RequestUserGroup
from pyjama.model.created_response import CreatedResponse
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 = usergroups_api.UsergroupsApi(api_client)
    body = RequestUserGroup(
        name="name_example",
        description="description_example",
        project=1,
    ) # RequestUserGroup | 

    # example passing only required values which don't have defaults set
    try:
        # Create a new user group
        api_response = api_instance.add_user_group(body)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->add_user_group: %s\n" % e)

Parameters

Name Type Description Notes
body RequestUserGroup

Return type

CreatedResponse

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • 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]

add_user_to_group

CreatedResponse add_user_to_group(id, body)

Add an existing user to the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.created_response import CreatedResponse
from pyjama.model.request_group_user import RequestGroupUser
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 = usergroups_api.UsergroupsApi(api_client)
    id = 1 # int | 
    body = RequestGroupUser(
        user=1,
    ) # RequestGroupUser | 

    # example passing only required values which don't have defaults set
    try:
        # Add an existing user to the user group with the specified ID
        api_response = api_instance.add_user_to_group(id, body)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->add_user_to_group: %s\n" % e)

Parameters

Name Type Description Notes
id int
body RequestGroupUser

Return type

CreatedResponse

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • 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]

delete_user_group

AbstractRestResponse delete_user_group(id)

Delete the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_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 = usergroups_api.UsergroupsApi(api_client)
    id = 1 # int | 

    # example passing only required values which don't have defaults set
    try:
        # Delete the user group with the specified ID
        api_response = api_instance.delete_user_group(id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->delete_user_group: %s\n" % e)

Parameters

Name Type Description Notes
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]

get_group

UserGroupDataWrapper get_group(id)

Get the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.user_group_data_wrapper import UserGroupDataWrapper
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 = usergroups_api.UsergroupsApi(api_client)
    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 user group with the specified ID
        api_response = api_instance.get_group(id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->get_group: %s\n" % e)

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

Parameters

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

Return type

UserGroupDataWrapper

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_group_users

UserDataListWrapper get_group_users(id)

Get all users for the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.user_data_list_wrapper import UserDataListWrapper
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 = usergroups_api.UsergroupsApi(api_client)
    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 users for the user group with the specified ID
        api_response = api_instance.get_group_users(id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->get_group_users: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all users for the user group with the specified ID
        api_response = api_instance.get_group_users(id, start_at=start_at, max_results=max_results, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->get_group_users: %s\n" % e)

Parameters

Name Type Description Notes
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

UserDataListWrapper

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_user_groups

UserGroupDataListWrapper get_user_groups()

Get all user groups

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.user_group_data_list_wrapper import UserGroupDataListWrapper
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 = usergroups_api.UsergroupsApi(api_client)
    project = 1 # int |  (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
    # and optional values
    try:
        # Get all user groups
        api_response = api_instance.get_user_groups(project=project, start_at=start_at, max_results=max_results, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->get_user_groups: %s\n" % e)

Parameters

Name Type Description Notes
project int [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

UserGroupDataListWrapper

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]

remove_user_from_group

AbstractRestResponse remove_user_from_group(user_id, id)

Remove an existing user from the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_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 = usergroups_api.UsergroupsApi(api_client)
    user_id = 1 # int | 
    id = 1 # int | 

    # example passing only required values which don't have defaults set
    try:
        # Remove an existing user from the user group with the specified ID
        api_response = api_instance.remove_user_from_group(user_id, id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->remove_user_from_group: %s\n" % e)

Parameters

Name Type Description Notes
user_id int
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]

update_user_group

AbstractRestResponse update_user_group(id, body)

Update the user group with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import usergroups_api
from pyjama.model.request_user_group import RequestUserGroup
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 = usergroups_api.UsergroupsApi(api_client)
    id = 1 # int | 
    body = RequestUserGroup(
        name="name_example",
        description="description_example",
        project=1,
    ) # RequestUserGroup | 

    # example passing only required values which don't have defaults set
    try:
        # Update the user group with the specified ID
        api_response = api_instance.update_user_group(id, body)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling UsergroupsApi->update_user_group: %s\n" % e)

Parameters

Name Type Description Notes
id int
body RequestUserGroup

Return type

AbstractRestResponse

Authorization

basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • 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]