Skip to content

Latest commit

 

History

History
126 lines (90 loc) · 4.67 KB

TeamMemberApi.md

File metadata and controls

126 lines (90 loc) · 4.67 KB

swagger_client.TeamMemberApi

All URIs are relative to https://api.opsgenie.com

Method HTTP request Description
add_team_member POST /v2/teams/{identifier}/members Add Team Member
delete_team_member DELETE /v2/teams/{identifier}/members/{memberIdentifier} Delete Team Member

add_team_member

SuccessResponse add_team_member(identifier, body, team_identifier_type=team_identifier_type)

Add Team Member

Adds a member to team with given identifier

Example

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

# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.TeamMemberApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
body = swagger_client.AddTeamMemberPayload() # AddTeamMemberPayload | Request payload of added team member
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)

try:
    # Add Team Member
    api_response = api_instance.add_team_member(identifier, body, team_identifier_type=team_identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamMemberApi->add_team_member: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
body AddTeamMemberPayload Request payload of added team member
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

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

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

delete_team_member

SuccessResponse delete_team_member(identifier, member_identifier, team_identifier_type=team_identifier_type)

Delete Team Member

Deletes the member of team with given identifier

Example

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

# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.TeamMemberApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
member_identifier = 'member_identifier_example' # str | User id or username of member for removal
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)

try:
    # Delete Team Member
    api_response = api_instance.delete_team_member(identifier, member_identifier, team_identifier_type=team_identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamMemberApi->delete_team_member: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
member_identifier str User id or username of member for removal
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

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

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