Skip to content

Latest commit

 

History

History
241 lines (178 loc) · 6.09 KB

UsersApi.md

File metadata and controls

241 lines (178 loc) · 6.09 KB

PollinationSDK.Api.UsersApi

All URIs are relative to http://localhost

Method HTTP request Description
CheckUsername GET /users/check_username/{username} Check if a username is already taken
GetOneUser GET /users/{name} Get a specific user profile
ListUsers GET /users List Users

CheckUsername

AnyType CheckUsername (string username)

Check if a username is already taken

Check if a username is already taken by a user or an org

Example

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

namespace Example
{
    public class CheckUsernameExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            var apiInstance = new UsersApi(Configuration.Default);
            var username = username_example;  // string | 

            try
            {
                // Check if a username is already taken
                AnyType result = apiInstance.CheckUsername(username);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling UsersApi.CheckUsername: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
username string

Return type

AnyType

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Username not taken -
422 Validation Error -

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

GetOneUser

UserPublic GetOneUser (string name)

Get a specific user profile

Get a specific user profile by name

Example

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

namespace Example
{
    public class GetOneUserExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            var apiInstance = new UsersApi(Configuration.Default);
            var name = name_example;  // string | 

            try
            {
                // Get a specific user profile
                UserPublic result = apiInstance.GetOneUser(name);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling UsersApi.GetOneUser: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
name string

Return type

UserPublic

Authorization

No authorization required

HTTP request headers

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

HTTP response details

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

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

ListUsers

UserPublicList ListUsers (string search = null, int? page = null, int? perPage = null)

List Users

Example

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

namespace Example
{
    public class ListUsersExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "http://localhost";
            var apiInstance = new UsersApi(Configuration.Default);
            var search = search_example;  // string | Search string to find users (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 Users
                UserPublicList result = apiInstance.ListUsers(search, page, perPage);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling UsersApi.ListUsers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
search string Search string to find users [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

UserPublicList

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]