# PowerIAM.DomainApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**createDomain**](DomainApi.md#createDomain) | **POST** /v2/create-domain | 
[**deleteDomain**](DomainApi.md#deleteDomain) | **DELETE** /v2/delete-domain | 
[**editDomain**](DomainApi.md#editDomain) | **PUT** /v2/edit-domain | 
[**getDomain**](DomainApi.md#getDomain) | **GET** /v2/get-domain | 
[**getDomains**](DomainApi.md#getDomains) | **GET** /v2/get-domains | 

<a name="createDomain"></a>
# **createDomain**
> DomainV2 createDomain(body)



Create a domain in 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.DomainApi();
let body = new PowerIAM.CreateDomainCommandV2(); // CreateDomainCommandV2 | 

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

### Parameters

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

### Return type

[**DomainV2**](DomainV2.md)

### Authorization

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

### HTTP request headers

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

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



Delete a domain.

### 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.DomainApi();
let opts = { 
  'domainId': "domainId_example" // String | 
};
apiInstance.deleteDomain(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **domainId** | **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="editDomain"></a>
# **editDomain**
> DomainV2 editDomain(opts)



Edit a domain.

### 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.DomainApi();
let opts = { 
  'domainId': "domainId_example", // String | 
  'name': "name_example", // String | 
  'description': "description_example" // String | 
};
apiInstance.editDomain(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **domainId** | **String**|  | [optional] 
 **name** | **String**|  | [optional] 
 **description** | **String**|  | [optional] 

### Return type

[**DomainV2**](DomainV2.md)

### Authorization

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

### HTTP request headers

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

<a name="getDomain"></a>
# **getDomain**
> DomainV2 getDomain(opts)



Get a domain.

### 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.DomainApi();
let opts = { 
  'domainId': "domainId_example" // String | 
};
apiInstance.getDomain(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**DomainV2**](DomainV2.md)

### Authorization

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

### HTTP request headers

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

<a name="getDomains"></a>
# **getDomains**
> [DomainV2] getDomains(opts)



Get all domains in the world, or in 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.DomainApi();
let opts = { 
  'inRealmId': "inRealmId_example" // String | 
};
apiInstance.getDomains(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

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

### Return type

[**[DomainV2]**](DomainV2.md)

### Authorization

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

### HTTP request headers

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

