You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2019/09/03 13:43:09 UTC

[airavata-custos] 14/45: added custos tenant profile

This is an automated email from the ASF dual-hosted git repository.

smarru pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git

commit 21e80c770c325f640290b04433ac0f239b74b8bc
Author: Aarushi <aa...@gmail.com>
AuthorDate: Fri Aug 9 12:26:02 2019 -0400

    added custos tenant profile
---
 custos-client/pom.xml                              |    16 +-
 .../service/AuthenticationServiceClient.java       |     2 +-
 .../service/CustosProfileServiceClientFactory.java |    77 +
 .../custos/commons/utils/ApplicationSettings.java  |    21 +-
 .../apache/custos/commons/utils/DBInitConfig.java  |    33 +
 .../apache/custos/commons/utils/DBInitializer.java |    71 +
 .../org/apache/custos/commons/utils/DBUtil.java    |   306 +
 .../custos/commons/utils/DatabaseCreator.java      |   378 +
 .../apache/custos/commons/utils/JDBCConfig.java    |    29 +
 .../org/apache/custos/commons/utils/JPAUtils.java  |    67 +
 .../custos/commons/utils/ServerSettings.java       |    36 +-
 custos-connectors/pom.xml                          |    48 +-
 .../manager/KeyCloakSecurityManager.java           |     2 -
 .../iam-admin-services}/pom.xml                    |    13 +-
 .../client/CustosIamAdminServiceClient.java        |    48 +
 .../services/core/TenantManagementInterface.java   |   206 +
 .../core/TenantManagementKeycloakImpl.java         |   815 +
 .../iam/admin/services/cpi/IamAdminServices.java   | 17956 +++++++++++++++++++
 .../cpi/exception/IamAdminServicesException.java   |   381 +
 .../cpi/iam_admin_services_cpiConstants.java       |    16 +
 .../services/handler/IamAdminServicesHandler.java  |   296 +
 custos-profile-service/pom.xml                     |    26 +
 .../profile-service-commons/pom.xml                |   124 +
 .../commons/repositories/AbstractRepository.java   |   124 +
 .../commons/tenant/entities/GatewayEntity.java     |   285 +
 .../user/entities/CustomizedDashboardEntity.java   |   325 +
 .../user/entities/NSFDemographicsEntity.java       |   108 +
 .../commons/user/entities/UserProfileEntity.java   |   345 +
 .../custos/profile/commons/utils/Committer.java    |    27 +
 .../custos/profile/commons/utils/JPAConstants.java |    34 +
 .../custos/profile/commons/utils/JPAUtils.java     |    53 +
 .../commons/utils/ObjectMapperSingleton.java       |    39 +
 .../commons/utils/ProfileServiceJDBCConfig.java    |    51 +
 .../profile/commons/utils/QueryConstants.java      |    36 +
 .../apache/custos/profile/commons/utils/Utils.java |   122 +
 .../src/main/resources/META-INF/persistence.xml    |    36 +
 .../profile-service-model/pom.xml                  |    15 +
 .../profile/model/tenant/PasswordCredential.java   |   996 +
 .../apache/custos/profile/model/tenant/Tenant.java |  1543 ++
 .../profile/model/tenant/TenantApprovalStatus.java |    78 +
 .../custos/profile/model/tenant/TenantConfig.java  |   699 +
 .../profile/model/tenant/TenantPreferences.java    |   594 +
 .../custos/profile/model/user/CustomDashboard.java |  2912 +++
 .../custos/profile/model/user/NSFDemographics.java |  1085 ++
 .../apache/custos/profile/model/user/Status.java   |    96 +
 .../custos/profile/model/user/USCitizenship.java   |    67 +
 .../custos/profile/model/user/UserProfile.java     |  3221 ++++
 .../custos/profile/model/user/disability.java      |    66 +
 .../custos/profile/model/user/ethnicity.java       |    65 +
 .../org/apache/custos/profile/model/user/race.java |    84 +
 .../model/user/user_profile_modelConstants.java    |    31 +
 .../custos/profile/model/workspace/Gateway.java    |  2383 +++
 .../model/workspace/GatewayApprovalStatus.java     |    78 +
 .../profile-service-server}/pom.xml                |    20 +-
 .../profile/server/ProfileServiceServer.java       |   197 +
 .../src/main/resources/log4j.properties            |    34 +
 .../tenant-profile-service}/pom.xml                |    20 +-
 .../tenant/core/TenantProfileRepository.java       |   104 +
 .../profile/tenant/cpi/TenantProfileService.java   |  9934 ++++++++++
 .../exception/TenantProfileServiceException.java   |   370 +
 .../tenant/cpi/profile_tenant_cpiConstants.java    |    16 +
 .../handler/TenantProfileServiceHandler.java       |   193 +
 .../user-profile-service}/pom.xml                  |    30 +-
 .../exceptions/UserProfileRegistryException.java   |    28 +
 .../core/repositories/UserProfileRepository.java   |   129 +
 .../core/utils/UserProfileCatalogDBInitConfig.java |    42 +
 .../core/utils/UserProfileCatalogJDBCConfig.java   |    52 +
 .../profile/user/cpi/UserProfileService.java       |  9611 ++++++++++
 .../cpi/exception/UserProfileServiceException.java |   370 +
 .../user/cpi/profile_user_cpiConstants.java        |    16 +
 .../user/handler/UserProfileServiceHandler.java    |   239 +
 ide-integration/log4j.properties                   |    34 +
 ide-integration/pom.xml                            |    10 +
 .../src/main/java/CustosAPIServerStarted.java      |     6 +
 .../src/main/resources/custos-server.properties    |    18 +
 .../database_scripts/init/01-databases.sql         |   355 +
 .../user-profile-catalog-derby.sql                 |   163 +
 .../user-profile-catalog-mysql.sql                 |   163 +
 .../src/main/resources/docker-compose.yml          |    14 +-
 .../src/main/resources/keystores/airavata.jks      |   Bin 0 -> 2679 bytes
 .../src/main/resources/keystores/airavata_sym.jks  |   Bin 0 -> 501 bytes
 .../main/resources/keystores/client_truststore.jks |   Bin 0 -> 1027 bytes
 log4j.properties                                   |    34 +
 pom.xml                                            |    38 +-
 .../tenant_profile_model.thrift                    |    73 +
 .../user_profile_model.thrift                      |   229 +
 .../workspace_model.thrift                         |    57 +
 .../iam-admin-services-cpi.thrift                  |   118 +
 .../iam_admin_services_cpi_errors.thrift           |    33 +
 .../profile-service/profile-service-cpi.thrift     |    29 +
 .../profile-tenant/profile-tenant-cpi.thrift       |    75 +
 .../profile_tenant_cpi_errors.thrift               |    33 +
 .../profile-user/profile-user-cpi.thrift           |    83 +
 .../profile-user/profile_user_cpi_errors.thrift    |    33 +
 94 files changed, 59477 insertions(+), 91 deletions(-)

diff --git a/custos-client/pom.xml b/custos-client/pom.xml
index 882305a..2c2ee4c 100644
--- a/custos-client/pom.xml
+++ b/custos-client/pom.xml
@@ -12,13 +12,25 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.custos</groupId>
-            <artifactId>profile-service-stubs</artifactId>
+            <artifactId>custos-authentication</artifactId>
             <version>1.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.custos</groupId>
-            <artifactId>custos-authentication</artifactId>
+            <artifactId>user-profile-service</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.custos</groupId>
+            <artifactId>iam-admin-services</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.custos</groupId>
+            <artifactId>tenant-profile-service</artifactId>
             <version>1.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
diff --git a/custos-client/src/main/java/org/apache/custos/client/authentication/service/AuthenticationServiceClient.java b/custos-client/src/main/java/org/apache/custos/client/authentication/service/AuthenticationServiceClient.java
index 4fc0444..7ef7cf4 100644
--- a/custos-client/src/main/java/org/apache/custos/client/authentication/service/AuthenticationServiceClient.java
+++ b/custos-client/src/main/java/org/apache/custos/client/authentication/service/AuthenticationServiceClient.java
@@ -8,7 +8,7 @@ import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransport;
 import org.apache.thrift.transport.TTransportException;
 
-public class AuthenticationServiceClient {
+    public class AuthenticationServiceClient {
 
     public static CustosAuthenticationService.Client createAuthenticationServiceClient(String serverHost, int serverPort)  throws CustosAuthenticationServiceException {
         try {
diff --git a/custos-client/src/main/java/org/apache/custos/client/profile/service/CustosProfileServiceClientFactory.java b/custos-client/src/main/java/org/apache/custos/client/profile/service/CustosProfileServiceClientFactory.java
new file mode 100644
index 0000000..52724ef
--- /dev/null
+++ b/custos-client/src/main/java/org/apache/custos/client/profile/service/CustosProfileServiceClientFactory.java
@@ -0,0 +1,77 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.custos.client.profile.service;
+
+import org.apache.custos.profile.iam.admin.services.cpi.IamAdminServices;
+import org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
+import org.apache.custos.profile.iam.admin.services.cpi.iam_admin_services_cpiConstants;
+import org.apache.custos.profile.tenant.cpi.TenantProfileService;
+import org.apache.custos.profile.tenant.cpi.exception.TenantProfileServiceException;
+import org.apache.custos.profile.tenant.cpi.profile_tenant_cpiConstants;
+import org.apache.custos.profile.user.cpi.UserProfileService;
+import org.apache.custos.profile.user.cpi.exception.UserProfileServiceException;
+import org.apache.custos.profile.user.cpi.profile_user_cpiConstants;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TMultiplexedProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+/**
+ * Created by goshenoy on 03/08/2017.
+ */
+public class CustosProfileServiceClientFactory {
+    public static UserProfileService.Client createCustosUserProfileServiceClient(String serverHost, int serverPort)  throws UserProfileServiceException {
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, profile_user_cpiConstants.USER_PROFILE_CPI_NAME);
+            return new UserProfileService.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            throw new UserProfileServiceException(e.getMessage());
+        }
+    }
+
+    public static IamAdminServices.Client createCustosIamAdminServiceClient(String serverHost, int serverPort) throws IamAdminServicesException {
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, iam_admin_services_cpiConstants.IAM_ADMIN_SERVICES_CPI_NAME);
+            return new IamAdminServices.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            throw new IamAdminServicesException(e.getMessage());
+        }
+    }
+
+    public static TenantProfileService.Client createCustosTenantProfileServiceClient(String serverHost, int serverPort) throws TenantProfileServiceException {
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, profile_tenant_cpiConstants.TENANT_PROFILE_CPI_NAME);
+            return new TenantProfileService.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            throw new TenantProfileServiceException(e.getMessage());
+        }
+    }
+}
\ No newline at end of file
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/ApplicationSettings.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/ApplicationSettings.java
index 2233478..e494120 100644
--- a/custos-commons/src/main/java/org/apache/custos/commons/utils/ApplicationSettings.java
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/ApplicationSettings.java
@@ -14,6 +14,7 @@ import java.util.*;
 import java.util.regex.Pattern;
 
 public class ApplicationSettings {
+    //private final static Logger logger = LoggerFactory.getLogger(ApplicationSettings.class);
     protected static ApplicationSettings INSTANCE;
     private Exception propertyLoadException;
     public static final String SERVER_PROPERTIES="custos-server.properties";
@@ -21,12 +22,8 @@ public class ApplicationSettings {
     public static String ADDITIONAL_SETTINGS_FILES = "external.settings";
     protected static final String TRUST_STORE_PATH="trust.store";
     protected static final String TRUST_STORE_PASSWORD="trust.store.password";
-    private final static Logger logger = LoggerFactory.getLogger(ApplicationSettings.class);
     protected Properties properties = new Properties();
 
-    // Authentication service constants
-    public static final String AUTHENTICATION_SERVICE_SERVER_PORT = "custos.authentication.server.port";
-    public static final String AUTHENTICATION_SERVICE_SERVER_HOST = "custos.authentication.server.host";
     {
         loadProperties();
     }
@@ -34,11 +31,11 @@ public class ApplicationSettings {
         URL url = getPropertyFileURL();
         try {
             properties.load(url.openStream());
-            logger.info("Settings loaded from "+url.toString());
+            //logger.info("Settings loaded from "+url.toString());
             URL[] externalSettingsFileURLs = getExternalSettingsFileURLs();
             for (URL externalSettings : externalSettingsFileURLs) {
                 mergeSettingsImpl(externalSettings.openStream());
-                logger.info("External settings merged from "+url.toString());
+                //logger.info("External settings merged from "+url.toString());
             }
         } catch (Exception e) {
             propertyLoadException=e;
@@ -57,7 +54,7 @@ public class ApplicationSettings {
             for (String externalSettingFile : externalSettingFiles) {
                 URL externalSettingFileURL = ApplicationSettings.loadFile(externalSettingFile);
                 if (externalSettingFileURL==null){
-                    logger.warn("Could not file external settings file "+externalSettingFile);
+                    //logger.warn("Could not file external settings file "+externalSettingFile);
                 }else{
                     externalSettingsFileURLs.add(externalSettingFileURL);
                 }
@@ -84,7 +81,7 @@ public class ApplicationSettings {
                     return asfile.toURI().toURL();
                 }
             } catch (MalformedURLException e) {
-                logger.error("Error parsing the file from custos.config.dir", custosConfigDir);
+                //logger.error("Error parsing the file from custos.config.dir", custosConfigDir);
             }
         }
 
@@ -117,7 +114,7 @@ public class ApplicationSettings {
                 throw new ApplicationSettingsException(url.getPath(), e);
             }
         }else{
-            logger.warn("Properties cannot be updated to location "+url.toString());
+            //logger.warn("Properties cannot be updated to location "+url.toString());
         }
     }
     private String getSettingImpl(String key, String defaultValue){
@@ -162,10 +159,4 @@ public class ApplicationSettings {
             throw new ApplicationSettingsException(propertyLoadException.getMessage(), propertyLoadException);
         }
     }
-    public static String getTrustStorePath() throws ApplicationSettingsException {
-        return getSetting(TRUST_STORE_PATH);
-    }
-    public static String getTrustStorePassword() throws ApplicationSettingsException {
-        return getSetting(TRUST_STORE_PASSWORD);
-    }
 }
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitConfig.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitConfig.java
new file mode 100644
index 0000000..123541a
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitConfig.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.custos.commons.utils;
+
+public interface DBInitConfig {
+    JDBCConfig getJDBCConfig();
+
+    String getDBInitScriptPrefix();
+
+    String getCheckTableName();
+
+    default void postInit() {
+
+    }
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitializer.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitializer.java
new file mode 100644
index 0000000..6e2038c
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBInitializer.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.custos.commons.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+
+public class DBInitializer {
+    private static final Logger logger = LoggerFactory.getLogger(DBInitializer.class);
+
+    private JDBCConfig jdbcConfig;
+    private String initScriptPrefix;
+    private String checkTableName;
+
+    public DBInitializer(JDBCConfig jdbcConfig, String initScriptPrefix, String checkTableName) {
+        this.jdbcConfig = jdbcConfig;
+        this.initScriptPrefix = initScriptPrefix;
+        this.checkTableName = checkTableName;
+    }
+
+    public static void initializeDB(DBInitConfig dbInitConfig) {
+
+        JDBCConfig jdbcConfig = dbInitConfig.getJDBCConfig();
+        DBInitializer dbInitializer = new DBInitializer(jdbcConfig, dbInitConfig.getDBInitScriptPrefix(), dbInitConfig.getCheckTableName());
+        dbInitializer.initializeDB();
+        dbInitConfig.postInit();
+    }
+
+    public void initializeDB() {
+        // Create connection
+        Connection conn = null;
+        try {
+            DBUtil dbUtil = new DBUtil(jdbcConfig);
+            conn = dbUtil.getConnection();
+            if (!DatabaseCreator.isDatabaseStructureCreated(checkTableName, conn)) {
+                DatabaseCreator.createRegistryDatabase(initScriptPrefix, conn);
+                logger.info("New Database created from " + initScriptPrefix + " !!!");
+            } else {
+                logger.info("Table " + checkTableName + " already exists. Skipping database init script " + initScriptPrefix);
+            }
+
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to initialize database for " + initScriptPrefix, e);
+        } finally {
+            if (conn != null) {
+                DBUtil.cleanup(conn);
+            }
+        }
+
+    }
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/DBUtil.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBUtil.java
new file mode 100644
index 0000000..dede688
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/DBUtil.java
@@ -0,0 +1,306 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.custos.commons.utils;
+import org.apache.commons.dbcp.BasicDataSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.sql.DataSource;
+import java.sql.*;
+import java.util.Properties;
+
+/**
+ * Database lookup. Abstracts out JDBC operations.
+ */
+public class DBUtil {
+
+    private String jdbcUrl;
+    private String databaseUserName;
+    private String databasePassword;
+    private String driverName;
+
+    protected static Logger log = LoggerFactory.getLogger(DBUtil.class);
+
+    private Properties properties;
+
+    public DBUtil(String jdbcUrl, String userName, String password, String driver) throws InstantiationException,
+            IllegalAccessException, ClassNotFoundException {
+
+        this.jdbcUrl = jdbcUrl;
+        this.databaseUserName = userName;
+        this.databasePassword = password;
+        this.driverName = driver;
+
+        init();
+    }
+
+    public DBUtil(JDBCConfig jdbcConfig) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+        this(jdbcConfig.getURL(), jdbcConfig.getUser(), jdbcConfig.getPassword(), jdbcConfig.getDriver());
+    }
+
+    /**
+     * Initializes and load driver. Must be called this before calling anyother method.
+     * 
+     * @throws ClassNotFoundException
+     *             If DB driver is not found.
+     * @throws InstantiationException
+     *             If unable to create driver class.
+     * @throws IllegalAccessException
+     *             If security does not allow users to instantiate driver object.
+     */
+    private void init() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+        properties = new Properties();
+
+        properties.put("user", databaseUserName);
+        properties.put("password", databasePassword);
+        properties.put("characterEncoding", "ISO-8859-1");
+        properties.put("useUnicode", "true");
+
+        loadDriver();
+    }
+
+    /**
+     * Generic method to query values in the database.
+     * 
+     * @param tableName
+     *            Table name to query
+     * @param selectColumn
+     *            The column selecting
+     * @param whereValue
+     *            The condition query
+     * @return The value appropriate to the query.
+     * @throws SQLException
+     *             If an error occurred while querying
+     */
+    public String getMatchingColumnValue(String tableName, String selectColumn, String whereValue) throws SQLException {
+        return getMatchingColumnValue(tableName, selectColumn, selectColumn, whereValue);
+    }
+
+    /**
+     * Generic method to query values in the database.
+     * 
+     * @param tableName
+     *            Table name to query
+     * @param selectColumn
+     *            The column selecting
+     * @param whereColumn
+     *            The column which condition should apply
+     * @param whereValue
+     *            The condition query
+     * @return The value appropriate to the query.
+     * @throws SQLException
+     *             If an error occurred while querying
+     */
+    public String getMatchingColumnValue(String tableName, String selectColumn, String whereColumn, String whereValue)
+            throws SQLException {
+
+        StringBuilder stringBuilder = new StringBuilder();
+
+        stringBuilder.append("SELECT ").append(selectColumn).append(" FROM ").append(tableName).append(" WHERE ")
+                .append(whereColumn).append(" = ?");
+
+        String sql = stringBuilder.toString();
+
+        Connection connection = getConnection();
+
+        PreparedStatement ps = connection.prepareStatement(sql);
+        ResultSet rs = null;
+
+        try {
+            ps.setString(1, whereValue);
+            rs = ps.executeQuery();
+
+            if (rs.next()) {
+                return rs.getString(1);
+            }
+
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+
+                ps.close();
+                connection.close();
+
+            } catch (Exception ignore) {
+                log.error("An error occurred while closing database connections ", ignore);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Create table utility method.
+     * 
+     * @param sql
+     *            SQL to be executed.
+     * @throws SQLException
+     *             If an error occurred while creating the table.
+     */
+    public void executeSQL(String sql) throws SQLException {
+
+        Connection connection = getConnection();
+
+        PreparedStatement ps = connection.prepareStatement(sql);
+
+        try {
+            ps.executeUpdate();
+            connection.commit();
+        } finally {
+            try {
+                if (ps != null) {
+                    ps.close();
+                }
+
+                connection.close();
+
+            } catch (Exception ignore) {
+                log.error("An error occurred while closing database connections ", ignore);
+            }
+        }
+
+    }
+
+    private void loadDriver() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
+        Class.forName(driverName).newInstance();
+    }
+
+    /**
+     * Gets a new DBCP data source.
+     * 
+     * @return A new data source.
+     */
+    public DataSource getDataSource() {
+        BasicDataSource ds = new BasicDataSource();
+        ds.setDriverClassName(this.driverName);
+        ds.setUsername(this.databaseUserName);
+        ds.setPassword(this.databasePassword);
+        ds.setUrl(this.jdbcUrl);
+
+        return ds;
+    }
+
+    /**
+     * Creates a new JDBC connections based on provided DBCP properties.
+     * 
+     * @return A new DB connection.
+     * @throws SQLException
+     *             If an error occurred while creating the connection.
+     */
+    public Connection getConnection() throws SQLException {
+        Connection connection = DriverManager.getConnection(jdbcUrl, properties);
+        connection.setAutoCommit(false);
+        return connection;
+    }
+
+    /**
+     * Utility method to close statements and connections.
+     * 
+     * @param preparedStatement
+     *            The prepared statement to close.
+     * @param connection
+     *            The connection to close.
+     */
+    public static void cleanup(PreparedStatement preparedStatement, Connection connection) {
+        if (preparedStatement != null) {
+            try {
+                preparedStatement.close();
+            } catch (SQLException e) {
+                log.error("Error closing prepared statement.", e);
+            }
+        }
+        cleanup(connection);
+    }
+
+    /**
+     * Utility method to close statements and connections.
+     *
+     * @param preparedStatement
+     *            The prepared statement to close.
+     */
+    public static void cleanup(PreparedStatement preparedStatement) {
+        if (preparedStatement != null) {
+            try {
+                preparedStatement.close();
+            } catch (SQLException e) {
+                log.error("Error closing prepared statement.", e);
+            }
+        }
+    }
+
+    /**
+     * Utility method to close statements and connections.
+     *
+     * @param preparedStatement
+     *            The prepared statement to close.
+     */
+    public static void cleanup(PreparedStatement preparedStatement, ResultSet resultSet) {
+        if (resultSet != null) {
+            try {
+                resultSet.close();
+            } catch (SQLException e) {
+                log.error("Error closing prepared statement.", e);
+            }
+        }
+
+        cleanup(preparedStatement);
+    }
+
+    /**
+     * Cleanup the connection.
+     * @param connection The connection to close.
+     */
+    public static void cleanup(Connection connection) {
+        if (connection != null) {
+            try {
+                if (connection.isClosed()) {
+                    return;
+                }
+                if (!connection.getAutoCommit()) {
+                    connection.rollback();
+                }
+                connection.close();
+            } catch (SQLException e) {
+                throw new RuntimeException("Error closing connection", e);
+            }
+        }
+    }
+
+    /**
+     * Mainly useful for tests.
+     * 
+     * @param tableName
+     *            The table name.
+     * @param connection
+     *            The connection to be used.
+     */
+    public static void truncate(String tableName, Connection connection) throws SQLException {
+
+        String sql = "delete from " + tableName;
+
+        PreparedStatement preparedStatement = connection.prepareStatement(sql);
+        preparedStatement.executeUpdate();
+
+        connection.commit();
+
+    }
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/DatabaseCreator.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/DatabaseCreator.java
new file mode 100644
index 0000000..5340bf4
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/DatabaseCreator.java
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.custos.commons.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.sql.*;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This class creates the database tables required for airavata with default configuration this
+ * class creates derby database in server mode. User can specify required database in appropriate
+ * properties files.
+ */
+public class DatabaseCreator {
+    private final static Logger logger = LoggerFactory.getLogger(DatabaseCreator.class);
+
+    public enum DatabaseType {
+        derby("(?i).*derby.*"), mysql("(?i).*(mysql|mariadb).*"), other("");
+
+        private String pattern;
+
+        private DatabaseType(String matchingPattern) {
+            this.pattern = matchingPattern;
+        }
+
+        public String getMatchingPattern() {
+            return this.pattern;
+        }
+    }
+
+    private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
+
+    private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
+    private static final String delimiter = ";";
+
+    /**
+     * Creates database
+     *
+     * @throws Exception
+     */
+    public static void createRegistryDatabase(String prefix, Connection conn) throws Exception {
+        createDatabase(prefix, conn);
+    }
+
+
+
+    /**
+     * Checks whether database tables are created by using select * on given table name
+     *
+     * @param tableName
+     *            Table which should be existed
+     * @return <code>true</core> if checkSQL is success, else <code>false</code> .
+     */
+    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+        try {
+
+            log.debug("Running a query to test the database tables existence.");
+
+            // check whether the tables are already created with a query
+            Statement statement = null;
+            try {
+                statement = conn.createStatement();
+                ResultSet rs = statement.executeQuery("select * from " + tableName);
+                if (rs != null) {
+                    rs.close();
+                }
+            } finally {
+                try {
+                    if (statement != null) {
+                        statement.close();
+                    }
+                } catch (SQLException e) {
+                    return false;
+                }
+            }
+        } catch (SQLException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * executes given sql
+     *
+     * @param sql
+     * @throws Exception
+     */
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        // Check and ignore empty statements
+        if ("".equals(sql.trim())) {
+            return;
+        }
+
+        Statement statement = null;
+        try {
+            log.debug("SQL : " + sql);
+
+            boolean ret;
+            int updateCount = 0, updateCountTotal = 0;
+            statement = conn.createStatement();
+            ret = statement.execute(sql);
+            updateCount = statement.getUpdateCount();
+            do {
+                if (!ret) {
+                    if (updateCount != -1) {
+                        updateCountTotal += updateCount;
+                    }
+                }
+                ret = statement.getMoreResults();
+                if (ret) {
+                    updateCount = statement.getUpdateCount();
+                }
+            } while (ret);
+
+            log.debug(sql + " : " + updateCountTotal + " rows affected");
+
+            SQLWarning warning = conn.getWarnings();
+            while (warning != null) {
+                log.info(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                // eliminating the table already exception for the derby
+                // database
+                log.info("Table Already Exists", e);
+            } else {
+                throw new Exception("Error occurred while executing : " + sql, e);
+            }
+        } finally {
+            if (statement != null) {
+                try {
+                    statement.close();
+                } catch (SQLException e) {
+                    log.error("Error occurred while closing result set.", e);
+                }
+            }
+        }
+    }
+
+    /**
+     * computes relatational database type using database name
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(Connection conn) throws Exception {
+        try {
+            if (conn != null && (!conn.isClosed())) {
+                DatabaseMetaData metaData = conn.getMetaData();
+                String databaseProductName = metaData.getDatabaseProductName();
+                return checkType(databaseProductName);
+            }
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavata database." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+        return DatabaseType.other;
+    }
+
+    /**
+     * Overloaded method with String input
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
+        return checkType(dbUrl);
+    }
+
+    private static DatabaseType checkType(String text) throws Exception {
+        try {
+            if (text != null) {
+                for (DatabaseType type : supportedDatabase) {
+                    if (text.matches(type.getMatchingPattern()))
+                        return type;
+                }
+            }
+            String msg = "Unsupported database: " + text
+                    + ". Database will not be created automatically by the Airavata. "
+                    + "Please create the database using appropriate database scripts for " + "the database.";
+            throw new Exception(msg);
+
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavatadatabase." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+    }
+
+    /**
+     * Get scripts location which is prefix + "-" + databaseType + ".sql"
+     *
+     * @param prefix
+     * @param databaseType
+     * @return script location
+     */
+    private static String getScriptLocation(String prefix, DatabaseType databaseType) {
+        String scriptName = prefix + "-" + databaseType + ".sql";
+        log.debug("Loading database script from :" + scriptName);
+        return  scriptName;
+    }
+
+    private static void createDatabase(String prefix, Connection conn) throws Exception {
+        Statement statement = null;
+        try {
+            conn.setAutoCommit(false);
+            statement = conn.createStatement();
+            executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
+            conn.commit();
+            log.debug("Tables are created successfully.");
+        } catch (SQLException e) {
+            String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
+            log.error(msg, e);
+            conn.rollback();
+            throw new Exception(msg, e);
+        } finally {
+            conn.setAutoCommit(true);
+            try {
+                if (statement != null) {
+                    statement.close();
+                }
+            } catch (SQLException e) {
+                log.error("Failed to close statement.", e);
+            }
+        }
+    }
+
+    private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+
+        try {
+            InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
+            if(is == null) {
+                logger.info("Script file not found at " + dbscriptName + ". Uses default database script file");
+                DatabaseType databaseType = DatabaseCreator.getDatabaseType(conn);
+                is = DatabaseCreator.class.getClassLoader().getResourceAsStream(
+                        getDBScriptFileName(databaseType, dbscriptName)
+                );
+            }
+            reader = new BufferedReader(new InputStreamReader(is));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("//")) {
+                    continue;
+                }
+                if (line.startsWith("--")) {
+                    continue;
+                }
+                StringTokenizer st = new StringTokenizer(line);
+                if (st.hasMoreTokens()) {
+                    String token = st.nextToken();
+                    if ("REM".equalsIgnoreCase(token)) {
+                        continue;
+                    }
+                }
+                sql.append(" ").append(line);
+
+                // SQL defines "--" as a comment to EOL
+                // and in Oracle it may contain a hint
+                // so we cannot just remove it, instead we must end it
+                if (line.indexOf("--") >= 0) {
+                    sql.append("\n");
+                }
+                if ((checkStringBufferEndsWith(sql, delimiter))) {
+                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+                    sql.replace(0, sql.length(), "");
+                }
+            }
+            // Catch any statements not followed by ;
+            if (sql.length() > 0) {
+                executeSQL(sql.toString(), conn);
+            }
+        } catch (IOException e) {
+            log.error("Error occurred while executing SQL script for creating Airavata database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
+
+        } finally {
+            if (reader != null) {
+                reader.close();
+            }
+        }
+    }
+
+    /**
+     * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
+     * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
+     * massive memory allocation and copying. See
+     *
+     * @param buffer
+     *            the buffer to perform the check on
+     * @param suffix
+     *            the suffix
+     * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
+     *         sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
+     *         be <code>true</code> if the argument is the empty string.
+     */
+    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+        if (suffix.length() > buffer.length()) {
+            return false;
+        }
+        // this loop is done on purpose to avoid memory allocation performance
+        // problems on various JDKs
+        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+        // implementation is ok though does allocation/copying
+        // StringBuffer.toString().endsWith() does massive memory
+        // allocation/copying on JDK 1.5
+        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+        int endIndex = suffix.length() - 1;
+        int bufferIndex = buffer.length() - 1;
+        while (endIndex >= 0) {
+            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+                return false;
+            }
+            bufferIndex--;
+            endIndex--;
+        }
+        return true;
+    }
+
+    /**
+     * Method will accept a filepath containing a database script (eg: /user/database_scripts/expcatalog.sql)
+     *  and return only the filename of the database script (eg: expcatalog.sql).
+     * @param databaseType
+     * @param scriptFilePath
+     * @return
+     */
+    private static String getDBScriptFileName(DatabaseType databaseType, String scriptFilePath) {
+        // pattern: {dir_name}/{scriptfile_name}-{dbtype}.sql".
+        // Eg: database_scripts/expcatalog-derby.sql
+        final String scriptFilePattern = "(\\w*)(-" + databaseType.toString() + ".sql)";
+        final Pattern pattern = Pattern.compile(scriptFilePattern);
+        final Matcher matcher = pattern.matcher(scriptFilePath);
+        String dbScriptFileName = null;
+        // find a match
+        if (matcher.find()) {
+            dbScriptFileName = matcher.group();
+        }
+        return dbScriptFileName;
+    }
+
+//    public static void main(String[] args) throws Exception {
+//        System.out.println(DatabaseCreator.getDBScriptFileName(DatabaseType.derby, "db/db/expcatalog-derby.sql"));
+//        System.out.println(DatabaseCreator.getDBScriptFileName(DatabaseType.mysql, "/expcatalog-mysql.sql"));
+//    }
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/JDBCConfig.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/JDBCConfig.java
new file mode 100644
index 0000000..5cdb0ec
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/JDBCConfig.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.custos.commons.utils;
+
+public interface JDBCConfig {
+    String getURL();
+    String getDriver();
+    String getUser();
+    String getPassword();
+    String getValidationQuery();
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/JPAUtils.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/JPAUtils.java
new file mode 100644
index 0000000..9e02ce7
--- /dev/null
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/JPAUtils.java
@@ -0,0 +1,67 @@
+package org.apache.custos.commons.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * JPAUtils
+ */
+public class JPAUtils {
+
+    private final static Logger logger = LoggerFactory.getLogger(JPAUtils.class);
+    private final static Map<String, String> DEFAULT_ENTITY_MANAGER_FACTORY_PROPERTIES;
+    static {
+        Map<String, String> properties = new HashMap<String, String>();
+        properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
+        properties.put("openjpa.DynamicEnhancementAgent", "true");
+        properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
+        properties.put("openjpa.RemoteCommitProvider", "sjvm");
+        properties.put("openjpa.Log", "DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
+        properties.put("openjpa.jdbc.SynchronizeMappings", "validate");
+        properties.put("openjpa.jdbc.QuerySQLCache", "false");
+        properties.put("openjpa.DetachState", "all");
+        properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72,"
+                + " PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
+        DEFAULT_ENTITY_MANAGER_FACTORY_PROPERTIES = properties;
+    }
+
+    /**
+     * Create an {@link EntityManagerFactory} with the default settings.
+     * @param persistenceUnitName
+     * @param jdbcConfig
+     * @return {@link EntityManagerFactory}
+     */
+    public static EntityManagerFactory getEntityManagerFactory(String persistenceUnitName, JDBCConfig jdbcConfig){
+
+        return getEntityManagerFactory(persistenceUnitName, jdbcConfig, Collections.emptyMap());
+    }
+
+    /**
+     * Create an {@link EntityManagerFactory}. The given properties will override the default properties.
+     * @param persistenceUnitName
+     * @param jdbcConfig
+     * @param properties
+     * @return {@link EntityManagerFactory}
+     */
+    public static EntityManagerFactory getEntityManagerFactory(String persistenceUnitName, JDBCConfig jdbcConfig, Map<String, String> properties) {
+
+        Map<String, String> finalProperties = new HashMap<>(DEFAULT_ENTITY_MANAGER_FACTORY_PROPERTIES);
+        finalProperties.putAll(createConnectionProperties(jdbcConfig));
+        finalProperties.putAll(properties);
+        return Persistence.createEntityManagerFactory(persistenceUnitName, finalProperties);
+    }
+
+    private static Map<String, String> createConnectionProperties(JDBCConfig jdbcConfig) {
+        String connectionProperties = "DriverClassName=" + jdbcConfig.getDriver() + "," + "Url=" + jdbcConfig.getURL()
+                + "?autoReconnect=true," + "Username=" + jdbcConfig.getUser() + "," + "Password="
+                + jdbcConfig.getPassword() + ",validationQuery=" + jdbcConfig.getValidationQuery();
+        logger.debug("Connection properties={}", connectionProperties);
+        return Collections.singletonMap("openjpa.ConnectionProperties", connectionProperties);
+    }
+}
diff --git a/custos-commons/src/main/java/org/apache/custos/commons/utils/ServerSettings.java b/custos-commons/src/main/java/org/apache/custos/commons/utils/ServerSettings.java
index 642f37e..7397d51 100644
--- a/custos-commons/src/main/java/org/apache/custos/commons/utils/ServerSettings.java
+++ b/custos-commons/src/main/java/org/apache/custos/commons/utils/ServerSettings.java
@@ -31,6 +31,13 @@ public class ServerSettings extends ApplicationSettings {
     public static final String IAM_SERVER_SUPER_ADMIN_USERNAME = "iam.server.super.admin.username";
     public static final String IAM_SERVER_SUPER_ADMIN_PASSWORD = "iam.server.super.admin.password";
 
+    // Authentication service constants
+    public static final String AUTHENTICATION_SERVICE_SERVER_PORT = "custos.authentication.server.port";
+    public static final String AUTHENTICATION_SERVICE_SERVER_HOST = "custos.authentication.server.host";
+
+    // Profile Service Constants
+    public static final String PROFILE_SERVICE_SERVER_HOST = "profile.service.server.host";
+    public static final String PROFILE_SERVICE_SERVER_PORT = "profile.service.server.port";
 
     public static int getCacheSize() throws ApplicationSettingsException {
         return Integer.valueOf(getSetting(Constants.IN_MEMORY_CACHE_SIZE));
@@ -43,22 +50,43 @@ public class ServerSettings extends ApplicationSettings {
         return getSetting(Constants.SECURITY_MANAGER_CLASS);
     }
     public static String getRemoteIDPServiceUrl() throws ApplicationSettingsException {
-        return getSetting(ServerSettings.IAM_SERVER_URL);
+        return getSetting(IAM_SERVER_URL);
     }
     public static boolean isAuthzCacheEnabled() throws ApplicationSettingsException {
         return Boolean.valueOf(getSetting(Constants.AUTHZ_CACHE_ENABLED));
     }
     public static  String getAuthenticationServerPort() throws ApplicationSettingsException {
-        return getSetting(ServerSettings.AUTHENTICATION_SERVICE_SERVER_PORT);
+        return getSetting(AUTHENTICATION_SERVICE_SERVER_PORT);
     }
     public static  String getAuthenticationServerHost() throws ApplicationSettingsException {
-        return getSetting(ServerSettings.AUTHENTICATION_SERVICE_SERVER_HOST);
+        return getSetting(AUTHENTICATION_SERVICE_SERVER_HOST);
     }
     public static String getKeyStorePath() throws ApplicationSettingsException {
         return getSetting(Constants.KEYSTORE_PATH);
     }
-
     public static String getKeyStorePassword() throws ApplicationSettingsException {
         return getSetting(Constants.KEYSTORE_PASSWORD);
     }
+    public static String getIamServerUrl() throws ApplicationSettingsException {
+        return getSetting(ServerSettings.IAM_SERVER_URL);
+    }
+    public static String getTrustStorePath() throws ApplicationSettingsException {
+        return getSetting(TRUST_STORE_PATH);
+    }
+    public static String getTrustStorePassword() throws ApplicationSettingsException {
+        return getSetting(TRUST_STORE_PASSWORD);
+    }
+    public static String getIamServerSuperAdminUsername() throws ApplicationSettingsException{
+        return getSetting(IAM_SERVER_SUPER_ADMIN_USERNAME);
+    }
+    public static String getIamServerSuperAdminPassword() throws ApplicationSettingsException{
+        return getSetting(IAM_SERVER_SUPER_ADMIN_PASSWORD);
+    }
+    public static String getProfileServiceServerHost() throws ApplicationSettingsException {
+        return getSetting(ServerSettings.PROFILE_SERVICE_SERVER_HOST);
+    }
+    public static String getProfileServiceServerPort() throws ApplicationSettingsException {
+        return getSetting(ServerSettings.PROFILE_SERVICE_SERVER_PORT);
+    }
+
 }
diff --git a/custos-connectors/pom.xml b/custos-connectors/pom.xml
index 7b6ae79..f3ab17d 100644
--- a/custos-connectors/pom.xml
+++ b/custos-connectors/pom.xml
@@ -21,6 +21,11 @@
             <version>1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.custos</groupId>
+            <artifactId>profile-service-model</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
             <groupId>com.google.inject</groupId>
             <artifactId>guice</artifactId>
             <version>4.0</version>
@@ -31,10 +36,45 @@
             <version>20131018</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.custos</groupId>
-            <artifactId>profile-service-stubs</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>compile</scope>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.2</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+            <version>2.0.1</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-client -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-client</artifactId>
+            <version>3.0.14.Final</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/resteasy-jackson2-provider -->
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jackson2-provider</artifactId>
+            <version>3.0.14.Final</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.keycloak/keycloak-admin-client -->
+        <dependency>
+            <groupId>org.keycloak</groupId>
+            <artifactId>keycloak-admin-client</artifactId>
+            <version>2.5.5.Final</version>
         </dependency>
     </dependencies>
 
diff --git a/custos-connectors/src/main/java/org.apache.custos.security/manager/KeyCloakSecurityManager.java b/custos-connectors/src/main/java/org.apache.custos.security/manager/KeyCloakSecurityManager.java
index 6665c3f..3550f4f 100644
--- a/custos-connectors/src/main/java/org.apache.custos.security/manager/KeyCloakSecurityManager.java
+++ b/custos-connectors/src/main/java/org.apache.custos.security/manager/KeyCloakSecurityManager.java
@@ -26,7 +26,6 @@ import org.apache.custos.commons.model.security.AuthzToken;
 import org.apache.custos.commons.model.security.UserInfo;
 import org.apache.custos.commons.utils.Constants;
 import org.apache.custos.commons.utils.ServerSettings;
-import org.apache.custos.profile.tenant.cpi.TenantProfileService;
 import org.apache.custos.security.authzcache.*;
 import org.apache.custos.security.utils.TrustStoreManager;
 import org.apache.http.Consts;
@@ -55,7 +54,6 @@ import java.util.List;
 
 public class KeyCloakSecurityManager implements CustosSecurityManager {
     private final static Logger logger = LoggerFactory.getLogger(KeyCloakSecurityManager.class);
-    private TenantProfileService.Client tenantProfileClient = null;
     public KeyCloakSecurityManager() throws CustosSecurityException {
         initializeSecurityInfra();
     }
diff --git a/ide-integration/pom.xml b/custos-profile-service/iam-admin-services/pom.xml
similarity index 75%
copy from ide-integration/pom.xml
copy to custos-profile-service/iam-admin-services/pom.xml
index 2b945e5..e5136ae 100644
--- a/ide-integration/pom.xml
+++ b/custos-profile-service/iam-admin-services/pom.xml
@@ -3,27 +3,26 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
-        <artifactId>custos</artifactId>
+        <artifactId>custos-profile-service</artifactId>
         <groupId>org.apache.custos</groupId>
         <version>1.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>ide-integration</artifactId>
+    <artifactId>iam-admin-services</artifactId>
     <dependencies>
         <dependency>
             <groupId>org.apache.custos</groupId>
-            <artifactId>profile-service-server</artifactId>
+            <artifactId>profile-service-model</artifactId>
             <version>1.0-SNAPSHOT</version>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.custos</groupId>
             <artifactId>custos-authentication</artifactId>
             <version>1.0-SNAPSHOT</version>
-            <scope>compile</scope>
         </dependency>
     </dependencies>
-
-
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
 </project>
\ No newline at end of file
diff --git a/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/client/CustosIamAdminServiceClient.java b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/client/CustosIamAdminServiceClient.java
new file mode 100644
index 0000000..c6594f4
--- /dev/null
+++ b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/client/CustosIamAdminServiceClient.java
@@ -0,0 +1,48 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.custos.profile.iam.admin.services.client;
+
+import org.apache.custos.profile.iam.admin.services.cpi.IamAdminServices;
+import org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
+import org.apache.custos.profile.iam.admin.services.cpi.iam_admin_services_cpiConstants;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TMultiplexedProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+/**
+ * Created by goshenoy on 03/08/2017.
+ */
+public class CustosIamAdminServiceClient {
+
+    public static IamAdminServices.Client createCustosIamAdminServiceClient(String serverHost, int serverPort) throws IamAdminServicesException {
+        try {
+            TTransport transport = new TSocket(serverHost, serverPort);
+            transport.open();
+            TProtocol protocol = new TBinaryProtocol(transport);
+            TMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(protocol, iam_admin_services_cpiConstants.IAM_ADMIN_SERVICES_CPI_NAME);
+            return new IamAdminServices.Client(multiplexedProtocol);
+        } catch (TTransportException e) {
+            throw new IamAdminServicesException(e.getMessage());
+        }
+    }
+}
\ No newline at end of file
diff --git a/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementInterface.java b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementInterface.java
new file mode 100644
index 0000000..fdd18de
--- /dev/null
+++ b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementInterface.java
@@ -0,0 +1,206 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.custos.profile.iam.admin.services.core;
+
+import org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
+import org.apache.custos.profile.model.tenant.PasswordCredential;
+import org.apache.custos.profile.model.user.UserProfile;
+import org.apache.custos.profile.model.workspace.Gateway;
+
+import java.util.List;
+
+public interface TenantManagementInterface {
+
+    /**
+     * Method to add Identity server tenant for Custos gateway creation.
+     *
+     * @param isSuperAdminPasswordCreds identity server super admin credentials
+     * @param gatewayDetails gateway details from workspace catalog
+     * @return Gateway object.
+     */
+    Gateway addTenant(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails) throws IamAdminServicesException;
+
+    /**
+     * Method to add tenant Admin account in Identity Server.
+     *
+     * @param isSuperAdminPasswordCreds identity server super admin credentials
+     * @param gatewayDetails gateway details from workspace catalog
+     * @param gatewayAdminPassword password to use when creating tenant admin account
+     * @return Gateway object.
+     */
+    boolean createTenantAdminAccount(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails, String gatewayAdminPassword) throws IamAdminServicesException;
+
+    /**
+     * Method to configure application client in Identity Server
+     *
+     * @param isSuperAdminPasswordCreds identity server super admin credentials
+     * @param gatewayDetails gateway details from workspace catalog
+     * @return Gateway object.
+     */
+    Gateway configureClient(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails) throws IamAdminServicesException;
+
+    /**
+     * Check if username is available to be used for creating a new user account.
+     * @param accessToken needs to have access to searching across users by username
+     * @param tenantId
+     * @param username
+     * @return
+     */
+    boolean isUsernameAvailable(String accessToken, String tenantId, String username) throws IamAdminServicesException;
+
+    /**
+     * Method to create user in Identity Server
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @param emailAddress
+     * @param firstName
+     * @param lastName
+     * @param newPassword
+     * @return true if user created
+     * @throws IamAdminServicesException
+     */
+    boolean createUser(String accessToken, String tenantId, String username, String emailAddress, String firstName, String lastName, String newPassword) throws IamAdminServicesException;
+
+    /**
+     * Method to enable user in Identity Server
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @return boolean.
+     */
+    boolean enableUserAccount(String accessToken, String tenantId, String username) throws IamAdminServicesException;
+
+    /**
+     * Method to check if user is enabled in Identity Server
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @return boolean.
+     */
+    boolean isUserAccountEnabled(String accessToken, String tenantId, String username) throws IamAdminServicesException;
+
+    /**
+     * Return whether user exists with username.
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @return
+     */
+    boolean isUserExist(String accessToken, String tenantId, String username) throws IamAdminServicesException;
+
+    /**
+     * Get user profile information from Identity Server
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @return
+     */
+    UserProfile getUser(String accessToken, String tenantId, String username) throws IamAdminServicesException;
+
+    /**
+     * Get a paginated list of user profiles from Identity Server
+     * 
+     * @param accessToken
+     * @param tenantId
+     * @param offset
+     * @param limit
+     * @param search String - optional, if specified used to search user profiles
+     * @return
+     * @throws IamAdminServicesException
+     */
+    List<UserProfile> getUsers(String accessToken, String tenantId, int offset, int limit, String search) throws IamAdminServicesException;
+
+    /**
+     * Method to reset user password in Identity Server
+     *
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @param newPassword
+     * @return boolean
+     */
+    boolean resetUserPassword(String accessToken, String tenantId, String username, String newPassword) throws IamAdminServicesException;
+
+    /**
+     * Method to find user in Identity Server
+     *
+     * @param accessToken
+     * @param tenantId required
+     * @param email required
+     * @param username can be null
+     * @return Gateway object.
+     */
+    List<UserProfile> findUser(String accessToken, String tenantId, String email, String username) throws IamAdminServicesException;
+
+    /**
+     * Update the user's profile in the Identity Server
+     * @param accessToken
+     * @param tenantId
+     * @param username
+     * @param userDetails
+     */
+    void updateUserProfile(String accessToken, String tenantId, String username, UserProfile userDetails) throws IamAdminServicesException;
+
+    /**
+     * Add the given role to the user.
+     *
+     * @param realmAdminCreds
+     * @param tenantId
+     * @param username
+     * @param roleName
+     * @return
+     * @throws IamAdminServicesException
+     */
+    @Deprecated
+    boolean addRoleToUser(PasswordCredential realmAdminCreds, String tenantId, String username, String roleName) throws IamAdminServicesException;
+
+    /**
+     * Remove the given role from the user.
+     *
+     * @param realmAdminCreds
+     * @param tenantId
+     * @param username
+     * @param roleName
+     * @return
+     * @throws IamAdminServicesException
+     */
+    @Deprecated
+    boolean removeRoleFromUser(PasswordCredential realmAdminCreds, String tenantId, String username, String roleName) throws IamAdminServicesException;
+
+    /**
+     * Get all users having the given role.
+     *
+     * @param realmAdminCreds
+     * @param tenantId
+     * @param roleName
+     * @return
+     * @throws IamAdminServicesException
+     */
+    @Deprecated
+    List<UserProfile> getUsersWithRole(PasswordCredential realmAdminCreds, String tenantId, String roleName) throws IamAdminServicesException;
+}
diff --git a/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementKeycloakImpl.java b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementKeycloakImpl.java
new file mode 100644
index 0000000..efc82c2
--- /dev/null
+++ b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/core/TenantManagementKeycloakImpl.java
@@ -0,0 +1,815 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.custos.profile.iam.admin.services.core;
+
+import org.apache.custos.commons.exceptions.ApplicationSettingsException;
+import org.apache.custos.commons.utils.SecurityUtil;
+import org.apache.custos.commons.utils.ServerSettings;
+import org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
+import org.apache.custos.profile.model.tenant.PasswordCredential;
+import org.apache.custos.profile.model.user.Status;
+import org.apache.custos.profile.model.user.UserProfile;
+import org.apache.custos.profile.model.workspace.Gateway;
+import org.jboss.resteasy.client.jaxrs.ResteasyClient;
+import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
+import org.keycloak.admin.client.Keycloak;
+import org.keycloak.admin.client.KeycloakBuilder;
+import org.keycloak.admin.client.resource.RoleResource;
+import org.keycloak.admin.client.resource.UserResource;
+import org.keycloak.representations.idm.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.KeyStore;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class TenantManagementKeycloakImpl implements TenantManagementInterface {
+
+    private final static Logger logger = LoggerFactory.getLogger(TenantManagementKeycloakImpl.class);
+
+    private String superAdminRealmId = "master";
+
+    private static Keycloak getClient(String adminUrl, String realm, PasswordCredential AdminPasswordCreds) {
+
+        ResteasyClient resteasyClient = new ResteasyClientBuilder()
+                .connectionPoolSize(10)
+                .trustStore(loadKeyStore())
+                .build();
+        return KeycloakBuilder.builder()
+                .serverUrl(adminUrl)
+                .realm(realm)
+                .username(AdminPasswordCreds.getLoginUserName())
+                .password(AdminPasswordCreds.getPassword())
+                .clientId("admin-cli")
+                .resteasyClient(resteasyClient)
+                .build();
+    }
+
+    private static Keycloak getClient(String adminUrl, String realm, String accessToken) {
+
+        ResteasyClient resteasyClient = new ResteasyClientBuilder()
+                .connectionPoolSize(10)
+                .trustStore(loadKeyStore())
+                .build();
+        return KeycloakBuilder.builder()
+                .serverUrl(adminUrl)
+                .realm(realm)
+                .authorization(accessToken)
+                .resteasyClient(resteasyClient)
+                .build();
+    }
+
+    private static KeyStore loadKeyStore() {
+
+        InputStream is = null;
+        try {
+
+            String trustStorePath =  ServerSettings.getTrustStorePath();
+            File trustStoreFile = new File(trustStorePath);
+
+            if (trustStoreFile.exists()) {
+                logger.debug("Loading trust store file from path " + trustStorePath);
+                is = new FileInputStream(trustStorePath);
+            } else {
+                logger.debug("Trying to load trust store file form class path " + trustStorePath);
+                is = SecurityUtil.class.getClassLoader().getResourceAsStream(trustStorePath);
+                if (is != null) {
+                    logger.debug("Trust store file was loaded form class path " + trustStorePath);
+                }
+            }
+
+            if (is == null) {
+                throw new RuntimeException("Could not find a trust store file in path " + trustStorePath);
+            }
+
+            KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
+            ks.load(is, ServerSettings.getTrustStorePassword().toCharArray());
+            return ks;
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to load trust store KeyStore instance", e);
+        } finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    logger.error("Failed to close trust store FileInputStream", e);
+                }
+            }
+        }
+    }
+
+    @Override
+    public Gateway addTenant(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails) throws IamAdminServicesException {
+        Keycloak client = null;
+        try {
+            // get client
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), this.superAdminRealmId, isSuperAdminPasswordCreds);
+            // create realm
+            RealmRepresentation newRealmDetails = new RealmRepresentation();
+            newRealmDetails.setEnabled(true);
+            newRealmDetails.setId(gatewayDetails.getGatewayId());
+            newRealmDetails.setDisplayName(gatewayDetails.getGatewayName());
+            newRealmDetails.setRealm(gatewayDetails.getGatewayId());
+            // Following two settings allow duplicate email addresses
+            newRealmDetails.setLoginWithEmailAllowed(false);
+            newRealmDetails.setDuplicateEmailsAllowed(true);
+            // Default access token lifespan to 30 minutes, SSO session idle to 60 minutes
+            newRealmDetails.setAccessTokenLifespan(1800);
+            newRealmDetails.setSsoSessionIdleTimeout(3600);
+            RealmRepresentation realmWithRoles = TenantManagementKeycloakImpl.createDefaultRoles(newRealmDetails);
+            client.realms().create(realmWithRoles);
+            return gatewayDetails;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting Iam server Url from property file, reason: " + ex.getMessage());
+            throw exception;
+        } catch (Exception ex){
+            logger.error("Error creating Realm in Keycloak Server, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error creating Realm in Keycloak Server, reason: " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    public static RealmRepresentation createDefaultRoles(RealmRepresentation realmDetails){
+        List<RoleRepresentation> defaultRoles = new ArrayList<RoleRepresentation>();
+        RoleRepresentation adminRole = new RoleRepresentation();
+        adminRole.setName("admin");
+        adminRole.setDescription("Admin role for PGA users");
+        defaultRoles.add(adminRole);
+        RoleRepresentation adminReadOnlyRole = new RoleRepresentation();
+        adminReadOnlyRole.setName("admin-read-only");
+        adminReadOnlyRole.setDescription("Read only role for PGA Admin users");
+        defaultRoles.add(adminReadOnlyRole);
+        RoleRepresentation gatewayUserRole = new RoleRepresentation();
+        gatewayUserRole.setName("gateway-user");
+        gatewayUserRole.setDescription("default role for PGA users");
+        defaultRoles.add(gatewayUserRole);
+        RoleRepresentation pendingUserRole = new RoleRepresentation();
+        pendingUserRole.setName("user-pending");
+        pendingUserRole.setDescription("role for newly registered PGA users");
+        defaultRoles.add(pendingUserRole);
+        RoleRepresentation gatewayProviderRole = new RoleRepresentation();
+        gatewayProviderRole.setName("gateway-provider");
+        gatewayProviderRole.setDescription("role for gateway providers in the super-admin PGA");
+        defaultRoles.add(gatewayProviderRole);
+        RolesRepresentation rolesRepresentation = new RolesRepresentation();
+        rolesRepresentation.setRealm(defaultRoles);
+        realmDetails.setRoles(rolesRepresentation);
+        return realmDetails;
+    }
+
+    @Override
+    public boolean createTenantAdminAccount(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails, String tenantAdminPassword) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), this.superAdminRealmId, isSuperAdminPasswordCreds);
+            UserRepresentation user = new UserRepresentation();
+            user.setUsername(gatewayDetails.getIdentityServerUserName());
+            user.setFirstName(gatewayDetails.getGatewayAdminFirstName());
+            user.setLastName(gatewayDetails.getGatewayAdminLastName());
+            user.setEmail(gatewayDetails.getGatewayAdminEmail());
+            user.setEmailVerified(true);
+            user.setEnabled(true);
+            Response httpResponse = client.realm(gatewayDetails.getGatewayId()).users().create(user);
+            logger.info("Tenant Admin account creation exited with code : " + httpResponse.getStatus()+" : " +httpResponse.getStatusInfo());
+            if (httpResponse.getStatus() == 201) { //HTTP code for record creation: HTTP 201
+                List<UserRepresentation> retrieveCreatedUserList = client.realm(gatewayDetails.getGatewayId()).users().search(user.getUsername(),
+                        user.getFirstName(),
+                        user.getLastName(),
+                        user.getEmail(),
+                        0, 1);
+                UserResource retrievedUser = client.realm(gatewayDetails.getGatewayId()).users().get(retrieveCreatedUserList.get(0).getId());
+
+                // Add user to the "admin" role
+                RoleResource adminRoleResource = client.realm(gatewayDetails.getGatewayId()).roles().get("admin");
+                retrievedUser.roles().realmLevel().add(Arrays.asList(adminRoleResource.toRepresentation()));
+
+                CredentialRepresentation credential = new CredentialRepresentation();
+                credential.setType(CredentialRepresentation.PASSWORD);
+                credential.setValue(tenantAdminPassword);
+                credential.setTemporary(false);
+                retrievedUser.resetPassword(credential);
+                List<ClientRepresentation> realmClients = client.realm(gatewayDetails.getGatewayId()).clients().findAll();
+                String realmManagementClientId=getRealmManagementClientId(client, gatewayDetails.getGatewayId());
+                for(ClientRepresentation realmClient : realmClients){
+                    if(realmClient.getClientId().equals("realm-management")){
+                        realmManagementClientId = realmClient.getId();
+                    }
+                }
+                retrievedUser.roles().clientLevel(realmManagementClientId).add(retrievedUser.roles().clientLevel(realmManagementClientId).listAvailable());
+                return true;
+            } else {
+                logger.error("Request for Tenant Admin Account Creation failed with HTTP code : " + httpResponse.getStatus());
+                logger.error("Reason for Tenant Admin account creation failure : " + httpResponse.getStatusInfo());
+                return false;
+            }
+        }catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        }catch (Exception ex){
+            logger.error("Error creating Realm Admin Account in keycloak server, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error creating Realm Admin Account in keycloak server, reason: " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public Gateway configureClient(PasswordCredential isSuperAdminPasswordCreds, Gateway gatewayDetails) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), this.superAdminRealmId, isSuperAdminPasswordCreds);
+            ClientRepresentation pgaClient = new ClientRepresentation();
+            pgaClient.setName("pga");
+            pgaClient.setClientId("pga");
+            pgaClient.setProtocol("openid-connect");
+            pgaClient.setStandardFlowEnabled(true);
+            pgaClient.setEnabled(true);
+            pgaClient.setAuthorizationServicesEnabled(true);
+            pgaClient.setDirectAccessGrantsEnabled(true);
+            pgaClient.setServiceAccountsEnabled(true);
+            pgaClient.setFullScopeAllowed(true);
+            pgaClient.setClientAuthenticatorType("client-secret");
+            List<String> redirectUris = new ArrayList<>();
+            if(gatewayDetails.getGatewayURL()!=null){
+                String gatewayURL = gatewayDetails.getGatewayURL();
+                // Remove trailing slash from gatewayURL
+                if(gatewayURL.endsWith("/")) {
+                    gatewayURL = gatewayURL.substring(0, gatewayURL.length() - 1);
+                }
+                // Add redirect URL after login
+                redirectUris.add(gatewayURL + "/callback-url"); // PGA
+                redirectUris.add(gatewayURL + "/auth/callback*"); // Django
+                // Add redirect URL after logout
+                redirectUris.add(gatewayURL);
+            } else {
+                logger.error("Request for Realm Client Creation failed, callback URL not present");
+                IamAdminServicesException ex = new IamAdminServicesException();
+                ex.setMessage("Gateway Url field in GatewayProfile cannot be empty, Realm Client creation failed");
+                throw ex;
+            }
+            pgaClient.setRedirectUris(redirectUris);
+            pgaClient.setPublicClient(false);
+            Response httpResponse = client.realms().realm(gatewayDetails.getGatewayId()).clients().create(pgaClient);
+            logger.info("Tenant Client configuration exited with code : " + httpResponse.getStatus()+" : " +httpResponse.getStatusInfo());
+
+            // Add the manage-users role to the web client
+            UserRepresentation serviceAccountUserRepresentation = getUserByUsername(client, gatewayDetails.getGatewayId(), "service-account-" + pgaClient.getClientId());
+            UserResource serviceAccountUser = client.realms().realm(gatewayDetails.getGatewayId()).users().get(serviceAccountUserRepresentation.getId());
+            String realmManagementClientId = getRealmManagementClientId(client, gatewayDetails.getGatewayId());
+            List<RoleRepresentation> manageUsersRole = serviceAccountUser.roles().clientLevel(realmManagementClientId).listAvailable()
+                    .stream()
+                    .filter(r -> r.getName().equals("manage-users"))
+                    .collect(Collectors.toList());
+            serviceAccountUser.roles().clientLevel(realmManagementClientId).add(manageUsersRole);
+
+            if(httpResponse.getStatus() == 201){
+                String ClientUUID = client.realms().realm(gatewayDetails.getGatewayId()).clients().findByClientId(pgaClient.getClientId()).get(0).getId();
+                CredentialRepresentation clientSecret = client.realms().realm(gatewayDetails.getGatewayId()).clients().get(ClientUUID).getSecret();
+                gatewayDetails.setOauthClientId(pgaClient.getClientId());
+                gatewayDetails.setOauthClientSecret(clientSecret.getValue());
+                return gatewayDetails;
+            } else {
+                logger.error("Request for Realm Client Creation failed with HTTP code : " + httpResponse.getStatus());
+                logger.error("Reason for Realm Client Creation failure : " + httpResponse.getStatusInfo());
+                return null;
+            }
+        }catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    private static String getRealmManagementClientId(Keycloak client, String realmId) {
+        List<ClientRepresentation> realmClients = client.realm(realmId).clients().findAll();
+        String realmManagementClientId=null;
+        for(ClientRepresentation realmClient : realmClients){
+            if(realmClient.getClientId().equals("realm-management")){
+                realmManagementClientId = realmClient.getId();
+            }
+        }
+        return realmManagementClientId;
+    }
+
+    @Override
+    public boolean isUsernameAvailable(String accessToken, String tenantId, String username) throws IamAdminServicesException {
+        Keycloak client = null;
+        try {
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            return userRepresentation == null;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean createUser(String accessToken, String tenantId, String username, String emailAddress, String firstName, String lastName, String newPassword) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation user = new UserRepresentation();
+            user.setUsername(username);
+            user.setFirstName(firstName);
+            user.setLastName(lastName);
+            user.setEmail(emailAddress);
+            user.setEnabled(false);
+            Response httpResponse = client.realm(tenantId).users().create(user);
+            if (httpResponse.getStatus() == 201) { //HTTP code for record creation: HTTP 201
+                List<UserRepresentation> retrieveCreatedUserList = client.realm(tenantId).users().search(user.getUsername(),
+                        user.getFirstName(),
+                        user.getLastName(),
+                        user.getEmail(),
+                        0, 1);
+                UserResource retrievedUser = client.realm(tenantId).users().get(retrieveCreatedUserList.get(0).getId());
+                CredentialRepresentation credential = new CredentialRepresentation();
+                credential.setType(CredentialRepresentation.PASSWORD);
+                credential.setValue(newPassword);
+                credential.setTemporary(false);
+                retrievedUser.resetPassword(credential);
+                return true;
+            } else {
+                logger.error("Request for user Account Creation failed with HTTP code : " + httpResponse.getStatus());
+                logger.error("Reason for user account creation failure : " + httpResponse.getStatusInfo());
+                return false;
+            }
+        }catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean enableUserAccount(String accessToken, String tenantId, String username) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            UserResource userResource = client.realm(tenantId).users().get(userRepresentation.getId());
+            UserRepresentation profile = userResource.toRepresentation();
+            profile.setEnabled(true);
+            // We require that a user verify their email before enabling the account
+            profile.setEmailVerified(true);
+            userResource.update(profile);
+            return true;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean isUserAccountEnabled(String accessToken, String tenantId, String username) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            return userRepresentation != null && userRepresentation.isEnabled();
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean isUserExist(String accessToken, String tenantId, String username) throws IamAdminServicesException {
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            return userRepresentation != null;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public UserProfile getUser(String accessToken, String tenantId, String username) throws IamAdminServicesException {
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            return userRepresentation != null ? convertUserRepresentationToUserProfile(userRepresentation, tenantId) : null;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public List<UserProfile> getUsers(String accessToken, String tenantId, int offset, int limit, String search)
+            throws IamAdminServicesException {
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            List<UserRepresentation> userRepresentationList = client.realm(tenantId).users().search(search, offset, limit);
+            return userRepresentationList.stream().map(ur -> convertUserRepresentationToUserProfile(ur, tenantId))
+                    .collect(Collectors.toList());
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean resetUserPassword(String accessToken, String tenantId, String username, String newPassword) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            if(userRepresentation != null)
+            {
+                UserResource retrievedUser = client.realm(tenantId).users().get(userRepresentation.getId());
+                CredentialRepresentation credential = new CredentialRepresentation();
+                credential.setType(CredentialRepresentation.PASSWORD);
+                credential.setValue(newPassword);
+                credential.setTemporary(false);
+                retrievedUser.resetPassword(credential);
+                // Remove the UPDATE_PASSWORD required action
+                userRepresentation = retrievedUser.toRepresentation();
+                userRepresentation.getRequiredActions().remove("UPDATE_PASSWORD");
+                retrievedUser.update(userRepresentation);
+                return true;
+            }else{
+                logger.error("requested User not found");
+                return false;
+            }
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } catch (Exception ex){
+            logger.error("Error resetting user password in keycloak server, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error resetting user password in keycloak server, reason: " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public List<UserProfile> findUser(String accessToken, String tenantId, String email, String userName) throws IamAdminServicesException{
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            List<UserRepresentation> retrieveUserList = client.realm(tenantId).users().search(userName,
+                    null,
+                    null,
+                    email,
+                    0, 1);
+            if(!retrieveUserList.isEmpty())
+            {
+                List<UserProfile> userList = new ArrayList<>();
+                for(UserRepresentation user : retrieveUserList){
+                    UserProfile profile = new UserProfile();
+                    profile.setUserId(user.getUsername());
+                    profile.setFirstName(user.getFirstName());
+                    profile.setLastName(user.getLastName());
+                    profile.setEmails(Arrays.asList(new String[]{user.getEmail()}));
+                    userList.add(profile);
+                }
+                return userList;
+            }else{
+                logger.error("requested User not found");
+                return null;
+            }
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } catch (Exception ex){
+            logger.error("Error finding user in keycloak server, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error finding user in keycloak server, reason: " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public void updateUserProfile(String accessToken, String tenantId, String username, UserProfile userDetails) throws IamAdminServicesException {
+
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, accessToken);
+            UserRepresentation userRepresentation = getUserByUsername(client, tenantId, username);
+            if(userRepresentation != null)
+            {
+                userRepresentation.setFirstName(userDetails.getFirstName());
+                userRepresentation.setLastName(userDetails.getLastName());
+                userRepresentation.setEmail(userDetails.getEmails().get(0));
+                UserResource userResource = client.realm(tenantId).users().get(userRepresentation.getId());
+                userResource.update(userRepresentation);
+            }else{
+                throw new IamAdminServicesException("User [" + username + "] wasn't found in Keycloak!");
+            }
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } catch (Exception ex){
+            logger.error("Error updating user profile in keycloak server, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error updating user profile in keycloak server, reason: " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean addRoleToUser(PasswordCredential realmAdminCreds, String tenantId, String username, String roleName) throws IamAdminServicesException {
+
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, realmAdminCreds);
+            List<UserRepresentation> retrieveCreatedUserList = client.realm(tenantId).users().search(username,
+                    null,
+                    null,
+                    null,
+                    0, 1);
+            UserResource retrievedUser = client.realm(tenantId).users().get(retrieveCreatedUserList.get(0).getId());
+
+            // Add user to the role
+            RoleResource roleResource = client.realm(tenantId).roles().get(roleName);
+            retrievedUser.roles().realmLevel().add(Arrays.asList(roleResource.toRepresentation()));
+            return true;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    @Override
+    public boolean removeRoleFromUser(PasswordCredential realmAdminCreds, String tenantId, String username, String roleName) throws IamAdminServicesException {
+
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, realmAdminCreds);
+            List<UserRepresentation> retrieveCreatedUserList = client.realm(tenantId).users().search(username,
+                    null,
+                    null,
+                    null,
+                    0, 1);
+            UserResource retrievedUser = client.realm(tenantId).users().get(retrieveCreatedUserList.get(0).getId());
+
+            // Remove role from user
+            RoleResource roleResource = client.realm(tenantId).roles().get(roleName);
+            retrievedUser.roles().realmLevel().remove(Arrays.asList(roleResource.toRepresentation()));
+            return true;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                client.close();
+            }
+        }
+    }
+
+    // TODO: this is needed for migrating from roles to group-based auth but after migration we can remove this
+    @Override
+    public List<UserProfile> getUsersWithRole(PasswordCredential realmAdminCreds, String tenantId, String roleName) throws IamAdminServicesException {
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, realmAdminCreds);
+            // FIXME: this only searches through the most recent 100 users for the given role (assuming there are no more than 10,000 users in the gateway)
+            int totalUserCount = client.realm(tenantId).users().count();
+            logger.debug("getUsersWithRole: totalUserCount=" + totalUserCount);
+            // Load all users in batches
+            List<UserRepresentation> allUsers = new ArrayList<>();
+            int userBatchSize = 100;
+            for (int start = 0; start < totalUserCount; start=start+userBatchSize) {
+
+                logger.debug("getUsersWithRole: fetching " + userBatchSize + " users...");
+                allUsers.addAll(client.realm(tenantId).users().search(null,
+                        null,
+                        null,
+                        null,
+                        start, userBatchSize));
+            }
+            logger.debug("getUsersWithRole: all users count=" + allUsers.size());
+            allUsers.sort((a, b) -> a.getCreatedTimestamp() - b.getCreatedTimestamp() > 0 ? -1 : 1);
+            // The 100 most recently created users
+            List<UserRepresentation> mostRecentUsers = allUsers.subList(0, Math.min(allUsers.size(), 100));
+            logger.debug("getUsersWithRole: most recent users count=" + mostRecentUsers.size());
+
+            List<UserProfile> usersWithRole = new ArrayList<>();
+            for (UserRepresentation user: mostRecentUsers) {
+                UserResource userResource = client.realm(tenantId).users().get(user.getId());
+
+                List<RoleRepresentation> roleRepresentations = userResource.roles().realmLevel().listAll();
+                for (RoleRepresentation roleRepresentation : roleRepresentations){
+                    if (roleRepresentation.getName().equals(roleName)) {
+                        usersWithRole.add(convertUserRepresentationToUserProfile(user, tenantId));
+                        break;
+                    }
+                }
+            }
+            logger.debug("getUsersWithRole: most recent users with role count=" + usersWithRole.size());
+            return usersWithRole;
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                logger.debug("getUsersWithRole: closing client...");
+                client.close();
+                logger.debug("getUsersWithRole: client closed");
+            }
+        }
+    }
+
+    public List<String> getUserRoles(PasswordCredential realmAdminCreds, String tenantId, String username) throws IamAdminServicesException {
+        Keycloak client = null;
+        try{
+            client = TenantManagementKeycloakImpl.getClient(ServerSettings.getIamServerUrl(), tenantId, realmAdminCreds);
+            List<UserRepresentation> userRepresentationList = client.realm(tenantId).users().search(username,
+                    null,
+                    null,
+                    null,
+                    0, 1);
+            if (userRepresentationList.isEmpty()) {
+                logger.warn("No Keycloak user found for username [" + username + "] in tenant [" + tenantId + "].");
+                return null;
+            }
+            UserResource retrievedUser = client.realm(tenantId).users().get(userRepresentationList.get(0).getId());
+            return retrievedUser.roles().realmLevel().listAll()
+                    .stream()
+                    .map(roleRepresentation -> roleRepresentation.getName())
+                    .collect(Collectors.toList());
+        } catch (ApplicationSettingsException ex) {
+            logger.error("Error getting values from property file, reason: " + ex.getMessage(), ex);
+            IamAdminServicesException exception = new IamAdminServicesException();
+            exception.setMessage("Error getting values from property file, reason " + ex.getMessage());
+            throw exception;
+        } finally {
+            if (client != null) {
+                logger.debug("getUserRoles: closing client...");
+                client.close();
+                logger.debug("getUserRoles: client closed");
+            }
+        }
+    }
+
+    private UserProfile convertUserRepresentationToUserProfile(UserRepresentation userRepresentation, String tenantId) {
+
+        UserProfile profile = new UserProfile();
+        profile.setCustosInternalUserId(userRepresentation.getUsername() + "@" + tenantId);
+        profile.setGatewayId(tenantId);
+        profile.setUserId(userRepresentation.getUsername());
+        profile.setFirstName(userRepresentation.getFirstName());
+        profile.setLastName(userRepresentation.getLastName());
+        profile.setEmails(Arrays.asList(new String[]{userRepresentation.getEmail()}));
+        profile.setCreationTime(userRepresentation.getCreatedTimestamp());
+
+        // Just default these. UserProfile isn't a great data model for this data since it isn't actually the Airavata UserProfile
+        profile.setLastAccessTime(0);
+        profile.setValidUntil(0);
+        // Use state field to indicate whether user has been enabled or email verified in Keycloak
+        if (userRepresentation.isEnabled()) {
+            profile.setState(Status.ACTIVE);
+        } else if (userRepresentation.isEmailVerified()) {
+            profile.setState(Status.CONFIRMED);
+        } else {
+            profile.setState(Status.PENDING_CONFIRMATION);
+        }
+
+        return profile;
+    }
+
+    private static UserRepresentation getUserByUsername(Keycloak client, String tenantId, String username) {
+
+        // Searching for users by username returns also partial matches, so need to filter down to an exact match if it exists
+        List<UserRepresentation> userResourceList = client.realm(tenantId).users().search(
+                username, null, null, null, null, null);
+        for (UserRepresentation userRepresentation : userResourceList) {
+            if (userRepresentation.getUsername().equals(username)) {
+                return userRepresentation;
+            }
+        }
+        return null;
+    }
+
+//    public static void main(String[] args) throws IamAdminServicesException, ApplicationSettingsException {
+//        TenantManagementKeycloakImpl tenantManagementKeycloak = new TenantManagementKeycloakImpl();
+//        ServerSettings.setSetting("trust.store", "./modules/configuration/server/src/main/resources/client_truststore.jks");
+//        ServerSettings.setSetting("trust.store.password", "airavata");
+//        ServerSettings.setSetting("iam.server.url", "");
+//        String accessToken = "";
+//        String tenantId = "";
+//        String username = "";
+//        boolean isUsernameAvailable = tenantManagementKeycloak.isUsernameAvailable(accessToken, tenantId, username);
+//        System.out.println("Username " + username + " is " + (isUsernameAvailable ? "": "NOT ") + "available");
+//    }
+}
diff --git a/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/cpi/IamAdminServices.java b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/cpi/IamAdminServices.java
new file mode 100644
index 0000000..d994d84
--- /dev/null
+++ b/custos-profile-service/iam-admin-services/src/main/java/org/apache/custos/profile/iam/admin/services/cpi/IamAdminServices.java
@@ -0,0 +1,17956 @@
+/**
+ * Autogenerated by Thrift Compiler (0.12.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.custos.profile.iam.admin.services.cpi;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-07-10")
+public class IamAdminServices {
+
+  public interface Iface {
+
+    public String getAPIVersion() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public org.apache.custos.profile.model.workspace.Gateway setUpGateway(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean isUsernameAvailable(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean registerUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean enableUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean isUserEnabled(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean isUserExist(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public org.apache.custos.profile.model.user.UserProfile getUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> getUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean resetUserPassword(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> findUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public void updateUserProfile(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean addRoleToUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public boolean removeRoleFromUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> getUsersWithRole(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getAPIVersion(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException;
+
+    public void setUpGateway(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway> resultHandler) throws org.apache.thrift.TException;
+
+    public void isUsernameAvailable(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void registerUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void enableUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void isUserEnabled(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void isUserExist(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void getUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile> resultHandler) throws org.apache.thrift.TException;
+
+    public void getUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException;
+
+    public void resetUserPassword(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void findUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException;
+
+    public void updateUserProfile(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;
+
+    public void addRoleToUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void removeRoleFromUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException;
+
+    public void getUsersWithRole(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+      public Factory() {}
+      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+        return new Client(prot);
+      }
+      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+        return new Client(iprot, oprot);
+      }
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol prot)
+    {
+      super(prot, prot);
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+      super(iprot, oprot);
+    }
+
+    public String getAPIVersion() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_getAPIVersion();
+      return recv_getAPIVersion();
+    }
+
+    public void send_getAPIVersion() throws org.apache.thrift.TException
+    {
+      getAPIVersion_args args = new getAPIVersion_args();
+      sendBase("getAPIVersion", args);
+    }
+
+    public String recv_getAPIVersion() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      getAPIVersion_result result = new getAPIVersion_result();
+      receiveBase(result, "getAPIVersion");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAPIVersion failed: unknown result");
+    }
+
+    public org.apache.custos.profile.model.workspace.Gateway setUpGateway(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_setUpGateway(authzToken, gateway, tenantAdminPasswordCredential);
+      return recv_setUpGateway();
+    }
+
+    public void send_setUpGateway(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.thrift.TException
+    {
+      setUpGateway_args args = new setUpGateway_args();
+      args.setAuthzToken(authzToken);
+      args.setGateway(gateway);
+      args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+      sendBase("setUpGateway", args);
+    }
+
+    public org.apache.custos.profile.model.workspace.Gateway recv_setUpGateway() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      setUpGateway_result result = new setUpGateway_result();
+      receiveBase(result, "setUpGateway");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "setUpGateway failed: unknown result");
+    }
+
+    public boolean isUsernameAvailable(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_isUsernameAvailable(authzToken, username);
+      return recv_isUsernameAvailable();
+    }
+
+    public void send_isUsernameAvailable(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.thrift.TException
+    {
+      isUsernameAvailable_args args = new isUsernameAvailable_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      sendBase("isUsernameAvailable", args);
+    }
+
+    public boolean recv_isUsernameAvailable() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      isUsernameAvailable_result result = new isUsernameAvailable_result();
+      receiveBase(result, "isUsernameAvailable");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isUsernameAvailable failed: unknown result");
+    }
+
+    public boolean registerUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_registerUser(authzToken, username, emailAddress, firstName, lastName, newPassword);
+      return recv_registerUser();
+    }
+
+    public void send_registerUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword) throws org.apache.thrift.TException
+    {
+      registerUser_args args = new registerUser_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      args.setEmailAddress(emailAddress);
+      args.setFirstName(firstName);
+      args.setLastName(lastName);
+      args.setNewPassword(newPassword);
+      sendBase("registerUser", args);
+    }
+
+    public boolean recv_registerUser() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      registerUser_result result = new registerUser_result();
+      receiveBase(result, "registerUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerUser failed: unknown result");
+    }
+
+    public boolean enableUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_enableUser(authzToken, username);
+      return recv_enableUser();
+    }
+
+    public void send_enableUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.thrift.TException
+    {
+      enableUser_args args = new enableUser_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      sendBase("enableUser", args);
+    }
+
+    public boolean recv_enableUser() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      enableUser_result result = new enableUser_result();
+      receiveBase(result, "enableUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "enableUser failed: unknown result");
+    }
+
+    public boolean isUserEnabled(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_isUserEnabled(authzToken, username);
+      return recv_isUserEnabled();
+    }
+
+    public void send_isUserEnabled(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.thrift.TException
+    {
+      isUserEnabled_args args = new isUserEnabled_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      sendBase("isUserEnabled", args);
+    }
+
+    public boolean recv_isUserEnabled() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      isUserEnabled_result result = new isUserEnabled_result();
+      receiveBase(result, "isUserEnabled");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isUserEnabled failed: unknown result");
+    }
+
+    public boolean isUserExist(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_isUserExist(authzToken, username);
+      return recv_isUserExist();
+    }
+
+    public void send_isUserExist(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.thrift.TException
+    {
+      isUserExist_args args = new isUserExist_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      sendBase("isUserExist", args);
+    }
+
+    public boolean recv_isUserExist() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      isUserExist_result result = new isUserExist_result();
+      receiveBase(result, "isUserExist");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isUserExist failed: unknown result");
+    }
+
+    public org.apache.custos.profile.model.user.UserProfile getUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_getUser(authzToken, username);
+      return recv_getUser();
+    }
+
+    public void send_getUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username) throws org.apache.thrift.TException
+    {
+      getUser_args args = new getUser_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      sendBase("getUser", args);
+    }
+
+    public org.apache.custos.profile.model.user.UserProfile recv_getUser() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      getUser_result result = new getUser_result();
+      receiveBase(result, "getUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUser failed: unknown result");
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> getUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_getUsers(authzToken, offset, limit, search);
+      return recv_getUsers();
+    }
+
+    public void send_getUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search) throws org.apache.thrift.TException
+    {
+      getUsers_args args = new getUsers_args();
+      args.setAuthzToken(authzToken);
+      args.setOffset(offset);
+      args.setLimit(limit);
+      args.setSearch(search);
+      sendBase("getUsers", args);
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> recv_getUsers() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      getUsers_result result = new getUsers_result();
+      receiveBase(result, "getUsers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUsers failed: unknown result");
+    }
+
+    public boolean resetUserPassword(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_resetUserPassword(authzToken, username, newPassword);
+      return recv_resetUserPassword();
+    }
+
+    public void send_resetUserPassword(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword) throws org.apache.thrift.TException
+    {
+      resetUserPassword_args args = new resetUserPassword_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      args.setNewPassword(newPassword);
+      sendBase("resetUserPassword", args);
+    }
+
+    public boolean recv_resetUserPassword() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      resetUserPassword_result result = new resetUserPassword_result();
+      receiveBase(result, "resetUserPassword");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "resetUserPassword failed: unknown result");
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> findUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_findUsers(authzToken, email, userId);
+      return recv_findUsers();
+    }
+
+    public void send_findUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId) throws org.apache.thrift.TException
+    {
+      findUsers_args args = new findUsers_args();
+      args.setAuthzToken(authzToken);
+      args.setEmail(email);
+      args.setUserId(userId);
+      sendBase("findUsers", args);
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> recv_findUsers() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      findUsers_result result = new findUsers_result();
+      receiveBase(result, "findUsers");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "findUsers failed: unknown result");
+    }
+
+    public void updateUserProfile(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_updateUserProfile(authzToken, userDetails);
+      recv_updateUserProfile();
+    }
+
+    public void send_updateUserProfile(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails) throws org.apache.thrift.TException
+    {
+      updateUserProfile_args args = new updateUserProfile_args();
+      args.setAuthzToken(authzToken);
+      args.setUserDetails(userDetails);
+      sendBase("updateUserProfile", args);
+    }
+
+    public void recv_updateUserProfile() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      updateUserProfile_result result = new updateUserProfile_result();
+      receiveBase(result, "updateUserProfile");
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      return;
+    }
+
+    public boolean addRoleToUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_addRoleToUser(authzToken, username, roleName, tenantAdminPasswordCredential);
+      return recv_addRoleToUser();
+    }
+
+    public void send_addRoleToUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.thrift.TException
+    {
+      addRoleToUser_args args = new addRoleToUser_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      args.setRoleName(roleName);
+      args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+      sendBase("addRoleToUser", args);
+    }
+
+    public boolean recv_addRoleToUser() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      addRoleToUser_result result = new addRoleToUser_result();
+      receiveBase(result, "addRoleToUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addRoleToUser failed: unknown result");
+    }
+
+    public boolean removeRoleFromUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_removeRoleFromUser(authzToken, username, roleName, tenantAdminPasswordCredential);
+      return recv_removeRoleFromUser();
+    }
+
+    public void send_removeRoleFromUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.thrift.TException
+    {
+      removeRoleFromUser_args args = new removeRoleFromUser_args();
+      args.setAuthzToken(authzToken);
+      args.setUsername(username);
+      args.setRoleName(roleName);
+      args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+      sendBase("removeRoleFromUser", args);
+    }
+
+    public boolean recv_removeRoleFromUser() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      removeRoleFromUser_result result = new removeRoleFromUser_result();
+      receiveBase(result, "removeRoleFromUser");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeRoleFromUser failed: unknown result");
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> getUsersWithRole(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      send_getUsersWithRole(authzToken, roleName, tenantAdminPasswordCredential);
+      return recv_getUsersWithRole();
+    }
+
+    public void send_getUsersWithRole(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) throws org.apache.thrift.TException
+    {
+      getUsersWithRole_args args = new getUsersWithRole_args();
+      args.setAuthzToken(authzToken);
+      args.setRoleName(roleName);
+      args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+      sendBase("getUsersWithRole", args);
+    }
+
+    public java.util.List<org.apache.custos.profile.model.user.UserProfile> recv_getUsersWithRole() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException
+    {
+      getUsersWithRole_result result = new getUsersWithRole_result();
+      receiveBase(result, "getUsersWithRole");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.Idse != null) {
+        throw result.Idse;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUsersWithRole failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+      private org.apache.thrift.async.TAsyncClientManager clientManager;
+      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+        this.clientManager = clientManager;
+        this.protocolFactory = protocolFactory;
+      }
+      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+        return new AsyncClient(protocolFactory, clientManager, transport);
+      }
+    }
+
+    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+      super(protocolFactory, clientManager, transport);
+    }
+
+    public void getAPIVersion(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getAPIVersion_call method_call = new getAPIVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getAPIVersion_call extends org.apache.thrift.async.TAsyncMethodCall<String> {
+      public getAPIVersion_call(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAPIVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getAPIVersion_args args = new getAPIVersion_args();
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getAPIVersion();
+      }
+    }
+
+    public void setUpGateway(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      setUpGateway_call method_call = new setUpGateway_call(authzToken, gateway, tenantAdminPasswordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class setUpGateway_call extends org.apache.thrift.async.TAsyncMethodCall<org.apache.custos.profile.model.workspace.Gateway> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private org.apache.custos.profile.model.workspace.Gateway gateway;
+      private org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential;
+      public setUpGateway_call(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.workspace.Gateway gateway, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonb [...]
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.gateway = gateway;
+        this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setUpGateway", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        setUpGateway_args args = new setUpGateway_args();
+        args.setAuthzToken(authzToken);
+        args.setGateway(gateway);
+        args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.custos.profile.model.workspace.Gateway getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_setUpGateway();
+      }
+    }
+
+    public void isUsernameAvailable(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      isUsernameAvailable_call method_call = new isUsernameAvailable_call(authzToken, username, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class isUsernameAvailable_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      public isUsernameAvailable_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isUsernameAvailable", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        isUsernameAvailable_args args = new isUsernameAvailable_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_isUsernameAvailable();
+      }
+    }
+
+    public void registerUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      registerUser_call method_call = new registerUser_call(authzToken, username, emailAddress, firstName, lastName, newPassword, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class registerUser_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      private String emailAddress;
+      private String firstName;
+      private String lastName;
+      private String newPassword;
+      public registerUser_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String emailAddress, String firstName, String lastName, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+        this.emailAddress = emailAddress;
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.newPassword = newPassword;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        registerUser_args args = new registerUser_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.setEmailAddress(emailAddress);
+        args.setFirstName(firstName);
+        args.setLastName(lastName);
+        args.setNewPassword(newPassword);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_registerUser();
+      }
+    }
+
+    public void enableUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      enableUser_call method_call = new enableUser_call(authzToken, username, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class enableUser_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      public enableUser_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("enableUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        enableUser_args args = new enableUser_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_enableUser();
+      }
+    }
+
+    public void isUserEnabled(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      isUserEnabled_call method_call = new isUserEnabled_call(authzToken, username, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class isUserEnabled_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      public isUserEnabled_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isUserEnabled", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        isUserEnabled_args args = new isUserEnabled_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_isUserEnabled();
+      }
+    }
+
+    public void isUserExist(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      isUserExist_call method_call = new isUserExist_call(authzToken, username, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class isUserExist_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      public isUserExist_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isUserExist", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        isUserExist_args args = new isUserExist_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_isUserExist();
+      }
+    }
+
+    public void getUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getUser_call method_call = new getUser_call(authzToken, username, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getUser_call extends org.apache.thrift.async.TAsyncMethodCall<org.apache.custos.profile.model.user.UserProfile> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      public getUser_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getUser_args args = new getUser_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.custos.profile.model.user.UserProfile getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getUser();
+      }
+    }
+
+    public void getUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getUsers_call method_call = new getUsers_call(authzToken, offset, limit, search, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getUsers_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private int offset;
+      private int limit;
+      private String search;
+      public getUsers_call(org.apache.custos.commons.model.security.AuthzToken authzToken, int offset, int limit, String search, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.offset = offset;
+        this.limit = limit;
+        this.search = search;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUsers", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getUsers_args args = new getUsers_args();
+        args.setAuthzToken(authzToken);
+        args.setOffset(offset);
+        args.setLimit(limit);
+        args.setSearch(search);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public java.util.List<org.apache.custos.profile.model.user.UserProfile> getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getUsers();
+      }
+    }
+
+    public void resetUserPassword(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      resetUserPassword_call method_call = new resetUserPassword_call(authzToken, username, newPassword, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class resetUserPassword_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      private String newPassword;
+      public resetUserPassword_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String newPassword, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+        this.newPassword = newPassword;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("resetUserPassword", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        resetUserPassword_args args = new resetUserPassword_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.setNewPassword(newPassword);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_resetUserPassword();
+      }
+    }
+
+    public void findUsers(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      findUsers_call method_call = new findUsers_call(authzToken, email, userId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class findUsers_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String email;
+      private String userId;
+      public findUsers_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String email, String userId, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.email = email;
+        this.userId = userId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("findUsers", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        findUsers_args args = new findUsers_args();
+        args.setAuthzToken(authzToken);
+        args.setEmail(email);
+        args.setUserId(userId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public java.util.List<org.apache.custos.profile.model.user.UserProfile> getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_findUsers();
+      }
+    }
+
+    public void updateUserProfile(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      updateUserProfile_call method_call = new updateUserProfile_call(authzToken, userDetails, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class updateUserProfile_call extends org.apache.thrift.async.TAsyncMethodCall<Void> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private org.apache.custos.profile.model.user.UserProfile userDetails;
+      public updateUserProfile_call(org.apache.custos.commons.model.security.AuthzToken authzToken, org.apache.custos.profile.model.user.UserProfile userDetails, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.userDetails = userDetails;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateUserProfile", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        updateUserProfile_args args = new updateUserProfile_args();
+        args.setAuthzToken(authzToken);
+        args.setUserDetails(userDetails);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Void getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return null;
+      }
+    }
+
+    public void addRoleToUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addRoleToUser_call method_call = new addRoleToUser_call(authzToken, username, roleName, tenantAdminPasswordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addRoleToUser_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      private String roleName;
+      private org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential;
+      public addRoleToUser_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+        this.roleName = roleName;
+        this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addRoleToUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addRoleToUser_args args = new addRoleToUser_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.setRoleName(roleName);
+        args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addRoleToUser();
+      }
+    }
+
+    public void removeRoleFromUser(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      removeRoleFromUser_call method_call = new removeRoleFromUser_call(authzToken, username, roleName, tenantAdminPasswordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class removeRoleFromUser_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String username;
+      private String roleName;
+      private org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential;
+      public removeRoleFromUser_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String username, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.username = username;
+        this.roleName = roleName;
+        this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeRoleFromUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        removeRoleFromUser_args args = new removeRoleFromUser_args();
+        args.setAuthzToken(authzToken);
+        args.setUsername(username);
+        args.setRoleName(roleName);
+        args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public Boolean getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_removeRoleFromUser();
+      }
+    }
+
+    public void getUsersWithRole(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getUsersWithRole_call method_call = new getUsersWithRole_call(authzToken, roleName, tenantAdminPasswordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getUsersWithRole_call extends org.apache.thrift.async.TAsyncMethodCall<java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      private org.apache.custos.commons.model.security.AuthzToken authzToken;
+      private String roleName;
+      private org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential;
+      public getUsersWithRole_call(org.apache.custos.commons.model.security.AuthzToken authzToken, String roleName, org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transp [...]
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.authzToken = authzToken;
+        this.roleName = roleName;
+        this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUsersWithRole", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getUsersWithRole_args args = new getUsersWithRole_args();
+        args.setAuthzToken(authzToken);
+        args.setRoleName(roleName);
+        args.setTenantAdminPasswordCredential(tenantAdminPasswordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public java.util.List<org.apache.custos.profile.model.user.UserProfile> getResult() throws org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException, org.apache.thrift.TException {
+        if (getState() != State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getUsersWithRole();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
+    public Processor(I iface) {
+      super(iface, getProcessMap(new java.util.HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+    }
+
+    protected Processor(I iface, java.util.Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends Iface> java.util.Map<String,  org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<String, org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      processMap.put("getAPIVersion", new getAPIVersion());
+      processMap.put("setUpGateway", new setUpGateway());
+      processMap.put("isUsernameAvailable", new isUsernameAvailable());
+      processMap.put("registerUser", new registerUser());
+      processMap.put("enableUser", new enableUser());
+      processMap.put("isUserEnabled", new isUserEnabled());
+      processMap.put("isUserExist", new isUserExist());
+      processMap.put("getUser", new getUser());
+      processMap.put("getUsers", new getUsers());
+      processMap.put("resetUserPassword", new resetUserPassword());
+      processMap.put("findUsers", new findUsers());
+      processMap.put("updateUserProfile", new updateUserProfile());
+      processMap.put("addRoleToUser", new addRoleToUser());
+      processMap.put("removeRoleFromUser", new removeRoleFromUser());
+      processMap.put("getUsersWithRole", new getUsersWithRole());
+      return processMap;
+    }
+
+    public static class getAPIVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAPIVersion_args> {
+      public getAPIVersion() {
+        super("getAPIVersion");
+      }
+
+      public getAPIVersion_args getEmptyArgsInstance() {
+        return new getAPIVersion_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public getAPIVersion_result getResult(I iface, getAPIVersion_args args) throws org.apache.thrift.TException {
+        getAPIVersion_result result = new getAPIVersion_result();
+        try {
+          result.success = iface.getAPIVersion();
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class setUpGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setUpGateway_args> {
+      public setUpGateway() {
+        super("setUpGateway");
+      }
+
+      public setUpGateway_args getEmptyArgsInstance() {
+        return new setUpGateway_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public setUpGateway_result getResult(I iface, setUpGateway_args args) throws org.apache.thrift.TException {
+        setUpGateway_result result = new setUpGateway_result();
+        try {
+          result.success = iface.setUpGateway(args.authzToken, args.gateway, args.tenantAdminPasswordCredential);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class isUsernameAvailable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isUsernameAvailable_args> {
+      public isUsernameAvailable() {
+        super("isUsernameAvailable");
+      }
+
+      public isUsernameAvailable_args getEmptyArgsInstance() {
+        return new isUsernameAvailable_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public isUsernameAvailable_result getResult(I iface, isUsernameAvailable_args args) throws org.apache.thrift.TException {
+        isUsernameAvailable_result result = new isUsernameAvailable_result();
+        try {
+          result.success = iface.isUsernameAvailable(args.authzToken, args.username);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class registerUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerUser_args> {
+      public registerUser() {
+        super("registerUser");
+      }
+
+      public registerUser_args getEmptyArgsInstance() {
+        return new registerUser_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public registerUser_result getResult(I iface, registerUser_args args) throws org.apache.thrift.TException {
+        registerUser_result result = new registerUser_result();
+        try {
+          result.success = iface.registerUser(args.authzToken, args.username, args.emailAddress, args.firstName, args.lastName, args.newPassword);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class enableUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, enableUser_args> {
+      public enableUser() {
+        super("enableUser");
+      }
+
+      public enableUser_args getEmptyArgsInstance() {
+        return new enableUser_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public enableUser_result getResult(I iface, enableUser_args args) throws org.apache.thrift.TException {
+        enableUser_result result = new enableUser_result();
+        try {
+          result.success = iface.enableUser(args.authzToken, args.username);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class isUserEnabled<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isUserEnabled_args> {
+      public isUserEnabled() {
+        super("isUserEnabled");
+      }
+
+      public isUserEnabled_args getEmptyArgsInstance() {
+        return new isUserEnabled_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public isUserEnabled_result getResult(I iface, isUserEnabled_args args) throws org.apache.thrift.TException {
+        isUserEnabled_result result = new isUserEnabled_result();
+        try {
+          result.success = iface.isUserEnabled(args.authzToken, args.username);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class isUserExist<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isUserExist_args> {
+      public isUserExist() {
+        super("isUserExist");
+      }
+
+      public isUserExist_args getEmptyArgsInstance() {
+        return new isUserExist_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public isUserExist_result getResult(I iface, isUserExist_args args) throws org.apache.thrift.TException {
+        isUserExist_result result = new isUserExist_result();
+        try {
+          result.success = iface.isUserExist(args.authzToken, args.username);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class getUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUser_args> {
+      public getUser() {
+        super("getUser");
+      }
+
+      public getUser_args getEmptyArgsInstance() {
+        return new getUser_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public getUser_result getResult(I iface, getUser_args args) throws org.apache.thrift.TException {
+        getUser_result result = new getUser_result();
+        try {
+          result.success = iface.getUser(args.authzToken, args.username);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class getUsers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUsers_args> {
+      public getUsers() {
+        super("getUsers");
+      }
+
+      public getUsers_args getEmptyArgsInstance() {
+        return new getUsers_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public getUsers_result getResult(I iface, getUsers_args args) throws org.apache.thrift.TException {
+        getUsers_result result = new getUsers_result();
+        try {
+          result.success = iface.getUsers(args.authzToken, args.offset, args.limit, args.search);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class resetUserPassword<I extends Iface> extends org.apache.thrift.ProcessFunction<I, resetUserPassword_args> {
+      public resetUserPassword() {
+        super("resetUserPassword");
+      }
+
+      public resetUserPassword_args getEmptyArgsInstance() {
+        return new resetUserPassword_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public resetUserPassword_result getResult(I iface, resetUserPassword_args args) throws org.apache.thrift.TException {
+        resetUserPassword_result result = new resetUserPassword_result();
+        try {
+          result.success = iface.resetUserPassword(args.authzToken, args.username, args.newPassword);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class findUsers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, findUsers_args> {
+      public findUsers() {
+        super("findUsers");
+      }
+
+      public findUsers_args getEmptyArgsInstance() {
+        return new findUsers_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public findUsers_result getResult(I iface, findUsers_args args) throws org.apache.thrift.TException {
+        findUsers_result result = new findUsers_result();
+        try {
+          result.success = iface.findUsers(args.authzToken, args.email, args.userId);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class updateUserProfile<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateUserProfile_args> {
+      public updateUserProfile() {
+        super("updateUserProfile");
+      }
+
+      public updateUserProfile_args getEmptyArgsInstance() {
+        return new updateUserProfile_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public updateUserProfile_result getResult(I iface, updateUserProfile_args args) throws org.apache.thrift.TException {
+        updateUserProfile_result result = new updateUserProfile_result();
+        try {
+          iface.updateUserProfile(args.authzToken, args.userDetails);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class addRoleToUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addRoleToUser_args> {
+      public addRoleToUser() {
+        super("addRoleToUser");
+      }
+
+      public addRoleToUser_args getEmptyArgsInstance() {
+        return new addRoleToUser_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public addRoleToUser_result getResult(I iface, addRoleToUser_args args) throws org.apache.thrift.TException {
+        addRoleToUser_result result = new addRoleToUser_result();
+        try {
+          result.success = iface.addRoleToUser(args.authzToken, args.username, args.roleName, args.tenantAdminPasswordCredential);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class removeRoleFromUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeRoleFromUser_args> {
+      public removeRoleFromUser() {
+        super("removeRoleFromUser");
+      }
+
+      public removeRoleFromUser_args getEmptyArgsInstance() {
+        return new removeRoleFromUser_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public removeRoleFromUser_result getResult(I iface, removeRoleFromUser_args args) throws org.apache.thrift.TException {
+        removeRoleFromUser_result result = new removeRoleFromUser_result();
+        try {
+          result.success = iface.removeRoleFromUser(args.authzToken, args.username, args.roleName, args.tenantAdminPasswordCredential);
+          result.setSuccessIsSet(true);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+    public static class getUsersWithRole<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUsersWithRole_args> {
+      public getUsersWithRole() {
+        super("getUsersWithRole");
+      }
+
+      public getUsersWithRole_args getEmptyArgsInstance() {
+        return new getUsersWithRole_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      @Override
+      protected boolean rethrowUnhandledExceptions() {
+        return false;
+      }
+
+      public getUsersWithRole_result getResult(I iface, getUsersWithRole_args args) throws org.apache.thrift.TException {
+        getUsersWithRole_result result = new getUsersWithRole_result();
+        try {
+          result.success = iface.getUsersWithRole(args.authzToken, args.roleName, args.tenantAdminPasswordCredential);
+        } catch (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+          result.Idse = Idse;
+        }
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
+    public AsyncProcessor(I iface) {
+      super(iface, getProcessMap(new java.util.HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+    }
+
+    protected AsyncProcessor(I iface, java.util.Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends AsyncIface> java.util.Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      processMap.put("getAPIVersion", new getAPIVersion());
+      processMap.put("setUpGateway", new setUpGateway());
+      processMap.put("isUsernameAvailable", new isUsernameAvailable());
+      processMap.put("registerUser", new registerUser());
+      processMap.put("enableUser", new enableUser());
+      processMap.put("isUserEnabled", new isUserEnabled());
+      processMap.put("isUserExist", new isUserExist());
+      processMap.put("getUser", new getUser());
+      processMap.put("getUsers", new getUsers());
+      processMap.put("resetUserPassword", new resetUserPassword());
+      processMap.put("findUsers", new findUsers());
+      processMap.put("updateUserProfile", new updateUserProfile());
+      processMap.put("addRoleToUser", new addRoleToUser());
+      processMap.put("removeRoleFromUser", new removeRoleFromUser());
+      processMap.put("getUsersWithRole", new getUsersWithRole());
+      return processMap;
+    }
+
+    public static class getAPIVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAPIVersion_args, String> {
+      public getAPIVersion() {
+        super("getAPIVersion");
+      }
+
+      public getAPIVersion_args getEmptyArgsInstance() {
+        return new getAPIVersion_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<String>() {
+          public void onComplete(String o) {
+            getAPIVersion_result result = new getAPIVersion_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            getAPIVersion_result result = new getAPIVersion_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getAPIVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException {
+        iface.getAPIVersion(resultHandler);
+      }
+    }
+
+    public static class setUpGateway<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setUpGateway_args, org.apache.custos.profile.model.workspace.Gateway> {
+      public setUpGateway() {
+        super("setUpGateway");
+      }
+
+      public setUpGateway_args getEmptyArgsInstance() {
+        return new setUpGateway_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway>() { 
+          public void onComplete(org.apache.custos.profile.model.workspace.Gateway o) {
+            setUpGateway_result result = new setUpGateway_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            setUpGateway_result result = new setUpGateway_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, setUpGateway_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.workspace.Gateway> resultHandler) throws org.apache.thrift.TException {
+        iface.setUpGateway(args.authzToken, args.gateway, args.tenantAdminPasswordCredential,resultHandler);
+      }
+    }
+
+    public static class isUsernameAvailable<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isUsernameAvailable_args, Boolean> {
+      public isUsernameAvailable() {
+        super("isUsernameAvailable");
+      }
+
+      public isUsernameAvailable_args getEmptyArgsInstance() {
+        return new isUsernameAvailable_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            isUsernameAvailable_result result = new isUsernameAvailable_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            isUsernameAvailable_result result = new isUsernameAvailable_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, isUsernameAvailable_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.isUsernameAvailable(args.authzToken, args.username,resultHandler);
+      }
+    }
+
+    public static class registerUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerUser_args, Boolean> {
+      public registerUser() {
+        super("registerUser");
+      }
+
+      public registerUser_args getEmptyArgsInstance() {
+        return new registerUser_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            registerUser_result result = new registerUser_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            registerUser_result result = new registerUser_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, registerUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.registerUser(args.authzToken, args.username, args.emailAddress, args.firstName, args.lastName, args.newPassword,resultHandler);
+      }
+    }
+
+    public static class enableUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, enableUser_args, Boolean> {
+      public enableUser() {
+        super("enableUser");
+      }
+
+      public enableUser_args getEmptyArgsInstance() {
+        return new enableUser_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            enableUser_result result = new enableUser_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            enableUser_result result = new enableUser_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, enableUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.enableUser(args.authzToken, args.username,resultHandler);
+      }
+    }
+
+    public static class isUserEnabled<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isUserEnabled_args, Boolean> {
+      public isUserEnabled() {
+        super("isUserEnabled");
+      }
+
+      public isUserEnabled_args getEmptyArgsInstance() {
+        return new isUserEnabled_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            isUserEnabled_result result = new isUserEnabled_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            isUserEnabled_result result = new isUserEnabled_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, isUserEnabled_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.isUserEnabled(args.authzToken, args.username,resultHandler);
+      }
+    }
+
+    public static class isUserExist<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isUserExist_args, Boolean> {
+      public isUserExist() {
+        super("isUserExist");
+      }
+
+      public isUserExist_args getEmptyArgsInstance() {
+        return new isUserExist_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            isUserExist_result result = new isUserExist_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            isUserExist_result result = new isUserExist_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, isUserExist_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.isUserExist(args.authzToken, args.username,resultHandler);
+      }
+    }
+
+    public static class getUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUser_args, org.apache.custos.profile.model.user.UserProfile> {
+      public getUser() {
+        super("getUser");
+      }
+
+      public getUser_args getEmptyArgsInstance() {
+        return new getUser_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile>() { 
+          public void onComplete(org.apache.custos.profile.model.user.UserProfile o) {
+            getUser_result result = new getUser_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            getUser_result result = new getUser_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getUser_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.custos.profile.model.user.UserProfile> resultHandler) throws org.apache.thrift.TException {
+        iface.getUser(args.authzToken, args.username,resultHandler);
+      }
+    }
+
+    public static class getUsers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUsers_args, java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      public getUsers() {
+        super("getUsers");
+      }
+
+      public getUsers_args getEmptyArgsInstance() {
+        return new getUsers_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>>() { 
+          public void onComplete(java.util.List<org.apache.custos.profile.model.user.UserProfile> o) {
+            getUsers_result result = new getUsers_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            getUsers_result result = new getUsers_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getUsers_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+        iface.getUsers(args.authzToken, args.offset, args.limit, args.search,resultHandler);
+      }
+    }
+
+    public static class resetUserPassword<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, resetUserPassword_args, Boolean> {
+      public resetUserPassword() {
+        super("resetUserPassword");
+      }
+
+      public resetUserPassword_args getEmptyArgsInstance() {
+        return new resetUserPassword_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            resetUserPassword_result result = new resetUserPassword_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            resetUserPassword_result result = new resetUserPassword_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, resetUserPassword_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.resetUserPassword(args.authzToken, args.username, args.newPassword,resultHandler);
+      }
+    }
+
+    public static class findUsers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, findUsers_args, java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      public findUsers() {
+        super("findUsers");
+      }
+
+      public findUsers_args getEmptyArgsInstance() {
+        return new findUsers_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>>() { 
+          public void onComplete(java.util.List<org.apache.custos.profile.model.user.UserProfile> o) {
+            findUsers_result result = new findUsers_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            findUsers_result result = new findUsers_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, findUsers_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+        iface.findUsers(args.authzToken, args.email, args.userId,resultHandler);
+      }
+    }
+
+    public static class updateUserProfile<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateUserProfile_args, Void> {
+      public updateUserProfile() {
+        super("updateUserProfile");
+      }
+
+      public updateUserProfile_args getEmptyArgsInstance() {
+        return new updateUserProfile_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Void> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            updateUserProfile_result result = new updateUserProfile_result();
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            updateUserProfile_result result = new updateUserProfile_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, updateUserProfile_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
+        iface.updateUserProfile(args.authzToken, args.userDetails,resultHandler);
+      }
+    }
+
+    public static class addRoleToUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addRoleToUser_args, Boolean> {
+      public addRoleToUser() {
+        super("addRoleToUser");
+      }
+
+      public addRoleToUser_args getEmptyArgsInstance() {
+        return new addRoleToUser_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            addRoleToUser_result result = new addRoleToUser_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            addRoleToUser_result result = new addRoleToUser_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addRoleToUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.addRoleToUser(args.authzToken, args.username, args.roleName, args.tenantAdminPasswordCredential,resultHandler);
+      }
+    }
+
+    public static class removeRoleFromUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, removeRoleFromUser_args, Boolean> {
+      public removeRoleFromUser() {
+        super("removeRoleFromUser");
+      }
+
+      public removeRoleFromUser_args getEmptyArgsInstance() {
+        return new removeRoleFromUser_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() {
+          public void onComplete(Boolean o) {
+            removeRoleFromUser_result result = new removeRoleFromUser_result();
+            result.success = o;
+            result.setSuccessIsSet(true);
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            removeRoleFromUser_result result = new removeRoleFromUser_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, removeRoleFromUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException {
+        iface.removeRoleFromUser(args.authzToken, args.username, args.roleName, args.tenantAdminPasswordCredential,resultHandler);
+      }
+    }
+
+    public static class getUsersWithRole<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUsersWithRole_args, java.util.List<org.apache.custos.profile.model.user.UserProfile>> {
+      public getUsersWithRole() {
+        super("getUsersWithRole");
+      }
+
+      public getUsersWithRole_args getEmptyArgsInstance() {
+        return new getUsersWithRole_args();
+      }
+
+      public org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>>() { 
+          public void onComplete(java.util.List<org.apache.custos.profile.model.user.UserProfile> o) {
+            getUsersWithRole_result result = new getUsersWithRole_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+            } catch (org.apache.thrift.transport.TTransportException e) {
+              _LOGGER.error("TTransportException writing to internal frame buffer", e);
+              fb.close();
+            } catch (Exception e) {
+              _LOGGER.error("Exception writing to internal frame buffer", e);
+              onError(e);
+            }
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TSerializable msg;
+            getUsersWithRole_result result = new getUsersWithRole_result();
+            if (e instanceof org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) {
+              result.Idse = (org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException) e;
+              result.setIdseIsSet(true);
+              msg = result;
+            } else if (e instanceof org.apache.thrift.transport.TTransportException) {
+              _LOGGER.error("TTransportException inside handler", e);
+              fb.close();
+              return;
+            } else if (e instanceof org.apache.thrift.TApplicationException) {
+              _LOGGER.error("TApplicationException inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TApplicationException)e;
+            } else {
+              _LOGGER.error("Exception inside handler", e);
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+            } catch (Exception ex) {
+              _LOGGER.error("Exception writing to internal frame buffer", ex);
+              fb.close();
+            }
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getUsersWithRole_args args, org.apache.thrift.async.AsyncMethodCallback<java.util.List<org.apache.custos.profile.model.user.UserProfile>> resultHandler) throws org.apache.thrift.TException {
+        iface.getUsersWithRole(args.authzToken, args.roleName, args.tenantAdminPasswordCredential,resultHandler);
+      }
+    }
+
+  }
+
+  public static class getAPIVersion_args implements org.apache.thrift.TBase<getAPIVersion_args, getAPIVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAPIVersion_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAPIVersion_args");
+
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAPIVersion_argsStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAPIVersion_argsTupleSchemeFactory();
+
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+;
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_args.class, metaDataMap);
+    }
+
+    public getAPIVersion_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAPIVersion_args(getAPIVersion_args other) {
+    }
+
+    public getAPIVersion_args deepCopy() {
+      return new getAPIVersion_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAPIVersion_args)
+        return this.equals((getAPIVersion_args)that);
+      return false;
+    }
+
+    public boolean equals(getAPIVersion_args that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(getAPIVersion_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getAPIVersion_args(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getAPIVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public getAPIVersion_argsStandardScheme getScheme() {
+        return new getAPIVersion_argsStandardScheme();
+      }
+    }
+
+    private static class getAPIVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAPIVersion_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAPIVersion_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public getAPIVersion_argsTupleScheme getScheme() {
+        return new getAPIVersion_argsTupleScheme();
+      }
+    }
+
+    private static class getAPIVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAPIVersion_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class getAPIVersion_result implements org.apache.thrift.TBase<getAPIVersion_result, getAPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAPIVersion_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAPIVersion_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+    private static final org.apache.thrift.protocol.TField IDSE_FIELD_DESC = new org.apache.thrift.protocol.TField("Idse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAPIVersion_resultStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAPIVersion_resultTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable String success; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success"),
+      IDSE((short)1, "Idse");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IDSE
+            return IDSE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.IDSE, new org.apache.thrift.meta_data.FieldMetaData("Idse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAPIVersion_result.class, metaDataMap);
+    }
+
+    public getAPIVersion_result() {
+    }
+
+    public getAPIVersion_result(
+      String success,
+      org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse)
+    {
+      this();
+      this.success = success;
+      this.Idse = Idse;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAPIVersion_result(getAPIVersion_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+      if (other.isSetIdse()) {
+        this.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException(other.Idse);
+      }
+    }
+
+    public getAPIVersion_result deepCopy() {
+      return new getAPIVersion_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.Idse = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getAPIVersion_result setSuccess(@org.apache.thrift.annotation.Nullable String success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException getIdse() {
+      return this.Idse;
+    }
+
+    public getAPIVersion_result setIdse(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+      this.Idse = Idse;
+      return this;
+    }
+
+    public void unsetIdse() {
+      this.Idse = null;
+    }
+
+    /** Returns true if field Idse is set (has been assigned a value) and false otherwise */
+    public boolean isSetIdse() {
+      return this.Idse != null;
+    }
+
+    public void setIdseIsSet(boolean value) {
+      if (!value) {
+        this.Idse = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((String)value);
+        }
+        break;
+
+      case IDSE:
+        if (value == null) {
+          unsetIdse();
+        } else {
+          setIdse((org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case IDSE:
+        return getIdse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IDSE:
+        return isSetIdse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAPIVersion_result)
+        return this.equals((getAPIVersion_result)that);
+      return false;
+    }
+
+    public boolean equals(getAPIVersion_result that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_Idse = true && this.isSetIdse();
+      boolean that_present_Idse = true && that.isSetIdse();
+      if (this_present_Idse || that_present_Idse) {
+        if (!(this_present_Idse && that_present_Idse))
+          return false;
+        if (!this.Idse.equals(that.Idse))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
+      if (isSetSuccess())
+        hashCode = hashCode * 8191 + success.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetIdse()) ? 131071 : 524287);
+      if (isSetIdse())
+        hashCode = hashCode * 8191 + Idse.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(getAPIVersion_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIdse()).compareTo(other.isSetIdse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIdse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Idse, other.Idse);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("getAPIVersion_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("Idse:");
+      if (this.Idse == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.Idse);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class getAPIVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public getAPIVersion_resultStandardScheme getScheme() {
+        return new getAPIVersion_resultStandardScheme();
+      }
+    }
+
+    private static class getAPIVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getAPIVersion_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.success = iprot.readString();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // IDSE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+                struct.Idse.read(iprot);
+                struct.setIdseIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeString(struct.success);
+          oprot.writeFieldEnd();
+        }
+        if (struct.Idse != null) {
+          oprot.writeFieldBegin(IDSE_FIELD_DESC);
+          struct.Idse.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAPIVersion_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public getAPIVersion_resultTupleScheme getScheme() {
+        return new getAPIVersion_resultTupleScheme();
+      }
+    }
+
+    private static class getAPIVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getAPIVersion_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet optionals = new java.util.BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetIdse()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          oprot.writeString(struct.success);
+        }
+        if (struct.isSetIdse()) {
+          struct.Idse.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAPIVersion_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = iprot.readString();
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+          struct.Idse.read(iprot);
+          struct.setIdseIsSet(true);
+        }
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class setUpGateway_args implements org.apache.thrift.TBase<setUpGateway_args, setUpGateway_args._Fields>, java.io.Serializable, Cloneable, Comparable<setUpGateway_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setUpGateway_args");
+
+    private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField GATEWAY_FIELD_DESC = new org.apache.thrift.protocol.TField("gateway", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField TENANT_ADMIN_PASSWORD_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("tenantAdminPasswordCredential", org.apache.thrift.protocol.TType.STRUCT, (short)3);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new setUpGateway_argsStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new setUpGateway_argsTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.workspace.Gateway gateway; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      AUTHZ_TOKEN((short)1, "authzToken"),
+      GATEWAY((short)2, "gateway"),
+      TENANT_ADMIN_PASSWORD_CREDENTIAL((short)3, "tenantAdminPasswordCredential");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // AUTHZ_TOKEN
+            return AUTHZ_TOKEN;
+          case 2: // GATEWAY
+            return GATEWAY;
+          case 3: // TENANT_ADMIN_PASSWORD_CREDENTIAL
+            return TENANT_ADMIN_PASSWORD_CREDENTIAL;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.commons.model.security.AuthzToken.class)));
+      tmpMap.put(_Fields.GATEWAY, new org.apache.thrift.meta_data.FieldMetaData("gateway", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.model.workspace.Gateway.class)));
+      tmpMap.put(_Fields.TENANT_ADMIN_PASSWORD_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("tenantAdminPasswordCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.model.tenant.PasswordCredential.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setUpGateway_args.class, metaDataMap);
+    }
+
+    public setUpGateway_args() {
+    }
+
+    public setUpGateway_args(
+      org.apache.custos.commons.model.security.AuthzToken authzToken,
+      org.apache.custos.profile.model.workspace.Gateway gateway,
+      org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential)
+    {
+      this();
+      this.authzToken = authzToken;
+      this.gateway = gateway;
+      this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public setUpGateway_args(setUpGateway_args other) {
+      if (other.isSetAuthzToken()) {
+        this.authzToken = new org.apache.custos.commons.model.security.AuthzToken(other.authzToken);
+      }
+      if (other.isSetGateway()) {
+        this.gateway = new org.apache.custos.profile.model.workspace.Gateway(other.gateway);
+      }
+      if (other.isSetTenantAdminPasswordCredential()) {
+        this.tenantAdminPasswordCredential = new org.apache.custos.profile.model.tenant.PasswordCredential(other.tenantAdminPasswordCredential);
+      }
+    }
+
+    public setUpGateway_args deepCopy() {
+      return new setUpGateway_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.authzToken = null;
+      this.gateway = null;
+      this.tenantAdminPasswordCredential = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.commons.model.security.AuthzToken getAuthzToken() {
+      return this.authzToken;
+    }
+
+    public setUpGateway_args setAuthzToken(@org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken) {
+      this.authzToken = authzToken;
+      return this;
+    }
+
+    public void unsetAuthzToken() {
+      this.authzToken = null;
+    }
+
+    /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
+    public boolean isSetAuthzToken() {
+      return this.authzToken != null;
+    }
+
+    public void setAuthzTokenIsSet(boolean value) {
+      if (!value) {
+        this.authzToken = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.model.workspace.Gateway getGateway() {
+      return this.gateway;
+    }
+
+    public setUpGateway_args setGateway(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.workspace.Gateway gateway) {
+      this.gateway = gateway;
+      return this;
+    }
+
+    public void unsetGateway() {
+      this.gateway = null;
+    }
+
+    /** Returns true if field gateway is set (has been assigned a value) and false otherwise */
+    public boolean isSetGateway() {
+      return this.gateway != null;
+    }
+
+    public void setGatewayIsSet(boolean value) {
+      if (!value) {
+        this.gateway = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.model.tenant.PasswordCredential getTenantAdminPasswordCredential() {
+      return this.tenantAdminPasswordCredential;
+    }
+
+    public setUpGateway_args setTenantAdminPasswordCredential(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.tenant.PasswordCredential tenantAdminPasswordCredential) {
+      this.tenantAdminPasswordCredential = tenantAdminPasswordCredential;
+      return this;
+    }
+
+    public void unsetTenantAdminPasswordCredential() {
+      this.tenantAdminPasswordCredential = null;
+    }
+
+    /** Returns true if field tenantAdminPasswordCredential is set (has been assigned a value) and false otherwise */
+    public boolean isSetTenantAdminPasswordCredential() {
+      return this.tenantAdminPasswordCredential != null;
+    }
+
+    public void setTenantAdminPasswordCredentialIsSet(boolean value) {
+      if (!value) {
+        this.tenantAdminPasswordCredential = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        if (value == null) {
+          unsetAuthzToken();
+        } else {
+          setAuthzToken((org.apache.custos.commons.model.security.AuthzToken)value);
+        }
+        break;
+
+      case GATEWAY:
+        if (value == null) {
+          unsetGateway();
+        } else {
+          setGateway((org.apache.custos.profile.model.workspace.Gateway)value);
+        }
+        break;
+
+      case TENANT_ADMIN_PASSWORD_CREDENTIAL:
+        if (value == null) {
+          unsetTenantAdminPasswordCredential();
+        } else {
+          setTenantAdminPasswordCredential((org.apache.custos.profile.model.tenant.PasswordCredential)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return getAuthzToken();
+
+      case GATEWAY:
+        return getGateway();
+
+      case TENANT_ADMIN_PASSWORD_CREDENTIAL:
+        return getTenantAdminPasswordCredential();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return isSetAuthzToken();
+      case GATEWAY:
+        return isSetGateway();
+      case TENANT_ADMIN_PASSWORD_CREDENTIAL:
+        return isSetTenantAdminPasswordCredential();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof setUpGateway_args)
+        return this.equals((setUpGateway_args)that);
+      return false;
+    }
+
+    public boolean equals(setUpGateway_args that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_authzToken = true && this.isSetAuthzToken();
+      boolean that_present_authzToken = true && that.isSetAuthzToken();
+      if (this_present_authzToken || that_present_authzToken) {
+        if (!(this_present_authzToken && that_present_authzToken))
+          return false;
+        if (!this.authzToken.equals(that.authzToken))
+          return false;
+      }
+
+      boolean this_present_gateway = true && this.isSetGateway();
+      boolean that_present_gateway = true && that.isSetGateway();
+      if (this_present_gateway || that_present_gateway) {
+        if (!(this_present_gateway && that_present_gateway))
+          return false;
+        if (!this.gateway.equals(that.gateway))
+          return false;
+      }
+
+      boolean this_present_tenantAdminPasswordCredential = true && this.isSetTenantAdminPasswordCredential();
+      boolean that_present_tenantAdminPasswordCredential = true && that.isSetTenantAdminPasswordCredential();
+      if (this_present_tenantAdminPasswordCredential || that_present_tenantAdminPasswordCredential) {
+        if (!(this_present_tenantAdminPasswordCredential && that_present_tenantAdminPasswordCredential))
+          return false;
+        if (!this.tenantAdminPasswordCredential.equals(that.tenantAdminPasswordCredential))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetAuthzToken()) ? 131071 : 524287);
+      if (isSetAuthzToken())
+        hashCode = hashCode * 8191 + authzToken.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetGateway()) ? 131071 : 524287);
+      if (isSetGateway())
+        hashCode = hashCode * 8191 + gateway.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetTenantAdminPasswordCredential()) ? 131071 : 524287);
+      if (isSetTenantAdminPasswordCredential())
+        hashCode = hashCode * 8191 + tenantAdminPasswordCredential.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(setUpGateway_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAuthzToken()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetGateway()).compareTo(other.isSetGateway());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetGateway()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gateway, other.gateway);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetTenantAdminPasswordCredential()).compareTo(other.isSetTenantAdminPasswordCredential());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetTenantAdminPasswordCredential()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tenantAdminPasswordCredential, other.tenantAdminPasswordCredential);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("setUpGateway_args(");
+      boolean first = true;
+
+      sb.append("authzToken:");
+      if (this.authzToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authzToken);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("gateway:");
+      if (this.gateway == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.gateway);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("tenantAdminPasswordCredential:");
+      if (this.tenantAdminPasswordCredential == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.tenantAdminPasswordCredential);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (authzToken == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
+      }
+      if (gateway == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'gateway' was not present! Struct: " + toString());
+      }
+      if (tenantAdminPasswordCredential == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'tenantAdminPasswordCredential' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (authzToken != null) {
+        authzToken.validate();
+      }
+      if (gateway != null) {
+        gateway.validate();
+      }
+      if (tenantAdminPasswordCredential != null) {
+        tenantAdminPasswordCredential.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class setUpGateway_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public setUpGateway_argsStandardScheme getScheme() {
+        return new setUpGateway_argsStandardScheme();
+      }
+    }
+
+    private static class setUpGateway_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<setUpGateway_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, setUpGateway_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // AUTHZ_TOKEN
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+                struct.authzToken.read(iprot);
+                struct.setAuthzTokenIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // GATEWAY
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.gateway = new org.apache.custos.profile.model.workspace.Gateway();
+                struct.gateway.read(iprot);
+                struct.setGatewayIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // TENANT_ADMIN_PASSWORD_CREDENTIAL
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.tenantAdminPasswordCredential = new org.apache.custos.profile.model.tenant.PasswordCredential();
+                struct.tenantAdminPasswordCredential.read(iprot);
+                struct.setTenantAdminPasswordCredentialIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, setUpGateway_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.authzToken != null) {
+          oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
+          struct.authzToken.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.gateway != null) {
+          oprot.writeFieldBegin(GATEWAY_FIELD_DESC);
+          struct.gateway.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.tenantAdminPasswordCredential != null) {
+          oprot.writeFieldBegin(TENANT_ADMIN_PASSWORD_CREDENTIAL_FIELD_DESC);
+          struct.tenantAdminPasswordCredential.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class setUpGateway_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public setUpGateway_argsTupleScheme getScheme() {
+        return new setUpGateway_argsTupleScheme();
+      }
+    }
+
+    private static class setUpGateway_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<setUpGateway_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, setUpGateway_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken.write(oprot);
+        struct.gateway.write(oprot);
+        struct.tenantAdminPasswordCredential.write(oprot);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, setUpGateway_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+        struct.authzToken.read(iprot);
+        struct.setAuthzTokenIsSet(true);
+        struct.gateway = new org.apache.custos.profile.model.workspace.Gateway();
+        struct.gateway.read(iprot);
+        struct.setGatewayIsSet(true);
+        struct.tenantAdminPasswordCredential = new org.apache.custos.profile.model.tenant.PasswordCredential();
+        struct.tenantAdminPasswordCredential.read(iprot);
+        struct.setTenantAdminPasswordCredentialIsSet(true);
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class setUpGateway_result implements org.apache.thrift.TBase<setUpGateway_result, setUpGateway_result._Fields>, java.io.Serializable, Cloneable, Comparable<setUpGateway_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setUpGateway_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
+    private static final org.apache.thrift.protocol.TField IDSE_FIELD_DESC = new org.apache.thrift.protocol.TField("Idse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new setUpGateway_resultStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new setUpGateway_resultTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.workspace.Gateway success; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success"),
+      IDSE((short)1, "Idse");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IDSE
+            return IDSE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.model.workspace.Gateway.class)));
+      tmpMap.put(_Fields.IDSE, new org.apache.thrift.meta_data.FieldMetaData("Idse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setUpGateway_result.class, metaDataMap);
+    }
+
+    public setUpGateway_result() {
+    }
+
+    public setUpGateway_result(
+      org.apache.custos.profile.model.workspace.Gateway success,
+      org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse)
+    {
+      this();
+      this.success = success;
+      this.Idse = Idse;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public setUpGateway_result(setUpGateway_result other) {
+      if (other.isSetSuccess()) {
+        this.success = new org.apache.custos.profile.model.workspace.Gateway(other.success);
+      }
+      if (other.isSetIdse()) {
+        this.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException(other.Idse);
+      }
+    }
+
+    public setUpGateway_result deepCopy() {
+      return new setUpGateway_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.Idse = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.model.workspace.Gateway getSuccess() {
+      return this.success;
+    }
+
+    public setUpGateway_result setSuccess(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.model.workspace.Gateway success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException getIdse() {
+      return this.Idse;
+    }
+
+    public setUpGateway_result setIdse(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+      this.Idse = Idse;
+      return this;
+    }
+
+    public void unsetIdse() {
+      this.Idse = null;
+    }
+
+    /** Returns true if field Idse is set (has been assigned a value) and false otherwise */
+    public boolean isSetIdse() {
+      return this.Idse != null;
+    }
+
+    public void setIdseIsSet(boolean value) {
+      if (!value) {
+        this.Idse = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((org.apache.custos.profile.model.workspace.Gateway)value);
+        }
+        break;
+
+      case IDSE:
+        if (value == null) {
+          unsetIdse();
+        } else {
+          setIdse((org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case IDSE:
+        return getIdse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IDSE:
+        return isSetIdse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof setUpGateway_result)
+        return this.equals((setUpGateway_result)that);
+      return false;
+    }
+
+    public boolean equals(setUpGateway_result that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_Idse = true && this.isSetIdse();
+      boolean that_present_Idse = true && that.isSetIdse();
+      if (this_present_Idse || that_present_Idse) {
+        if (!(this_present_Idse && that_present_Idse))
+          return false;
+        if (!this.Idse.equals(that.Idse))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
+      if (isSetSuccess())
+        hashCode = hashCode * 8191 + success.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetIdse()) ? 131071 : 524287);
+      if (isSetIdse())
+        hashCode = hashCode * 8191 + Idse.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(setUpGateway_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIdse()).compareTo(other.isSetIdse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIdse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Idse, other.Idse);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("setUpGateway_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("Idse:");
+      if (this.Idse == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.Idse);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+      if (success != null) {
+        success.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class setUpGateway_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public setUpGateway_resultStandardScheme getScheme() {
+        return new setUpGateway_resultStandardScheme();
+      }
+    }
+
+    private static class setUpGateway_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<setUpGateway_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, setUpGateway_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.success = new org.apache.custos.profile.model.workspace.Gateway();
+                struct.success.read(iprot);
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // IDSE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+                struct.Idse.read(iprot);
+                struct.setIdseIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, setUpGateway_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          struct.success.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.Idse != null) {
+          oprot.writeFieldBegin(IDSE_FIELD_DESC);
+          struct.Idse.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class setUpGateway_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public setUpGateway_resultTupleScheme getScheme() {
+        return new setUpGateway_resultTupleScheme();
+      }
+    }
+
+    private static class setUpGateway_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<setUpGateway_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, setUpGateway_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet optionals = new java.util.BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetIdse()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          struct.success.write(oprot);
+        }
+        if (struct.isSetIdse()) {
+          struct.Idse.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, setUpGateway_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = new org.apache.custos.profile.model.workspace.Gateway();
+          struct.success.read(iprot);
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+          struct.Idse.read(iprot);
+          struct.setIdseIsSet(true);
+        }
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class isUsernameAvailable_args implements org.apache.thrift.TBase<isUsernameAvailable_args, isUsernameAvailable_args._Fields>, java.io.Serializable, Cloneable, Comparable<isUsernameAvailable_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isUsernameAvailable_args");
+
+    private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isUsernameAvailable_argsStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isUsernameAvailable_argsTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken; // required
+    public @org.apache.thrift.annotation.Nullable String username; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      AUTHZ_TOKEN((short)1, "authzToken"),
+      USERNAME((short)2, "username");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // AUTHZ_TOKEN
+            return AUTHZ_TOKEN;
+          case 2: // USERNAME
+            return USERNAME;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.commons.model.security.AuthzToken.class)));
+      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isUsernameAvailable_args.class, metaDataMap);
+    }
+
+    public isUsernameAvailable_args() {
+    }
+
+    public isUsernameAvailable_args(
+      org.apache.custos.commons.model.security.AuthzToken authzToken,
+      String username)
+    {
+      this();
+      this.authzToken = authzToken;
+      this.username = username;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public isUsernameAvailable_args(isUsernameAvailable_args other) {
+      if (other.isSetAuthzToken()) {
+        this.authzToken = new org.apache.custos.commons.model.security.AuthzToken(other.authzToken);
+      }
+      if (other.isSetUsername()) {
+        this.username = other.username;
+      }
+    }
+
+    public isUsernameAvailable_args deepCopy() {
+      return new isUsernameAvailable_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.authzToken = null;
+      this.username = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.commons.model.security.AuthzToken getAuthzToken() {
+      return this.authzToken;
+    }
+
+    public isUsernameAvailable_args setAuthzToken(@org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken) {
+      this.authzToken = authzToken;
+      return this;
+    }
+
+    public void unsetAuthzToken() {
+      this.authzToken = null;
+    }
+
+    /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
+    public boolean isSetAuthzToken() {
+      return this.authzToken != null;
+    }
+
+    public void setAuthzTokenIsSet(boolean value) {
+      if (!value) {
+        this.authzToken = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getUsername() {
+      return this.username;
+    }
+
+    public isUsernameAvailable_args setUsername(@org.apache.thrift.annotation.Nullable String username) {
+      this.username = username;
+      return this;
+    }
+
+    public void unsetUsername() {
+      this.username = null;
+    }
+
+    /** Returns true if field username is set (has been assigned a value) and false otherwise */
+    public boolean isSetUsername() {
+      return this.username != null;
+    }
+
+    public void setUsernameIsSet(boolean value) {
+      if (!value) {
+        this.username = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        if (value == null) {
+          unsetAuthzToken();
+        } else {
+          setAuthzToken((org.apache.custos.commons.model.security.AuthzToken)value);
+        }
+        break;
+
+      case USERNAME:
+        if (value == null) {
+          unsetUsername();
+        } else {
+          setUsername((String)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return getAuthzToken();
+
+      case USERNAME:
+        return getUsername();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return isSetAuthzToken();
+      case USERNAME:
+        return isSetUsername();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof isUsernameAvailable_args)
+        return this.equals((isUsernameAvailable_args)that);
+      return false;
+    }
+
+    public boolean equals(isUsernameAvailable_args that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_authzToken = true && this.isSetAuthzToken();
+      boolean that_present_authzToken = true && that.isSetAuthzToken();
+      if (this_present_authzToken || that_present_authzToken) {
+        if (!(this_present_authzToken && that_present_authzToken))
+          return false;
+        if (!this.authzToken.equals(that.authzToken))
+          return false;
+      }
+
+      boolean this_present_username = true && this.isSetUsername();
+      boolean that_present_username = true && that.isSetUsername();
+      if (this_present_username || that_present_username) {
+        if (!(this_present_username && that_present_username))
+          return false;
+        if (!this.username.equals(that.username))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetAuthzToken()) ? 131071 : 524287);
+      if (isSetAuthzToken())
+        hashCode = hashCode * 8191 + authzToken.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
+      if (isSetUsername())
+        hashCode = hashCode * 8191 + username.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(isUsernameAvailable_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAuthzToken()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetUsername()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("isUsernameAvailable_args(");
+      boolean first = true;
+
+      sb.append("authzToken:");
+      if (this.authzToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authzToken);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("username:");
+      if (this.username == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.username);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (authzToken == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
+      }
+      if (username == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (authzToken != null) {
+        authzToken.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class isUsernameAvailable_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public isUsernameAvailable_argsStandardScheme getScheme() {
+        return new isUsernameAvailable_argsStandardScheme();
+      }
+    }
+
+    private static class isUsernameAvailable_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<isUsernameAvailable_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, isUsernameAvailable_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // AUTHZ_TOKEN
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+                struct.authzToken.read(iprot);
+                struct.setAuthzTokenIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // USERNAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.username = iprot.readString();
+                struct.setUsernameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, isUsernameAvailable_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.authzToken != null) {
+          oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
+          struct.authzToken.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.username != null) {
+          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+          oprot.writeString(struct.username);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class isUsernameAvailable_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public isUsernameAvailable_argsTupleScheme getScheme() {
+        return new isUsernameAvailable_argsTupleScheme();
+      }
+    }
+
+    private static class isUsernameAvailable_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<isUsernameAvailable_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, isUsernameAvailable_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken.write(oprot);
+        oprot.writeString(struct.username);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, isUsernameAvailable_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+        struct.authzToken.read(iprot);
+        struct.setAuthzTokenIsSet(true);
+        struct.username = iprot.readString();
+        struct.setUsernameIsSet(true);
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class isUsernameAvailable_result implements org.apache.thrift.TBase<isUsernameAvailable_result, isUsernameAvailable_result._Fields>, java.io.Serializable, Cloneable, Comparable<isUsernameAvailable_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isUsernameAvailable_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+    private static final org.apache.thrift.protocol.TField IDSE_FIELD_DESC = new org.apache.thrift.protocol.TField("Idse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new isUsernameAvailable_resultStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new isUsernameAvailable_resultTupleSchemeFactory();
+
+    public boolean success; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success"),
+      IDSE((short)1, "Idse");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IDSE
+            return IDSE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    private static final int __SUCCESS_ISSET_ID = 0;
+    private byte __isset_bitfield = 0;
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+      tmpMap.put(_Fields.IDSE, new org.apache.thrift.meta_data.FieldMetaData("Idse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isUsernameAvailable_result.class, metaDataMap);
+    }
+
+    public isUsernameAvailable_result() {
+    }
+
+    public isUsernameAvailable_result(
+      boolean success,
+      org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse)
+    {
+      this();
+      this.success = success;
+      setSuccessIsSet(true);
+      this.Idse = Idse;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public isUsernameAvailable_result(isUsernameAvailable_result other) {
+      __isset_bitfield = other.__isset_bitfield;
+      this.success = other.success;
+      if (other.isSetIdse()) {
+        this.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException(other.Idse);
+      }
+    }
+
+    public isUsernameAvailable_result deepCopy() {
+      return new isUsernameAvailable_result(this);
+    }
+
+    @Override
+    public void clear() {
+      setSuccessIsSet(false);
+      this.success = false;
+      this.Idse = null;
+    }
+
+    public boolean isSuccess() {
+      return this.success;
+    }
+
+    public isUsernameAvailable_result setSuccess(boolean success) {
+      this.success = success;
+      setSuccessIsSet(true);
+      return this;
+    }
+
+    public void unsetSuccess() {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException getIdse() {
+      return this.Idse;
+    }
+
+    public isUsernameAvailable_result setIdse(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+      this.Idse = Idse;
+      return this;
+    }
+
+    public void unsetIdse() {
+      this.Idse = null;
+    }
+
+    /** Returns true if field Idse is set (has been assigned a value) and false otherwise */
+    public boolean isSetIdse() {
+      return this.Idse != null;
+    }
+
+    public void setIdseIsSet(boolean value) {
+      if (!value) {
+        this.Idse = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((Boolean)value);
+        }
+        break;
+
+      case IDSE:
+        if (value == null) {
+          unsetIdse();
+        } else {
+          setIdse((org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return isSuccess();
+
+      case IDSE:
+        return getIdse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IDSE:
+        return isSetIdse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof isUsernameAvailable_result)
+        return this.equals((isUsernameAvailable_result)that);
+      return false;
+    }
+
+    public boolean equals(isUsernameAvailable_result that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_success = true;
+      boolean that_present_success = true;
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (this.success != that.success)
+          return false;
+      }
+
+      boolean this_present_Idse = true && this.isSetIdse();
+      boolean that_present_Idse = true && that.isSetIdse();
+      if (this_present_Idse || that_present_Idse) {
+        if (!(this_present_Idse && that_present_Idse))
+          return false;
+        if (!this.Idse.equals(that.Idse))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
+
+      hashCode = hashCode * 8191 + ((isSetIdse()) ? 131071 : 524287);
+      if (isSetIdse())
+        hashCode = hashCode * 8191 + Idse.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(isUsernameAvailable_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIdse()).compareTo(other.isSetIdse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIdse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Idse, other.Idse);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("isUsernameAvailable_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      sb.append(this.success);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("Idse:");
+      if (this.Idse == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.Idse);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class isUsernameAvailable_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public isUsernameAvailable_resultStandardScheme getScheme() {
+        return new isUsernameAvailable_resultStandardScheme();
+      }
+    }
+
+    private static class isUsernameAvailable_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<isUsernameAvailable_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, isUsernameAvailable_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+                struct.success = iprot.readBool();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // IDSE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+                struct.Idse.read(iprot);
+                struct.setIdseIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, isUsernameAvailable_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.isSetSuccess()) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeBool(struct.success);
+          oprot.writeFieldEnd();
+        }
+        if (struct.Idse != null) {
+          oprot.writeFieldBegin(IDSE_FIELD_DESC);
+          struct.Idse.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class isUsernameAvailable_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public isUsernameAvailable_resultTupleScheme getScheme() {
+        return new isUsernameAvailable_resultTupleScheme();
+      }
+    }
+
+    private static class isUsernameAvailable_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<isUsernameAvailable_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, isUsernameAvailable_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet optionals = new java.util.BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetIdse()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          oprot.writeBool(struct.success);
+        }
+        if (struct.isSetIdse()) {
+          struct.Idse.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, isUsernameAvailable_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = iprot.readBool();
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+          struct.Idse.read(iprot);
+          struct.setIdseIsSet(true);
+        }
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class registerUser_args implements org.apache.thrift.TBase<registerUser_args, registerUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerUser_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerUser_args");
+
+    private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField EMAIL_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("emailAddress", org.apache.thrift.protocol.TType.STRING, (short)3);
+    private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)4);
+    private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)5);
+    private static final org.apache.thrift.protocol.TField NEW_PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("newPassword", org.apache.thrift.protocol.TType.STRING, (short)6);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new registerUser_argsStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new registerUser_argsTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken; // required
+    public @org.apache.thrift.annotation.Nullable String username; // required
+    public @org.apache.thrift.annotation.Nullable String emailAddress; // required
+    public @org.apache.thrift.annotation.Nullable String firstName; // required
+    public @org.apache.thrift.annotation.Nullable String lastName; // required
+    public @org.apache.thrift.annotation.Nullable String newPassword; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      AUTHZ_TOKEN((short)1, "authzToken"),
+      USERNAME((short)2, "username"),
+      EMAIL_ADDRESS((short)3, "emailAddress"),
+      FIRST_NAME((short)4, "firstName"),
+      LAST_NAME((short)5, "lastName"),
+      NEW_PASSWORD((short)6, "newPassword");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // AUTHZ_TOKEN
+            return AUTHZ_TOKEN;
+          case 2: // USERNAME
+            return USERNAME;
+          case 3: // EMAIL_ADDRESS
+            return EMAIL_ADDRESS;
+          case 4: // FIRST_NAME
+            return FIRST_NAME;
+          case 5: // LAST_NAME
+            return LAST_NAME;
+          case 6: // NEW_PASSWORD
+            return NEW_PASSWORD;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.commons.model.security.AuthzToken.class)));
+      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.EMAIL_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("emailAddress", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.FIRST_NAME, new org.apache.thrift.meta_data.FieldMetaData("firstName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.LAST_NAME, new org.apache.thrift.meta_data.FieldMetaData("lastName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.NEW_PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("newPassword", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerUser_args.class, metaDataMap);
+    }
+
+    public registerUser_args() {
+    }
+
+    public registerUser_args(
+      org.apache.custos.commons.model.security.AuthzToken authzToken,
+      String username,
+      String emailAddress,
+      String firstName,
+      String lastName,
+      String newPassword)
+    {
+      this();
+      this.authzToken = authzToken;
+      this.username = username;
+      this.emailAddress = emailAddress;
+      this.firstName = firstName;
+      this.lastName = lastName;
+      this.newPassword = newPassword;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerUser_args(registerUser_args other) {
+      if (other.isSetAuthzToken()) {
+        this.authzToken = new org.apache.custos.commons.model.security.AuthzToken(other.authzToken);
+      }
+      if (other.isSetUsername()) {
+        this.username = other.username;
+      }
+      if (other.isSetEmailAddress()) {
+        this.emailAddress = other.emailAddress;
+      }
+      if (other.isSetFirstName()) {
+        this.firstName = other.firstName;
+      }
+      if (other.isSetLastName()) {
+        this.lastName = other.lastName;
+      }
+      if (other.isSetNewPassword()) {
+        this.newPassword = other.newPassword;
+      }
+    }
+
+    public registerUser_args deepCopy() {
+      return new registerUser_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.authzToken = null;
+      this.username = null;
+      this.emailAddress = null;
+      this.firstName = null;
+      this.lastName = null;
+      this.newPassword = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.commons.model.security.AuthzToken getAuthzToken() {
+      return this.authzToken;
+    }
+
+    public registerUser_args setAuthzToken(@org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken) {
+      this.authzToken = authzToken;
+      return this;
+    }
+
+    public void unsetAuthzToken() {
+      this.authzToken = null;
+    }
+
+    /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
+    public boolean isSetAuthzToken() {
+      return this.authzToken != null;
+    }
+
+    public void setAuthzTokenIsSet(boolean value) {
+      if (!value) {
+        this.authzToken = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getUsername() {
+      return this.username;
+    }
+
+    public registerUser_args setUsername(@org.apache.thrift.annotation.Nullable String username) {
+      this.username = username;
+      return this;
+    }
+
+    public void unsetUsername() {
+      this.username = null;
+    }
+
+    /** Returns true if field username is set (has been assigned a value) and false otherwise */
+    public boolean isSetUsername() {
+      return this.username != null;
+    }
+
+    public void setUsernameIsSet(boolean value) {
+      if (!value) {
+        this.username = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getEmailAddress() {
+      return this.emailAddress;
+    }
+
+    public registerUser_args setEmailAddress(@org.apache.thrift.annotation.Nullable String emailAddress) {
+      this.emailAddress = emailAddress;
+      return this;
+    }
+
+    public void unsetEmailAddress() {
+      this.emailAddress = null;
+    }
+
+    /** Returns true if field emailAddress is set (has been assigned a value) and false otherwise */
+    public boolean isSetEmailAddress() {
+      return this.emailAddress != null;
+    }
+
+    public void setEmailAddressIsSet(boolean value) {
+      if (!value) {
+        this.emailAddress = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getFirstName() {
+      return this.firstName;
+    }
+
+    public registerUser_args setFirstName(@org.apache.thrift.annotation.Nullable String firstName) {
+      this.firstName = firstName;
+      return this;
+    }
+
+    public void unsetFirstName() {
+      this.firstName = null;
+    }
+
+    /** Returns true if field firstName is set (has been assigned a value) and false otherwise */
+    public boolean isSetFirstName() {
+      return this.firstName != null;
+    }
+
+    public void setFirstNameIsSet(boolean value) {
+      if (!value) {
+        this.firstName = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getLastName() {
+      return this.lastName;
+    }
+
+    public registerUser_args setLastName(@org.apache.thrift.annotation.Nullable String lastName) {
+      this.lastName = lastName;
+      return this;
+    }
+
+    public void unsetLastName() {
+      this.lastName = null;
+    }
+
+    /** Returns true if field lastName is set (has been assigned a value) and false otherwise */
+    public boolean isSetLastName() {
+      return this.lastName != null;
+    }
+
+    public void setLastNameIsSet(boolean value) {
+      if (!value) {
+        this.lastName = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getNewPassword() {
+      return this.newPassword;
+    }
+
+    public registerUser_args setNewPassword(@org.apache.thrift.annotation.Nullable String newPassword) {
+      this.newPassword = newPassword;
+      return this;
+    }
+
+    public void unsetNewPassword() {
+      this.newPassword = null;
+    }
+
+    /** Returns true if field newPassword is set (has been assigned a value) and false otherwise */
+    public boolean isSetNewPassword() {
+      return this.newPassword != null;
+    }
+
+    public void setNewPasswordIsSet(boolean value) {
+      if (!value) {
+        this.newPassword = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        if (value == null) {
+          unsetAuthzToken();
+        } else {
+          setAuthzToken((org.apache.custos.commons.model.security.AuthzToken)value);
+        }
+        break;
+
+      case USERNAME:
+        if (value == null) {
+          unsetUsername();
+        } else {
+          setUsername((String)value);
+        }
+        break;
+
+      case EMAIL_ADDRESS:
+        if (value == null) {
+          unsetEmailAddress();
+        } else {
+          setEmailAddress((String)value);
+        }
+        break;
+
+      case FIRST_NAME:
+        if (value == null) {
+          unsetFirstName();
+        } else {
+          setFirstName((String)value);
+        }
+        break;
+
+      case LAST_NAME:
+        if (value == null) {
+          unsetLastName();
+        } else {
+          setLastName((String)value);
+        }
+        break;
+
+      case NEW_PASSWORD:
+        if (value == null) {
+          unsetNewPassword();
+        } else {
+          setNewPassword((String)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return getAuthzToken();
+
+      case USERNAME:
+        return getUsername();
+
+      case EMAIL_ADDRESS:
+        return getEmailAddress();
+
+      case FIRST_NAME:
+        return getFirstName();
+
+      case LAST_NAME:
+        return getLastName();
+
+      case NEW_PASSWORD:
+        return getNewPassword();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return isSetAuthzToken();
+      case USERNAME:
+        return isSetUsername();
+      case EMAIL_ADDRESS:
+        return isSetEmailAddress();
+      case FIRST_NAME:
+        return isSetFirstName();
+      case LAST_NAME:
+        return isSetLastName();
+      case NEW_PASSWORD:
+        return isSetNewPassword();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof registerUser_args)
+        return this.equals((registerUser_args)that);
+      return false;
+    }
+
+    public boolean equals(registerUser_args that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_authzToken = true && this.isSetAuthzToken();
+      boolean that_present_authzToken = true && that.isSetAuthzToken();
+      if (this_present_authzToken || that_present_authzToken) {
+        if (!(this_present_authzToken && that_present_authzToken))
+          return false;
+        if (!this.authzToken.equals(that.authzToken))
+          return false;
+      }
+
+      boolean this_present_username = true && this.isSetUsername();
+      boolean that_present_username = true && that.isSetUsername();
+      if (this_present_username || that_present_username) {
+        if (!(this_present_username && that_present_username))
+          return false;
+        if (!this.username.equals(that.username))
+          return false;
+      }
+
+      boolean this_present_emailAddress = true && this.isSetEmailAddress();
+      boolean that_present_emailAddress = true && that.isSetEmailAddress();
+      if (this_present_emailAddress || that_present_emailAddress) {
+        if (!(this_present_emailAddress && that_present_emailAddress))
+          return false;
+        if (!this.emailAddress.equals(that.emailAddress))
+          return false;
+      }
+
+      boolean this_present_firstName = true && this.isSetFirstName();
+      boolean that_present_firstName = true && that.isSetFirstName();
+      if (this_present_firstName || that_present_firstName) {
+        if (!(this_present_firstName && that_present_firstName))
+          return false;
+        if (!this.firstName.equals(that.firstName))
+          return false;
+      }
+
+      boolean this_present_lastName = true && this.isSetLastName();
+      boolean that_present_lastName = true && that.isSetLastName();
+      if (this_present_lastName || that_present_lastName) {
+        if (!(this_present_lastName && that_present_lastName))
+          return false;
+        if (!this.lastName.equals(that.lastName))
+          return false;
+      }
+
+      boolean this_present_newPassword = true && this.isSetNewPassword();
+      boolean that_present_newPassword = true && that.isSetNewPassword();
+      if (this_present_newPassword || that_present_newPassword) {
+        if (!(this_present_newPassword && that_present_newPassword))
+          return false;
+        if (!this.newPassword.equals(that.newPassword))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetAuthzToken()) ? 131071 : 524287);
+      if (isSetAuthzToken())
+        hashCode = hashCode * 8191 + authzToken.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
+      if (isSetUsername())
+        hashCode = hashCode * 8191 + username.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetEmailAddress()) ? 131071 : 524287);
+      if (isSetEmailAddress())
+        hashCode = hashCode * 8191 + emailAddress.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetFirstName()) ? 131071 : 524287);
+      if (isSetFirstName())
+        hashCode = hashCode * 8191 + firstName.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetLastName()) ? 131071 : 524287);
+      if (isSetLastName())
+        hashCode = hashCode * 8191 + lastName.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetNewPassword()) ? 131071 : 524287);
+      if (isSetNewPassword())
+        hashCode = hashCode * 8191 + newPassword.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(registerUser_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAuthzToken()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetUsername()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetEmailAddress()).compareTo(other.isSetEmailAddress());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEmailAddress()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emailAddress, other.emailAddress);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetFirstName()).compareTo(other.isSetFirstName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetFirstName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstName, other.firstName);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetLastName()).compareTo(other.isSetLastName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetLastName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastName, other.lastName);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetNewPassword()).compareTo(other.isSetNewPassword());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetNewPassword()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newPassword, other.newPassword);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("registerUser_args(");
+      boolean first = true;
+
+      sb.append("authzToken:");
+      if (this.authzToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authzToken);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("username:");
+      if (this.username == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.username);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("emailAddress:");
+      if (this.emailAddress == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.emailAddress);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("firstName:");
+      if (this.firstName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.firstName);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("lastName:");
+      if (this.lastName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.lastName);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("newPassword:");
+      if (this.newPassword == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.newPassword);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (authzToken == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
+      }
+      if (username == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+      }
+      if (emailAddress == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'emailAddress' was not present! Struct: " + toString());
+      }
+      if (firstName == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'firstName' was not present! Struct: " + toString());
+      }
+      if (lastName == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'lastName' was not present! Struct: " + toString());
+      }
+      if (newPassword == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'newPassword' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (authzToken != null) {
+        authzToken.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class registerUser_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public registerUser_argsStandardScheme getScheme() {
+        return new registerUser_argsStandardScheme();
+      }
+    }
+
+    private static class registerUser_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<registerUser_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // AUTHZ_TOKEN
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+                struct.authzToken.read(iprot);
+                struct.setAuthzTokenIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // USERNAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.username = iprot.readString();
+                struct.setUsernameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // EMAIL_ADDRESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.emailAddress = iprot.readString();
+                struct.setEmailAddressIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 4: // FIRST_NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.firstName = iprot.readString();
+                struct.setFirstNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 5: // LAST_NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.lastName = iprot.readString();
+                struct.setLastNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 6: // NEW_PASSWORD
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.newPassword = iprot.readString();
+                struct.setNewPasswordIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, registerUser_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.authzToken != null) {
+          oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
+          struct.authzToken.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.username != null) {
+          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+          oprot.writeString(struct.username);
+          oprot.writeFieldEnd();
+        }
+        if (struct.emailAddress != null) {
+          oprot.writeFieldBegin(EMAIL_ADDRESS_FIELD_DESC);
+          oprot.writeString(struct.emailAddress);
+          oprot.writeFieldEnd();
+        }
+        if (struct.firstName != null) {
+          oprot.writeFieldBegin(FIRST_NAME_FIELD_DESC);
+          oprot.writeString(struct.firstName);
+          oprot.writeFieldEnd();
+        }
+        if (struct.lastName != null) {
+          oprot.writeFieldBegin(LAST_NAME_FIELD_DESC);
+          oprot.writeString(struct.lastName);
+          oprot.writeFieldEnd();
+        }
+        if (struct.newPassword != null) {
+          oprot.writeFieldBegin(NEW_PASSWORD_FIELD_DESC);
+          oprot.writeString(struct.newPassword);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class registerUser_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public registerUser_argsTupleScheme getScheme() {
+        return new registerUser_argsTupleScheme();
+      }
+    }
+
+    private static class registerUser_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<registerUser_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken.write(oprot);
+        oprot.writeString(struct.username);
+        oprot.writeString(struct.emailAddress);
+        oprot.writeString(struct.firstName);
+        oprot.writeString(struct.lastName);
+        oprot.writeString(struct.newPassword);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, registerUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+        struct.authzToken.read(iprot);
+        struct.setAuthzTokenIsSet(true);
+        struct.username = iprot.readString();
+        struct.setUsernameIsSet(true);
+        struct.emailAddress = iprot.readString();
+        struct.setEmailAddressIsSet(true);
+        struct.firstName = iprot.readString();
+        struct.setFirstNameIsSet(true);
+        struct.lastName = iprot.readString();
+        struct.setLastNameIsSet(true);
+        struct.newPassword = iprot.readString();
+        struct.setNewPasswordIsSet(true);
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class registerUser_result implements org.apache.thrift.TBase<registerUser_result, registerUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerUser_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerUser_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+    private static final org.apache.thrift.protocol.TField IDSE_FIELD_DESC = new org.apache.thrift.protocol.TField("Idse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new registerUser_resultStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new registerUser_resultTupleSchemeFactory();
+
+    public boolean success; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success"),
+      IDSE((short)1, "Idse");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IDSE
+            return IDSE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    private static final int __SUCCESS_ISSET_ID = 0;
+    private byte __isset_bitfield = 0;
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+      tmpMap.put(_Fields.IDSE, new org.apache.thrift.meta_data.FieldMetaData("Idse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerUser_result.class, metaDataMap);
+    }
+
+    public registerUser_result() {
+    }
+
+    public registerUser_result(
+      boolean success,
+      org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse)
+    {
+      this();
+      this.success = success;
+      setSuccessIsSet(true);
+      this.Idse = Idse;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerUser_result(registerUser_result other) {
+      __isset_bitfield = other.__isset_bitfield;
+      this.success = other.success;
+      if (other.isSetIdse()) {
+        this.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException(other.Idse);
+      }
+    }
+
+    public registerUser_result deepCopy() {
+      return new registerUser_result(this);
+    }
+
+    @Override
+    public void clear() {
+      setSuccessIsSet(false);
+      this.success = false;
+      this.Idse = null;
+    }
+
+    public boolean isSuccess() {
+      return this.success;
+    }
+
+    public registerUser_result setSuccess(boolean success) {
+      this.success = success;
+      setSuccessIsSet(true);
+      return this;
+    }
+
+    public void unsetSuccess() {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException getIdse() {
+      return this.Idse;
+    }
+
+    public registerUser_result setIdse(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+      this.Idse = Idse;
+      return this;
+    }
+
+    public void unsetIdse() {
+      this.Idse = null;
+    }
+
+    /** Returns true if field Idse is set (has been assigned a value) and false otherwise */
+    public boolean isSetIdse() {
+      return this.Idse != null;
+    }
+
+    public void setIdseIsSet(boolean value) {
+      if (!value) {
+        this.Idse = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((Boolean)value);
+        }
+        break;
+
+      case IDSE:
+        if (value == null) {
+          unsetIdse();
+        } else {
+          setIdse((org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return isSuccess();
+
+      case IDSE:
+        return getIdse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IDSE:
+        return isSetIdse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof registerUser_result)
+        return this.equals((registerUser_result)that);
+      return false;
+    }
+
+    public boolean equals(registerUser_result that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_success = true;
+      boolean that_present_success = true;
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (this.success != that.success)
+          return false;
+      }
+
+      boolean this_present_Idse = true && this.isSetIdse();
+      boolean that_present_Idse = true && that.isSetIdse();
+      if (this_present_Idse || that_present_Idse) {
+        if (!(this_present_Idse && that_present_Idse))
+          return false;
+        if (!this.Idse.equals(that.Idse))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
+
+      hashCode = hashCode * 8191 + ((isSetIdse()) ? 131071 : 524287);
+      if (isSetIdse())
+        hashCode = hashCode * 8191 + Idse.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(registerUser_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIdse()).compareTo(other.isSetIdse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIdse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Idse, other.Idse);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("registerUser_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      sb.append(this.success);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("Idse:");
+      if (this.Idse == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.Idse);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class registerUser_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public registerUser_resultStandardScheme getScheme() {
+        return new registerUser_resultStandardScheme();
+      }
+    }
+
+    private static class registerUser_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<registerUser_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerUser_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+                struct.success = iprot.readBool();
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // IDSE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+                struct.Idse.read(iprot);
+                struct.setIdseIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, registerUser_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.isSetSuccess()) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeBool(struct.success);
+          oprot.writeFieldEnd();
+        }
+        if (struct.Idse != null) {
+          oprot.writeFieldBegin(IDSE_FIELD_DESC);
+          struct.Idse.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class registerUser_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public registerUser_resultTupleScheme getScheme() {
+        return new registerUser_resultTupleScheme();
+      }
+    }
+
+    private static class registerUser_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<registerUser_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerUser_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet optionals = new java.util.BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetIdse()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          oprot.writeBool(struct.success);
+        }
+        if (struct.isSetIdse()) {
+          struct.Idse.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, registerUser_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        java.util.BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = iprot.readBool();
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException();
+          struct.Idse.read(iprot);
+          struct.setIdseIsSet(true);
+        }
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class enableUser_args implements org.apache.thrift.TBase<enableUser_args, enableUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<enableUser_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("enableUser_args");
+
+    private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new enableUser_argsStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new enableUser_argsTupleSchemeFactory();
+
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken; // required
+    public @org.apache.thrift.annotation.Nullable String username; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      AUTHZ_TOKEN((short)1, "authzToken"),
+      USERNAME((short)2, "username");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 1: // AUTHZ_TOKEN
+            return AUTHZ_TOKEN;
+          case 2: // USERNAME
+            return USERNAME;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.commons.model.security.AuthzToken.class)));
+      tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(enableUser_args.class, metaDataMap);
+    }
+
+    public enableUser_args() {
+    }
+
+    public enableUser_args(
+      org.apache.custos.commons.model.security.AuthzToken authzToken,
+      String username)
+    {
+      this();
+      this.authzToken = authzToken;
+      this.username = username;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public enableUser_args(enableUser_args other) {
+      if (other.isSetAuthzToken()) {
+        this.authzToken = new org.apache.custos.commons.model.security.AuthzToken(other.authzToken);
+      }
+      if (other.isSetUsername()) {
+        this.username = other.username;
+      }
+    }
+
+    public enableUser_args deepCopy() {
+      return new enableUser_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.authzToken = null;
+      this.username = null;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.commons.model.security.AuthzToken getAuthzToken() {
+      return this.authzToken;
+    }
+
+    public enableUser_args setAuthzToken(@org.apache.thrift.annotation.Nullable org.apache.custos.commons.model.security.AuthzToken authzToken) {
+      this.authzToken = authzToken;
+      return this;
+    }
+
+    public void unsetAuthzToken() {
+      this.authzToken = null;
+    }
+
+    /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
+    public boolean isSetAuthzToken() {
+      return this.authzToken != null;
+    }
+
+    public void setAuthzTokenIsSet(boolean value) {
+      if (!value) {
+        this.authzToken = null;
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public String getUsername() {
+      return this.username;
+    }
+
+    public enableUser_args setUsername(@org.apache.thrift.annotation.Nullable String username) {
+      this.username = username;
+      return this;
+    }
+
+    public void unsetUsername() {
+      this.username = null;
+    }
+
+    /** Returns true if field username is set (has been assigned a value) and false otherwise */
+    public boolean isSetUsername() {
+      return this.username != null;
+    }
+
+    public void setUsernameIsSet(boolean value) {
+      if (!value) {
+        this.username = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        if (value == null) {
+          unsetAuthzToken();
+        } else {
+          setAuthzToken((org.apache.custos.commons.model.security.AuthzToken)value);
+        }
+        break;
+
+      case USERNAME:
+        if (value == null) {
+          unsetUsername();
+        } else {
+          setUsername((String)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return getAuthzToken();
+
+      case USERNAME:
+        return getUsername();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case AUTHZ_TOKEN:
+        return isSetAuthzToken();
+      case USERNAME:
+        return isSetUsername();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof enableUser_args)
+        return this.equals((enableUser_args)that);
+      return false;
+    }
+
+    public boolean equals(enableUser_args that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_authzToken = true && this.isSetAuthzToken();
+      boolean that_present_authzToken = true && that.isSetAuthzToken();
+      if (this_present_authzToken || that_present_authzToken) {
+        if (!(this_present_authzToken && that_present_authzToken))
+          return false;
+        if (!this.authzToken.equals(that.authzToken))
+          return false;
+      }
+
+      boolean this_present_username = true && this.isSetUsername();
+      boolean that_present_username = true && that.isSetUsername();
+      if (this_present_username || that_present_username) {
+        if (!(this_present_username && that_present_username))
+          return false;
+        if (!this.username.equals(that.username))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((isSetAuthzToken()) ? 131071 : 524287);
+      if (isSetAuthzToken())
+        hashCode = hashCode * 8191 + authzToken.hashCode();
+
+      hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287);
+      if (isSetUsername())
+        hashCode = hashCode * 8191 + username.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(enableUser_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAuthzToken()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetUsername()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("enableUser_args(");
+      boolean first = true;
+
+      sb.append("authzToken:");
+      if (this.authzToken == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.authzToken);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("username:");
+      if (this.username == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.username);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (authzToken == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
+      }
+      if (username == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (authzToken != null) {
+        authzToken.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class enableUser_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public enableUser_argsStandardScheme getScheme() {
+        return new enableUser_argsStandardScheme();
+      }
+    }
+
+    private static class enableUser_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<enableUser_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, enableUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // AUTHZ_TOKEN
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+                struct.authzToken.read(iprot);
+                struct.setAuthzTokenIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // USERNAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.username = iprot.readString();
+                struct.setUsernameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, enableUser_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.authzToken != null) {
+          oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
+          struct.authzToken.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.username != null) {
+          oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+          oprot.writeString(struct.username);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class enableUser_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public enableUser_argsTupleScheme getScheme() {
+        return new enableUser_argsTupleScheme();
+      }
+    }
+
+    private static class enableUser_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<enableUser_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, enableUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken.write(oprot);
+        oprot.writeString(struct.username);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, enableUser_args struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+        struct.authzToken = new org.apache.custos.commons.model.security.AuthzToken();
+        struct.authzToken.read(iprot);
+        struct.setAuthzTokenIsSet(true);
+        struct.username = iprot.readString();
+        struct.setUsernameIsSet(true);
+      }
+    }
+
+    private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+    }
+  }
+
+  public static class enableUser_result implements org.apache.thrift.TBase<enableUser_result, enableUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<enableUser_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("enableUser_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+    private static final org.apache.thrift.protocol.TField IDSE_FIELD_DESC = new org.apache.thrift.protocol.TField("Idse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new enableUser_resultStandardSchemeFactory();
+    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new enableUser_resultTupleSchemeFactory();
+
+    public boolean success; // required
+    public @org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success"),
+      IDSE((short)1, "Idse");
+
+      private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          case 0: // SUCCESS
+            return SUCCESS;
+          case 1: // IDSE
+            return IDSE;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      @org.apache.thrift.annotation.Nullable
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    private static final int __SUCCESS_ISSET_ID = 0;
+    private byte __isset_bitfield = 0;
+    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+      tmpMap.put(_Fields.IDSE, new org.apache.thrift.meta_data.FieldMetaData("Idse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException.class)));
+      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(enableUser_result.class, metaDataMap);
+    }
+
+    public enableUser_result() {
+    }
+
+    public enableUser_result(
+      boolean success,
+      org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse)
+    {
+      this();
+      this.success = success;
+      setSuccessIsSet(true);
+      this.Idse = Idse;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public enableUser_result(enableUser_result other) {
+      __isset_bitfield = other.__isset_bitfield;
+      this.success = other.success;
+      if (other.isSetIdse()) {
+        this.Idse = new org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException(other.Idse);
+      }
+    }
+
+    public enableUser_result deepCopy() {
+      return new enableUser_result(this);
+    }
+
+    @Override
+    public void clear() {
+      setSuccessIsSet(false);
+      this.success = false;
+      this.Idse = null;
+    }
+
+    public boolean isSuccess() {
+      return this.success;
+    }
+
+    public enableUser_result setSuccess(boolean success) {
+      this.success = success;
+      setSuccessIsSet(true);
+      return this;
+    }
+
+    public void unsetSuccess() {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException getIdse() {
+      return this.Idse;
+    }
+
+    public enableUser_result setIdse(@org.apache.thrift.annotation.Nullable org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException Idse) {
+      this.Idse = Idse;
+      return this;
+    }
+
+    public void unsetIdse() {
+      this.Idse = null;
+    }
+
+    /** Returns true if field Idse is set (has been assigned a value) and false otherwise */
+    public boolean isSetIdse() {
+      return this.Idse != null;
+    }
+
+    public void setIdseIsSet(boolean value) {
+      if (!value) {
+        this.Idse = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((Boolean)value);
+        }
+        break;
+
+      case IDSE:
+        if (value == null) {
+          unsetIdse();
+        } else {
+          setIdse((org.apache.custos.profile.iam.admin.services.cpi.exception.IamAdminServicesException)value);
+        }
+        break;
+
+      }
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return isSuccess();
+
+      case IDSE:
+        return getIdse();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case IDSE:
+        return isSetIdse();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof enableUser_result)
+        return this.equals((enableUser_result)that);
+      return false;
+    }
+
+    public boolean equals(enableUser_result that) {
+      if (that == null)
+        return false;
+      if (this == that)
+        return true;
+
+      boolean this_present_success = true;
+      boolean that_present_success = true;
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (this.success != that.success)
+          return false;
+      }
+
+      boolean this_present_Idse = true && this.isSetIdse();
+      boolean that_present_Idse = true && that.isSetIdse();
+      if (this_present_Idse || that_present_Idse) {
+        if (!(this_present_Idse && that_present_Idse))
+          return false;
+        if (!this.Idse.equals(that.Idse))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      int hashCode = 1;
+
+      hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
+
+      hashCode = hashCode * 8191 + ((isSetIdse()) ? 131071 : 524287);
+      if (isSetIdse())
+        hashCode = hashCode * 8191 + Idse.hashCode();
+
+      return hashCode;
+    }
+
+    @Override
+    public int compareTo(enableUser_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetIdse()).compareTo(other.isSetIdse());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetIdse()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Idse, other.Idse);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    @org.apache.thrift.annotation.Nullable
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+      scheme(iprot).read(iprot, this);
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+      scheme(oprot).write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("enableUser_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      sb.append(this.success);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("Idse:");
+      if (this.Idse == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.Idse);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class enableUser_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
+      public enableUser_resultStandardScheme getScheme() {
+        return new enableUser_resultStandardScheme();
+      }
+    }
+
+    private static class enableUser_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<enableUser_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, enableUser_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
... 50501 lines suppressed ...