npm package: @poweriam/sdk
Description: The offical poweriam client sdk.
Latest version: 2.4.0

# @poweriam/sdk

PowerIAM - JavaScript client for @poweriam/sdk
The API follows the contract/expand strategy.This means the versioning policy is additive.<br>Within the same major version, all endpoints are backwards compatible.<br>Only the APIs with the latest patch version of each major version are defined below.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: v2.4.0
- Package version: 2.4.0
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install @poweriam/sdk --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var PowerIAM = require('@poweriam/sdk');
var defaultClient = PowerIAM.ApiClient.instance;

// Configure API key authorization: JWT Token
var 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['Authorization'] = "Token"

var api = new PowerIAM.AccessApi()
var opts = { 
  'inRealmId': "inRealmId_example", // {String} 
  'inExternalRealmId': "inExternalRealmId_example", // {String} 
  'permissions': ["permissions_example"], // {[String]} 
  'userId': "userId_example" // {String} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.assurePermissions(opts, callback);
```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PowerIAM.AccessApi* | [**assurePermissions**](docs/AccessApi.md#assurePermissions) | **GET** /v2/assure-permissions | 
*PowerIAM.AccessApi* | [**getPermissionsGranted**](docs/AccessApi.md#getPermissionsGranted) | **GET** /v2/get-permissions-granted | 
*PowerIAM.AssignmentApi* | [**assignRole**](docs/AssignmentApi.md#assignRole) | **POST** /v2/assign-role | 
*PowerIAM.AssignmentApi* | [**getRoleAssignments**](docs/AssignmentApi.md#getRoleAssignments) | **GET** /v2/get-role-assignments | 
*PowerIAM.AssignmentApi* | [**unassignRole**](docs/AssignmentApi.md#unassignRole) | **DELETE** /v2/unassign-role | 
*PowerIAM.AuthApi* | [**authenticate**](docs/AuthApi.md#authenticate) | **POST** /v2/authenticate | 
*PowerIAM.AuthApi* | [**confirmAccount**](docs/AuthApi.md#confirmAccount) | **POST** /v2/confirm-account | 
*PowerIAM.AuthApi* | [**connectIdentity**](docs/AuthApi.md#connectIdentity) | **POST** /v2/connect-identity | 
*PowerIAM.AuthApi* | [**createAccount**](docs/AuthApi.md#createAccount) | **POST** /v2/create-account | 
*PowerIAM.AuthApi* | [**forgetPassword**](docs/AuthApi.md#forgetPassword) | **POST** /v2/forget-password | 
*PowerIAM.AuthApi* | [**getAuthenticationMethods**](docs/AuthApi.md#getAuthenticationMethods) | **GET** /v2/get-authentication-methods | 
*PowerIAM.AuthApi* | [**resetPassword**](docs/AuthApi.md#resetPassword) | **POST** /v2/reset-password | 
*PowerIAM.AuthApi* | [**sendEmailVerificationEmail**](docs/AuthApi.md#sendEmailVerificationEmail) | **POST** /v2/send-email-verification-email | 
*PowerIAM.AuthApi* | [**verifyEmail**](docs/AuthApi.md#verifyEmail) | **POST** /v2/verify-email | 
*PowerIAM.DomainApi* | [**createDomain**](docs/DomainApi.md#createDomain) | **POST** /v2/create-domain | 
*PowerIAM.DomainApi* | [**deleteDomain**](docs/DomainApi.md#deleteDomain) | **DELETE** /v2/delete-domain | 
*PowerIAM.DomainApi* | [**editDomain**](docs/DomainApi.md#editDomain) | **PUT** /v2/edit-domain | 
*PowerIAM.DomainApi* | [**getDomain**](docs/DomainApi.md#getDomain) | **GET** /v2/get-domain | 
*PowerIAM.DomainApi* | [**getDomains**](docs/DomainApi.md#getDomains) | **GET** /v2/get-domains | 
*PowerIAM.InvitationApi* | [**acceptInvitation**](docs/InvitationApi.md#acceptInvitation) | **PUT** /v2/accept-invitation | 
*PowerIAM.InvitationApi* | [**invite**](docs/InvitationApi.md#invite) | **POST** /v2/invite | 
*PowerIAM.PermissionApi* | [**createPermission**](docs/PermissionApi.md#createPermission) | **POST** /v2/create-permission | 
*PowerIAM.PermissionApi* | [**deletePermission**](docs/PermissionApi.md#deletePermission) | **DELETE** /v2/delete-permission | 
*PowerIAM.PermissionApi* | [**editPermission**](docs/PermissionApi.md#editPermission) | **PUT** /v2/edit-permission | 
*PowerIAM.PermissionApi* | [**getPermission**](docs/PermissionApi.md#getPermission) | **GET** /v2/get-permission | 
*PowerIAM.PermissionApi* | [**getPermissions**](docs/PermissionApi.md#getPermissions) | **GET** /v2/get-permissions | 
*PowerIAM.RealmApi* | [**addUserToRealm**](docs/RealmApi.md#addUserToRealm) | **POST** /v2/add-user-to-realm | 
*PowerIAM.RealmApi* | [**createRealm**](docs/RealmApi.md#createRealm) | **POST** /v2/create-realm | 
*PowerIAM.RealmApi* | [**deleteRealm**](docs/RealmApi.md#deleteRealm) | **DELETE** /v2/delete-realm | 
*PowerIAM.RealmApi* | [**editRealm**](docs/RealmApi.md#editRealm) | **PUT** /v2/edit-realm | 
*PowerIAM.RealmApi* | [**getRealm**](docs/RealmApi.md#getRealm) | **GET** /v2/get-realm | 
*PowerIAM.RealmApi* | [**getRealms**](docs/RealmApi.md#getRealms) | **GET** /v2/get-realms | 
*PowerIAM.RealmApi* | [**removeUserFromRealm**](docs/RealmApi.md#removeUserFromRealm) | **DELETE** /v2/remove-user-from-realm | 
*PowerIAM.RoleApi* | [**addPermissionToRole**](docs/RoleApi.md#addPermissionToRole) | **PUT** /v2/add-permission-to-role | 
*PowerIAM.RoleApi* | [**createRole**](docs/RoleApi.md#createRole) | **POST** /v2/create-role | 
*PowerIAM.RoleApi* | [**deleteRole**](docs/RoleApi.md#deleteRole) | **DELETE** /v2/delete-role | 
*PowerIAM.RoleApi* | [**editRole**](docs/RoleApi.md#editRole) | **PUT** /v2/edit-role | 
*PowerIAM.RoleApi* | [**getRole**](docs/RoleApi.md#getRole) | **GET** /v2/get-role | 
*PowerIAM.RoleApi* | [**getRolePermissions**](docs/RoleApi.md#getRolePermissions) | **GET** /v2/get-role-permissions | 
*PowerIAM.RoleApi* | [**getRoles**](docs/RoleApi.md#getRoles) | **GET** /v2/get-roles | 
*PowerIAM.RoleApi* | [**removePermissionFromRole**](docs/RoleApi.md#removePermissionFromRole) | **DELETE** /v2/remove-permission-from-role | 
*PowerIAM.RoleApi* | [**setRolePermissions**](docs/RoleApi.md#setRolePermissions) | **PUT** /v2/set-role-permissions | 
*PowerIAM.UserApi* | [**getUser**](docs/UserApi.md#getUser) | **GET** /v2/get-user | 
*PowerIAM.UserApi* | [**getUsers**](docs/UserApi.md#getUsers) | **GET** /v2/get-users | 

## Documentation for Models

 - [PowerIAM.AccountConfirmationV2](docs/AccountConfirmationV2.md)
 - [PowerIAM.AddUserToRealmCommandV2](docs/AddUserToRealmCommandV2.md)
 - [PowerIAM.AssignRoleCommandV2](docs/AssignRoleCommandV2.md)
 - [PowerIAM.AssignmentV2](docs/AssignmentV2.md)
 - [PowerIAM.AuthMethodV2](docs/AuthMethodV2.md)
 - [PowerIAM.AuthenticateCommandV2](docs/AuthenticateCommandV2.md)
 - [PowerIAM.AuthenticationMethodsV2](docs/AuthenticationMethodsV2.md)
 - [PowerIAM.Command](docs/Command.md)
 - [PowerIAM.CommandV2](docs/CommandV2.md)
 - [PowerIAM.ConfirmAccountCommandV2](docs/ConfirmAccountCommandV2.md)
 - [PowerIAM.ConnectIdentityCommandV2](docs/ConnectIdentityCommandV2.md)
 - [PowerIAM.CreateAccountCommandV2](docs/CreateAccountCommandV2.md)
 - [PowerIAM.CreateDomainCommandV2](docs/CreateDomainCommandV2.md)
 - [PowerIAM.CreatePermissionCommandV2](docs/CreatePermissionCommandV2.md)
 - [PowerIAM.CreateRealmCommandV2](docs/CreateRealmCommandV2.md)
 - [PowerIAM.CreateRoleCommandV2](docs/CreateRoleCommandV2.md)
 - [PowerIAM.DomainV2](docs/DomainV2.md)
 - [PowerIAM.EditRealmCommandV2](docs/EditRealmCommandV2.md)
 - [PowerIAM.EmailVerificationV2](docs/EmailVerificationV2.md)
 - [PowerIAM.ForgetPasswordCommandV2](docs/ForgetPasswordCommandV2.md)
 - [PowerIAM.GetRealmsCommandV2](docs/GetRealmsCommandV2.md)
 - [PowerIAM.IdentityProviderV2](docs/IdentityProviderV2.md)
 - [PowerIAM.IdentityV2](docs/IdentityV2.md)
 - [PowerIAM.InvitationStatusV2](docs/InvitationStatusV2.md)
 - [PowerIAM.InvitationV2](docs/InvitationV2.md)
 - [PowerIAM.InviteCommandV2](docs/InviteCommandV2.md)
 - [PowerIAM.OidcCredentialsV2](docs/OidcCredentialsV2.md)
 - [PowerIAM.OidcMethodV2](docs/OidcMethodV2.md)
 - [PowerIAM.OidcResponseModeV2](docs/OidcResponseModeV2.md)
 - [PowerIAM.PasswordCredentialsV2](docs/PasswordCredentialsV2.md)
 - [PowerIAM.PermissionV2](docs/PermissionV2.md)
 - [PowerIAM.RealmV2](docs/RealmV2.md)
 - [PowerIAM.ResetPasswordCommandV2](docs/ResetPasswordCommandV2.md)
 - [PowerIAM.RoleV2](docs/RoleV2.md)
 - [PowerIAM.SendEmailVerificationEmailCommandV2](docs/SendEmailVerificationEmailCommandV2.md)
 - [PowerIAM.UserV2](docs/UserV2.md)
 - [PowerIAM.VerifyEmailCommandV2](docs/VerifyEmailCommandV2.md)

## Documentation for Authorization


### JWT Token

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header