Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Latest commit

 

History

History
264 lines (200 loc) · 7.5 KB

CpApi.md

File metadata and controls

264 lines (200 loc) · 7.5 KB

CpApi

All URIs are relative to http://localhost

Method HTTP request Description
createCorpus POST /cp/corpus Create corpus
createUser POST /cp/user Create user
deleteCorpus DELETE /cp/corpus Delete corpus
deleteUser DELETE /cp/user Delete user

createCorpus

Memorize200Response createCorpus(createCorpusRequest)

Create corpus

Create a corpus under a namespace

Example

// Import classes:
import ai.memas.memassdk.invoker.ApiClient;
import ai.memas.memassdk.invoker.ApiException;
import ai.memas.memassdk.invoker.Configuration;
import ai.memas.memassdk.invoker.models.*;
import ai.memas.memassdk.api.CpApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    CpApi apiInstance = new CpApi(defaultClient);
    CreateCorpusRequest createCorpusRequest = new CreateCorpusRequest(); // CreateCorpusRequest | 
    try {
      Memorize200Response result = apiInstance.createCorpus(createCorpusRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CpApi#createCorpus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createCorpusRequest CreateCorpusRequest

Return type

Memorize200Response

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Operation -
400 Failed operation -

createUser

Memorize200Response createUser(createUserRequest)

Create user

Create a namespace user

Example

// Import classes:
import ai.memas.memassdk.invoker.ApiClient;
import ai.memas.memassdk.invoker.ApiException;
import ai.memas.memassdk.invoker.Configuration;
import ai.memas.memassdk.invoker.models.*;
import ai.memas.memassdk.api.CpApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    CpApi apiInstance = new CpApi(defaultClient);
    CreateUserRequest createUserRequest = new CreateUserRequest(); // CreateUserRequest | 
    try {
      Memorize200Response result = apiInstance.createUser(createUserRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CpApi#createUser");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createUserRequest CreateUserRequest

Return type

Memorize200Response

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Operation -
400 Failed operation -

deleteCorpus

Memorize200Response deleteCorpus(deleteCorpusRequest)

Delete corpus

Delete a corpus under a namespace

Example

// Import classes:
import ai.memas.memassdk.invoker.ApiClient;
import ai.memas.memassdk.invoker.ApiException;
import ai.memas.memassdk.invoker.Configuration;
import ai.memas.memassdk.invoker.models.*;
import ai.memas.memassdk.api.CpApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    CpApi apiInstance = new CpApi(defaultClient);
    DeleteCorpusRequest deleteCorpusRequest = new DeleteCorpusRequest(); // DeleteCorpusRequest | 
    try {
      Memorize200Response result = apiInstance.deleteCorpus(deleteCorpusRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CpApi#deleteCorpus");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
deleteCorpusRequest DeleteCorpusRequest

Return type

Memorize200Response

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Operation -
400 Failed operation -

deleteUser

Memorize200Response deleteUser(createUserRequest)

Delete user

Delete a namespace user

Example

// Import classes:
import ai.memas.memassdk.invoker.ApiClient;
import ai.memas.memassdk.invoker.ApiException;
import ai.memas.memassdk.invoker.Configuration;
import ai.memas.memassdk.invoker.models.*;
import ai.memas.memassdk.api.CpApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    CpApi apiInstance = new CpApi(defaultClient);
    CreateUserRequest createUserRequest = new CreateUserRequest(); // CreateUserRequest | 
    try {
      Memorize200Response result = apiInstance.deleteUser(createUserRequest);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CpApi#deleteUser");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
createUserRequest CreateUserRequest

Return type

Memorize200Response

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful Operation -
400 Failed operation -