# PowerIAM.RealmApi

All URIs are relative to *http://localhost:9000*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addUserToRealm**](RealmApi.md#addUserToRealm) | **POST** /v2/add-user-to-realm | 
[**createRealm**](RealmApi.md#createRealm) | **POST** /v2/create-realm | 
[**deleteRealm**](RealmApi.md#deleteRealm) | **DELETE** /v2/delete-realm | 
[**editRealm**](RealmApi.md#editRealm) | **PUT** /v2/edit-realm | 
[**getRealm**](RealmApi.md#getRealm) | **GET** /v2/get-realm | 
[**getRealms**](RealmApi.md#getRealms) | **GET** /v2/get-realms | 
[**removeUserFromRealm**](RealmApi.md#removeUserFromRealm) | **DELETE** /v2/remove-user-from-realm | 

<a name="addUserToRealm"></a>
# **addUserToRealm**
> &#x27;String&#x27; addUserToRealm(body)



Add a user to a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let body = new PowerIAM.AddUserToRealmCommandV2(); // AddUserToRealmCommandV2 | 

apiInstance.addUserToRealm(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**AddUserToRealmCommandV2**](AddUserToRealmCommandV2.md)|  | 

### Return type

**&#x27;String&#x27;**

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="createRealm"></a>
# **createRealm**
> RealmV2 createRealm(body)



Create a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let body = new PowerIAM.CreateRealmCommandV2(); // CreateRealmCommandV2 | 

apiInstance.createRealm(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CreateRealmCommandV2**](CreateRealmCommandV2.md)|  | 

### Return type

[**RealmV2**](RealmV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="deleteRealm"></a>
# **deleteRealm**
> &#x27;String&#x27; deleteRealm(opts)



Delete a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let opts = { 
  'realmId': "realmId_example" // String | 
};
apiInstance.deleteRealm(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **realmId** | **String**|  | [optional] 

### Return type

**&#x27;String&#x27;**

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="editRealm"></a>
# **editRealm**
> RealmV2 editRealm(body)



Edit a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let body = new PowerIAM.EditRealmCommandV2(); // EditRealmCommandV2 | 

apiInstance.editRealm(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**EditRealmCommandV2**](EditRealmCommandV2.md)|  | 

### Return type

[**RealmV2**](RealmV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="getRealm"></a>
# **getRealm**
> RealmV2 getRealm(opts)



Get a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let opts = { 
  'realmId': "realmId_example" // String | 
};
apiInstance.getRealm(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **realmId** | **String**|  | [optional] 

### Return type

[**RealmV2**](RealmV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="getRealms"></a>
# **getRealms**
> [RealmV2] getRealms(opts)



Get all realms.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let opts = { 
  'commandV2': new PowerIAM.CommandV2() // CommandV2 | 
};
apiInstance.getRealms(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **commandV2** | [**CommandV2**](.md)|  | [optional] 

### Return type

[**[RealmV2]**](RealmV2.md)

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

<a name="removeUserFromRealm"></a>
# **removeUserFromRealm**
> &#x27;String&#x27; removeUserFromRealm(opts)



Remove a user from a realm.

### Example
```javascript
import {PowerIAM} from '@poweriam/sdk';
let defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
let JWT Token = defaultClient.authentications['JWT Token'];
JWT Token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT Token.apiKeyPrefix = 'Token';

let apiInstance = new PowerIAM.RealmApi();
let opts = { 
  'realmId': "realmId_example", // String | 
  'userId': "userId_example" // String | 
};
apiInstance.removeUserFromRealm(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **realmId** | **String**|  | [optional] 
 **userId** | **String**|  | [optional] 

### Return type

**&#x27;String&#x27;**

### Authorization

[JWT Token](../README.md#JWT Token)

### HTTP request headers

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

