Skip to content

Latest commit

 

History

History
718 lines (548 loc) · 20.8 KB

TeamsApi.md

File metadata and controls

718 lines (548 loc) · 20.8 KB

PollinationSDK.Api.TeamsApi

All URIs are relative to http://localhost

Method HTTP request Description
CreateTeam POST /orgs/{org_name}/teams Create a Team
DeleteOrgTeamMember DELETE /orgs/{org_name}/teams/{team_slug}/members/{username} Remove a team member
DeleteTeam DELETE /orgs/{org_name}/teams/{team_slug} Delete a Team
GetOrgTeamMembers GET /orgs/{org_name}/teams/{team_slug}/members List team members
GetTeam GET /orgs/{org_name}/teams/{team_slug} Get a Team
ListOrgTeams GET /orgs/{org_name}/teams List Teams
UpdateTeam PUT /orgs/{org_name}/teams/{team_slug} Update a Team
UpsertOrgTeamMember PATCH /orgs/{org_name}/teams/{team_slug}/members/{username}/{role} Add or update the role of an Team Member

CreateTeam

CreatedContent CreateTeam (string orgName, TeamCreate teamCreate)

Create a Team

Create a new team (must be parent org member)

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class CreateTeamExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamCreate = new TeamCreate(); // TeamCreate | 

            try
            {
                // Create a Team
                CreatedContent result = apiInstance.CreateTeam(orgName, teamCreate);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.CreateTeam: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamCreate TeamCreate

Return type

CreatedContent

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Success -
403 Access forbidden -
500 Server error -
400 Invalid request -
202 Accepted -
422 Validation Error -

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

DeleteOrgTeamMember

void DeleteOrgTeamMember (string orgName, string teamSlug, string username)

Remove a team member

Remove a member from the org (must have org owner role)

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class DeleteOrgTeamMemberExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 
            var username = username_example;  // string | 

            try
            {
                // Remove a team member
                apiInstance.DeleteOrgTeamMember(orgName, teamSlug, username);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.DeleteOrgTeamMember: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string
username string

Return type

void (empty response body)

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Accepted -
403 Access forbidden -
500 Server error -
400 Invalid request -
422 Validation Error -

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

DeleteTeam

void DeleteTeam (string orgName, string teamSlug)

Delete a Team

Delete a team (must have team or org owner role)

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class DeleteTeamExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 

            try
            {
                // Delete a Team
                apiInstance.DeleteTeam(orgName, teamSlug);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.DeleteTeam: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string

Return type

void (empty response body)

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Accepted -
403 Access forbidden -
500 Server error -
400 Invalid request -
422 Validation Error -

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

GetOrgTeamMembers

TeamMemberList GetOrgTeamMembers (string orgName, string teamSlug)

List team members

Retrieve a tean's members

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class GetOrgTeamMembersExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 

            try
            {
                // List team members
                TeamMemberList result = apiInstance.GetOrgTeamMembers(orgName, teamSlug);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.GetOrgTeamMembers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string

Return type

TeamMemberList

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Retrieved -
422 Validation Error -

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

GetTeam

Team GetTeam (string orgName, string teamSlug)

Get a Team

Retrieve a team by name

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class GetTeamExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 

            try
            {
                // Get a Team
                Team result = apiInstance.GetTeam(orgName, teamSlug);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.GetTeam: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string

Return type

Team

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Retrieved -
403 Access forbidden -
500 Server error -
400 Invalid request -
404 Not found -
422 Validation Error -

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

ListOrgTeams

TeamList ListOrgTeams (string orgName, List search = null, List name = null, List member = null, int? page = null, int? perPage = null)

List Teams

search for orgs using query parameters

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class ListOrgTeamsExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var search = new List<string>(); // List<string> | You know, for search (optional) 
            var name = new List<string>(); // List<string> | The account name (optional) 
            var member = new List<string>(); // List<string> | The ID of a user (optional) 
            var page = 56;  // int? | Page number starting from 1 (optional)  (default to 1)
            var perPage = 56;  // int? | Number of items per page (optional)  (default to 25)

            try
            {
                // List Teams
                TeamList result = apiInstance.ListOrgTeams(orgName, search, name, member, page, perPage);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.ListOrgTeams: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
search List<string> You know, for search [optional]
name List<string> The account name [optional]
member List<string> The ID of a user [optional]
page int? Page number starting from 1 [optional] [default to 1]
perPage int? Number of items per page [optional] [default to 25]

Return type

TeamList

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Retrieved -
422 Validation Error -

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

UpdateTeam

UpdateAccepted UpdateTeam (string orgName, string teamSlug, TeamUpdate teamUpdate)

Update a Team

Update a team (must have team or org owner role)

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class UpdateTeamExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 
            var teamUpdate = new TeamUpdate(); // TeamUpdate | 

            try
            {
                // Update a Team
                UpdateAccepted result = apiInstance.UpdateTeam(orgName, teamSlug, teamUpdate);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.UpdateTeam: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string
teamUpdate TeamUpdate

Return type

UpdateAccepted

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
202 Accepted -
403 Access forbidden -
500 Server error -
400 Invalid request -
404 Not found -
422 Validation Error -

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

UpsertOrgTeamMember

UpdateAccepted UpsertOrgTeamMember (string orgName, string teamSlug, string username, TeamRoleEnum role)

Add or update the role of an Team Member

Upsert a member role to the team (must have org or team owner role)

Example

using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;

namespace Example
{
    public class UpsertOrgTeamMemberExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            // Configure API key authorization: APIKeyAuth
            Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
            // Configure HTTP bearer authorization: JWTAuth
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new TeamsApi(Configuration.Default);
            var orgName = orgName_example;  // string | 
            var teamSlug = teamSlug_example;  // string | 
            var username = username_example;  // string | 
            var role = ;  // TeamRoleEnum | 

            try
            {
                // Add or update the role of an Team Member
                UpdateAccepted result = apiInstance.UpsertOrgTeamMember(orgName, teamSlug, username, role);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TeamsApi.UpsertOrgTeamMember: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
orgName string
teamSlug string
username string
role TeamRoleEnum

Return type

UpdateAccepted

Authorization

APIKeyAuth, JWTAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
202 Accepted -
403 Access forbidden -
500 Server error -
400 Invalid request -
404 Not found -
422 Validation Error -

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