Skip to content

Latest commit

 

History

History
795 lines (634 loc) · 25.3 KB

WorkspaceApi.md

File metadata and controls

795 lines (634 loc) · 25.3 KB

Ory.Client.Api.WorkspaceApi

All URIs are relative to https://.projects.oryapis.com

Method HTTP request Description
CreateWorkspace POST /workspaces Create a new workspace
CreateWorkspaceApiKey POST /workspaces/{workspace}/tokens Create workspace API key
DeleteWorkspaceApiKey DELETE /workspaces/{workspace}/tokens/{token_id} Delete workspace API token
GetWorkspace GET /workspaces/{workspace} Get a workspace
ListWorkspaceApiKeys GET /workspaces/{workspace}/tokens List a workspace's API Tokens
ListWorkspaceProjects GET /workspaces/{workspace}/projects List all projects of a workspace
ListWorkspaces GET /workspaces List workspaces the user is a member of
UpdateWorkspace PUT /workspaces/{workspace} Update an workspace

CreateWorkspace

ClientWorkspace CreateWorkspace (ClientCreateWorkspaceBody? clientCreateWorkspaceBody = null)

Create a new workspace

Example

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

namespace Example
{
    public class CreateWorkspaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var clientCreateWorkspaceBody = new ClientCreateWorkspaceBody?(); // ClientCreateWorkspaceBody? |  (optional) 

            try
            {
                // Create a new workspace
                ClientWorkspace result = apiInstance.CreateWorkspace(clientCreateWorkspaceBody);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.CreateWorkspace: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateWorkspaceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create a new workspace
    ApiResponse<ClientWorkspace> response = apiInstance.CreateWorkspaceWithHttpInfo(clientCreateWorkspaceBody);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.CreateWorkspaceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
clientCreateWorkspaceBody ClientCreateWorkspaceBody? [optional]

Return type

ClientWorkspace

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 workspace -
400 errorGeneric -
401 errorGeneric -
403 errorGeneric -
500 errorGeneric -
0 errorGeneric -

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

CreateWorkspaceApiKey

ClientWorkspaceApiKey CreateWorkspaceApiKey (string workspace, ClientCreateWorkspaceApiKeyBody? clientCreateWorkspaceApiKeyBody = null)

Create workspace API key

Create an API key for a workspace.

Example

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

namespace Example
{
    public class CreateWorkspaceApiKeyExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | The Workspace ID
            var clientCreateWorkspaceApiKeyBody = new ClientCreateWorkspaceApiKeyBody?(); // ClientCreateWorkspaceApiKeyBody? |  (optional) 

            try
            {
                // Create workspace API key
                ClientWorkspaceApiKey result = apiInstance.CreateWorkspaceApiKey(workspace, clientCreateWorkspaceApiKeyBody);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.CreateWorkspaceApiKey: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateWorkspaceApiKeyWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create workspace API key
    ApiResponse<ClientWorkspaceApiKey> response = apiInstance.CreateWorkspaceApiKeyWithHttpInfo(workspace, clientCreateWorkspaceApiKeyBody);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.CreateWorkspaceApiKeyWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string The Workspace ID
clientCreateWorkspaceApiKeyBody ClientCreateWorkspaceApiKeyBody? [optional]

Return type

ClientWorkspaceApiKey

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 workspaceApiKey -
0 errorGeneric -

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

DeleteWorkspaceApiKey

void DeleteWorkspaceApiKey (string workspace, string tokenId)

Delete workspace API token

Deletes an API token and immediately removes it.

Example

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

namespace Example
{
    public class DeleteWorkspaceApiKeyExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | The Workspace ID or Workspace slug
            var tokenId = "tokenId_example";  // string | The Token ID

            try
            {
                // Delete workspace API token
                apiInstance.DeleteWorkspaceApiKey(workspace, tokenId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.DeleteWorkspaceApiKey: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteWorkspaceApiKeyWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete workspace API token
    apiInstance.DeleteWorkspaceApiKeyWithHttpInfo(workspace, tokenId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.DeleteWorkspaceApiKeyWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string The Workspace ID or Workspace slug
tokenId string The Token ID

Return type

void (empty response body)

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is typically 201. -
0 errorGeneric -

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

GetWorkspace

ClientWorkspace GetWorkspace (string workspace)

Get a workspace

Any workspace member can access this endpoint.

Example

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

namespace Example
{
    public class GetWorkspaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | 

            try
            {
                // Get a workspace
                ClientWorkspace result = apiInstance.GetWorkspace(workspace);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.GetWorkspace: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetWorkspaceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get a workspace
    ApiResponse<ClientWorkspace> response = apiInstance.GetWorkspaceWithHttpInfo(workspace);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.GetWorkspaceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string

Return type

ClientWorkspace

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 workspace -
400 errorGeneric -
401 errorGeneric -
403 errorGeneric -
500 errorGeneric -
0 errorGeneric -

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

ListWorkspaceApiKeys

List<ClientWorkspaceApiKey> ListWorkspaceApiKeys (string workspace)

List a workspace's API Tokens

A list of all the workspace's API tokens.

Example

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

namespace Example
{
    public class ListWorkspaceApiKeysExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | The Workspace ID or Workspace slug

            try
            {
                // List a workspace's API Tokens
                List<ClientWorkspaceApiKey> result = apiInstance.ListWorkspaceApiKeys(workspace);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.ListWorkspaceApiKeys: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListWorkspaceApiKeysWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List a workspace's API Tokens
    ApiResponse<List<ClientWorkspaceApiKey>> response = apiInstance.ListWorkspaceApiKeysWithHttpInfo(workspace);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.ListWorkspaceApiKeysWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string The Workspace ID or Workspace slug

Return type

List<ClientWorkspaceApiKey>

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 workspaceApiKeys -
0 errorGeneric -

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

ListWorkspaceProjects

ClientListWorkspaceProjects ListWorkspaceProjects (string workspace)

List all projects of a workspace

Any workspace member can access this endpoint.

Example

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

namespace Example
{
    public class ListWorkspaceProjectsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | 

            try
            {
                // List all projects of a workspace
                ClientListWorkspaceProjects result = apiInstance.ListWorkspaceProjects(workspace);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.ListWorkspaceProjects: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListWorkspaceProjectsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List all projects of a workspace
    ApiResponse<ClientListWorkspaceProjects> response = apiInstance.ListWorkspaceProjectsWithHttpInfo(workspace);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.ListWorkspaceProjectsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string

Return type

ClientListWorkspaceProjects

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 listWorkspaceProjects -
400 errorGeneric -
401 errorGeneric -
403 errorGeneric -
500 errorGeneric -
0 errorGeneric -

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

ListWorkspaces

ClientListWorkspaces ListWorkspaces (long? pageSize = null, string? pageToken = null)

List workspaces the user is a member of

Example

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

namespace Example
{
    public class ListWorkspacesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var pageSize = 250L;  // long? | Items per Page  This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (optional)  (default to 250)
            var pageToken = "pageToken_example";  // string? | Next Page Token  The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). (optional) 

            try
            {
                // List workspaces the user is a member of
                ClientListWorkspaces result = apiInstance.ListWorkspaces(pageSize, pageToken);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.ListWorkspaces: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListWorkspacesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List workspaces the user is a member of
    ApiResponse<ClientListWorkspaces> response = apiInstance.ListWorkspacesWithHttpInfo(pageSize, pageToken);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.ListWorkspacesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
pageSize long? Items per Page This is the number of items per page to return. For details on pagination please head over to the pagination documentation. [optional] [default to 250]
pageToken string? Next Page Token The next page token. For details on pagination please head over to the pagination documentation. [optional]

Return type

ClientListWorkspaces

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 listWorkspaces -
400 errorGeneric -
401 errorGeneric -
403 errorGeneric -
500 errorGeneric -
0 errorGeneric -

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

UpdateWorkspace

ClientWorkspace UpdateWorkspace (string workspace, ClientUpdateWorkspaceBody? clientUpdateWorkspaceBody = null)

Update an workspace

Workspace members with the role OWNER can access this endpoint.

Example

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

namespace Example
{
    public class UpdateWorkspaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://.projects.oryapis.com";
            // Configure Bearer token for authorization: oryWorkspaceApiKey
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new WorkspaceApi(config);
            var workspace = "workspace_example";  // string | 
            var clientUpdateWorkspaceBody = new ClientUpdateWorkspaceBody?(); // ClientUpdateWorkspaceBody? |  (optional) 

            try
            {
                // Update an workspace
                ClientWorkspace result = apiInstance.UpdateWorkspace(workspace, clientUpdateWorkspaceBody);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling WorkspaceApi.UpdateWorkspace: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateWorkspaceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update an workspace
    ApiResponse<ClientWorkspace> response = apiInstance.UpdateWorkspaceWithHttpInfo(workspace, clientUpdateWorkspaceBody);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling WorkspaceApi.UpdateWorkspaceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
workspace string
clientUpdateWorkspaceBody ClientUpdateWorkspaceBody? [optional]

Return type

ClientWorkspace

Authorization

oryWorkspaceApiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 workspace -
400 errorGeneric -
401 errorGeneric -
403 errorGeneric -
500 errorGeneric -
0 errorGeneric -

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