Skip to content

Latest commit

 

History

History
539 lines (423 loc) · 17.9 KB

GroupsApi.md

File metadata and controls

539 lines (423 loc) · 17.9 KB

GroupsApi

All URIs are relative to http://localhost

Method HTTP request Description
groupsCreateGroup POST /api/manage/v1/Groups Create a new user group
groupsDeleteGroup DELETE /api/manage/v1/Groups/{id} Delete group by identifier
groupsGetGroup GET /api/manage/v1/Groups/{id} Gets group by identifier
groupsGetGroupList GET /api/manage/v1/Groups Returns a list of current user's groups<br /> This method will return following data about groups : <br /> Id, Name, Created time (UTC), Edited time (UTC), creator id, <br /> editor id, subscription id
groupsGetPermissions GET /api/manage/v1/Groups/{id}/permissions Gets group permissions by identifier
groupsRenameGroup PUT /api/manage/v1/Groups/{id}/rename Rename group by identifier
groupsUpdatePermissions POST /api/manage/v1/Groups/{id}/permissions Update permissions

groupsCreateGroup

GroupVM groupsCreateGroup(createGroupVM)

Create a new user group

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    CreateGroupVM createGroupVM = new CreateGroupVM(); // CreateGroupVM | Model for creating
    try {
      GroupVM result = apiInstance.groupsCreateGroup(createGroupVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsCreateGroup");
      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
createGroupVM CreateGroupVM Model for creating [optional]

Return type

GroupVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Succesfully created -
400 The reqeust is wrong -
402 subscription is outdated -
403 You don't have rights for the operation -
404 Information from view model is not found -

groupsDeleteGroup

groupsDeleteGroup(id)

Delete group by identifier

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    String id = "id_example"; // String | Identifier of group
    try {
      apiInstance.groupsDeleteGroup(id);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsDeleteGroup");
      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
id String Identifier of group

Return type

null (empty response body)

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Succesfully delete -
400 The reqeust is wrong -
402 Subscripiton is outdated -
403 You don't have rights for the operation -
404 Group with this identifier or subscription is not found -
500 Exception thrown -

groupsGetGroup

GroupVM groupsGetGroup(id)

Gets group by identifier

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    String id = "id_example"; // String | Identifier of group
    try {
      GroupVM result = apiInstance.groupsGetGroup(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsGetGroup");
      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
id String Identifier of group

Return type

GroupVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Succesfully retured -
400 The reqeust is wrong -
403 You don't have rights for the operation -
404 Group with this identifier or subscription is not found -
500 Exception thrown -

groupsGetGroupList

GroupsVM groupsGetGroupList(skip, take)

Returns a list of current user's groups<br /> This method will return following data about groups : <br /> Id, Name, Created time (UTC), Edited time (UTC), creator id, <br /> editor id, subscription id

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    Integer skip = 0; // Integer | How many groups need to skip
    Integer take = 10; // Integer | How many groups need to take
    try {
      GroupsVM result = apiInstance.groupsGetGroupList(skip, take);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsGetGroupList");
      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
skip Integer How many groups need to skip [optional] [default to 0]
take Integer How many groups need to take [optional] [default to 10]

Return type

GroupsVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Succesfully retured -
400 The reqeust is wrong -
401 User is unauthorized -
403 You don't have rights for the operation -
404 Subscription is not found -

groupsGetPermissions

GroupPermissionsVM groupsGetPermissions(id)

Gets group permissions by identifier

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    String id = "id_example"; // String | Identifier of group
    try {
      GroupPermissionsVM result = apiInstance.groupsGetPermissions(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsGetPermissions");
      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
id String Identifier of group

Return type

GroupPermissionsVM

Authorization

ApiKey, JWT

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Succesfully retured -
400 The reqeust is wrong -
403 You don't have rights for the operation -
404 Group with this identifier or subscription is not found -

groupsRenameGroup

GroupVM groupsRenameGroup(id, renameGroupVM)

Rename group by identifier

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    String id = "id_example"; // String | Identifier of group
    RenameGroupVM renameGroupVM = new RenameGroupVM(); // RenameGroupVM | Model for renaming
    try {
      GroupVM result = apiInstance.groupsRenameGroup(id, renameGroupVM);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsRenameGroup");
      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
id String Identifier of group
renameGroupVM RenameGroupVM Model for renaming

Return type

GroupVM

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Succesfully renamed -
400 The reqeust is wrong -
402 subscription is outdated -
403 You don't have rights for the operation -
404 Group with this identifier or subscription is not found -
500 Exception thrown -

groupsUpdatePermissions

groupsUpdatePermissions(id, updateGroupPermissionsVM)

Update permissions

Example

// Import classes:
import cloud.fastreport.ApiClient;
import cloud.fastreport.ApiException;
import cloud.fastreport.Configuration;
import cloud.fastreport.auth.*;
import cloud.fastreport.models.*;
import cloud.fastreport.client.GroupsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: ApiKey
    HttpBasicAuth ApiKey = (HttpBasicAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setUsername("YOUR USERNAME");
    ApiKey.setPassword("YOUR PASSWORD");

    // Configure HTTP bearer authorization: JWT
    HttpBearerAuth JWT = (HttpBearerAuth) defaultClient.getAuthentication("JWT");
    JWT.setBearerToken("BEARER TOKEN");

    GroupsApi apiInstance = new GroupsApi(defaultClient);
    String id = "id_example"; // String | 
    UpdateGroupPermissionsVM updateGroupPermissionsVM = new UpdateGroupPermissionsVM(); // UpdateGroupPermissionsVM | 
    try {
      apiInstance.groupsUpdatePermissions(id, updateGroupPermissionsVM);
    } catch (ApiException e) {
      System.err.println("Exception when calling GroupsApi#groupsUpdatePermissions");
      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
id String
updateGroupPermissionsVM UpdateGroupPermissionsVM [optional]

Return type

null (empty response body)

Authorization

ApiKey, JWT

HTTP request headers

  • Content-Type: application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Permissions are updated -
400 id or VM is not valid -
402 Subscription is outdated -
403 You have no permissions to work with groups -
404 Group or subscription is not found -
500 Try again, if error still here - text our support -