Skip to content

Latest commit

 

History

History
716 lines (544 loc) · 20.6 KB

OrgsApi.md

File metadata and controls

716 lines (544 loc) · 20.6 KB

PollinationSDK.Api.OrgsApi

All URIs are relative to http://localhost

Method HTTP request Description
CreateOrg POST /orgs Create an Org
DeleteOrg DELETE /orgs/{name} Delete an Org
DeleteOrgMember DELETE /orgs/{name}/members/{username} Remove an Org member
GetOrg GET /orgs/{name} Get an Org
GetOrgMembers GET /orgs/{name}/members List organization members
ListOrgs GET /orgs List Orgs
UpdateOrg PUT /orgs/{name} Update an Org
UpsertOrgMember PATCH /orgs/{name}/members/{username}/{role} Add or update the role of an Org Member

CreateOrg

CreatedContent CreateOrg (OrganizationCreate organizationCreate)

Create an Org

Create a new org.

Example

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

namespace Example
{
    public class CreateOrgExample
    {
        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 OrgsApi(Configuration.Default);
            var organizationCreate = new OrganizationCreate(); // OrganizationCreate | 

            try
            {
                // Create an Org
                CreatedContent result = apiInstance.CreateOrg(organizationCreate);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.CreateOrg: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
organizationCreate OrganizationCreate

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]

DeleteOrg

void DeleteOrg (string name)

Delete an Org

Delete a org (must have admin permission)

Example

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

namespace Example
{
    public class DeleteOrgExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 

            try
            {
                // Delete an Org
                apiInstance.DeleteOrg(name);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.DeleteOrg: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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

DeleteOrgMember

void DeleteOrgMember (string name, string username)

Remove an Org 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 DeleteOrgMemberExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 
            var username = username_example;  // string | 

            try
            {
                // Remove an Org member
                apiInstance.DeleteOrgMember(name, username);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.DeleteOrgMember: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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

GetOrg

Organization GetOrg (string name)

Get an Org

Retrieve a org by name

Example

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

namespace Example
{
    public class GetOrgExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 

            try
            {
                // Get an Org
                Organization result = apiInstance.GetOrg(name);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.GetOrg: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
name string

Return type

Organization

Authorization

APIKeyAuth, JWTAuth

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]

GetOrgMembers

OrganizationMemberList GetOrgMembers (string name)

List organization members

Retrieve a org's members

Example

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

namespace Example
{
    public class GetOrgMembersExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 

            try
            {
                // List organization members
                OrganizationMemberList result = apiInstance.GetOrgMembers(name);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.GetOrgMembers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
name string

Return type

OrganizationMemberList

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]

ListOrgs

OrganizationList ListOrgs (List search = null, List name = null, List member = null, int? page = null, int? perPage = null)

List Orgs

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 ListOrgsExample
    {
        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 OrgsApi(Configuration.Default);
            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 username 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 Orgs
                OrganizationList result = apiInstance.ListOrgs(search, name, member, page, perPage);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.ListOrgs: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
search List<string> You know, for search [optional]
name List<string> The account name [optional]
member List<string> The username 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

OrganizationList

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]

UpdateOrg

UpdateAccepted UpdateOrg (string name, OrganizationUpdate organizationUpdate)

Update an Org

Update a 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 UpdateOrgExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 
            var organizationUpdate = new OrganizationUpdate(); // OrganizationUpdate | 

            try
            {
                // Update an Org
                UpdateAccepted result = apiInstance.UpdateOrg(name, organizationUpdate);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling OrgsApi.UpdateOrg: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
name string
organizationUpdate OrganizationUpdate

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]

UpsertOrgMember

UpdateAccepted UpsertOrgMember (string name, string username, OrganizationRoleEnum role)

Add or update the role of an Org Member

Upsert a member role to 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 UpsertOrgMemberExample
    {
        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 OrgsApi(Configuration.Default);
            var name = name_example;  // string | 
            var username = username_example;  // string | 
            var role = ;  // OrganizationRoleEnum | 

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

Parameters

Name Type Description Notes
name string
username string
role OrganizationRoleEnum

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]