You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/06/12 20:46:34 UTC

[3/5] airavata-php-gateway git commit: AIRAVATA-2408 Switching User Profile calls to Profile Service

AIRAVATA-2408 Switching User Profile calls to Profile Service


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/3c17052f
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3c17052f
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3c17052f

Branch: refs/heads/keycloak-integration
Commit: 3c17052fd23fe04c14c9b8843028369e92ef158c
Parents: 7897988
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Jun 12 16:35:40 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Jun 12 16:36:22 2017 -0400

----------------------------------------------------------------------
 app/config/app.php                              |    1 +
 .../Airavata/Facades/UserProfileServices.php    |   16 +
 .../Airavata/Model/Workspace/Types.php          |  133 +-
 .../Iam/Admin/Services/CPI/IamAdminServices.php |  272 ++
 .../Service/Profile/Tenant/CPI/Error/Types.php  |   95 +
 .../Profile/Tenant/CPI/TenantProfileService.php | 2435 ++++++++++++++++++
 .../Service/Profile/Tenant/CPI/Types.php        |   33 +
 .../Airavata/Service/Profile/Types.php          |   20 +
 .../Service/Profile/User/CPI/Error/Types.php    |   95 +
 .../Airavata/Service/Profile/User/CPI/Types.php |   33 +
 .../Profile/User/CPI/UserProfileService.php     | 2025 +++++++++++++++
 .../Airavata/UserProfileServiceProvider.php     |   83 +
 app/libraries/UserProfileUtilities.php          |    8 +-
 13 files changed, 5190 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3c17052f/app/config/app.php
----------------------------------------------------------------------
diff --git a/app/config/app.php b/app/config/app.php
index 9d863ce..ee2ff8b 100755
--- a/app/config/app.php
+++ b/app/config/app.php
@@ -125,6 +125,7 @@ return array(
         'Keycloak\KeycloakServiceProvider',
         'Airavata\AiravataServiceProvider',
         'Airavata\IamAdminServiceProvider',
+        'Airavata\UserProfileServiceProvider',
         'Teepluss\Theme\ThemeServiceProvider',
         'GrahamCampbell\Markdown\MarkdownServiceProvider',
     ),

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3c17052f/app/libraries/Airavata/Facades/UserProfileServices.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Facades/UserProfileServices.php b/app/libraries/Airavata/Facades/UserProfileServices.php
new file mode 100644
index 0000000..94abcf3
--- /dev/null
+++ b/app/libraries/Airavata/Facades/UserProfileServices.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace Airavata\Facades;
+
+use Illuminate\Support\Facades\Facade;
+
+class UserProfileServices extends Facade {
+
+    /**
+     * Get the registered name of the component.
+     *
+     * @return string
+     */
+    protected static function getFacadeAccessor() { return 'user_profile_services'; }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3c17052f/app/libraries/Airavata/Model/Workspace/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Workspace/Types.php b/app/libraries/Airavata/Model/Workspace/Types.php
index 098511f..d929439 100644
--- a/app/libraries/Airavata/Model/Workspace/Types.php
+++ b/app/libraries/Airavata/Model/Workspace/Types.php
@@ -629,6 +629,10 @@ class Gateway {
   /**
    * @var string
    */
+  public $airavataInternalGatewayId = null;
+  /**
+   * @var string
+   */
   public $gatewayId = null;
   /**
    * @var int
@@ -707,84 +711,91 @@ class Gateway {
     if (!isset(self::$_TSPEC)) {
       self::$_TSPEC = array(
         1 => array(
-          'var' => 'gatewayId',
+          'var' => 'airavataInternalGatewayId',
           'type' => TType::STRING,
           ),
         2 => array(
+          'var' => 'gatewayId',
+          'type' => TType::STRING,
+          ),
+        3 => array(
           'var' => 'gatewayApprovalStatus',
           'type' => TType::I32,
           ),
-        3 => array(
+        4 => array(
           'var' => 'gatewayName',
           'type' => TType::STRING,
           ),
-        4 => array(
+        5 => array(
           'var' => 'domain',
           'type' => TType::STRING,
           ),
-        5 => array(
+        6 => array(
           'var' => 'emailAddress',
           'type' => TType::STRING,
           ),
-        6 => array(
+        7 => array(
           'var' => 'gatewayAcronym',
           'type' => TType::STRING,
           ),
-        7 => array(
+        8 => array(
           'var' => 'gatewayURL',
           'type' => TType::STRING,
           ),
-        8 => array(
+        9 => array(
           'var' => 'gatewayPublicAbstract',
           'type' => TType::STRING,
           ),
-        9 => array(
+        10 => array(
           'var' => 'reviewProposalDescription',
           'type' => TType::STRING,
           ),
-        10 => array(
+        11 => array(
           'var' => 'gatewayAdminFirstName',
           'type' => TType::STRING,
           ),
-        11 => array(
+        12 => array(
           'var' => 'gatewayAdminLastName',
           'type' => TType::STRING,
           ),
-        12 => array(
+        13 => array(
           'var' => 'gatewayAdminEmail',
           'type' => TType::STRING,
           ),
-        13 => array(
+        14 => array(
           'var' => 'identityServerUserName',
           'type' => TType::STRING,
           ),
-        14 => array(
+        15 => array(
           'var' => 'identityServerPasswordToken',
           'type' => TType::STRING,
           ),
-        15 => array(
+        16 => array(
           'var' => 'declinedReason',
           'type' => TType::STRING,
           ),
-        16 => array(
+        17 => array(
           'var' => 'oauthClientId',
           'type' => TType::STRING,
           ),
-        17 => array(
+        18 => array(
           'var' => 'oauthClientSecret',
           'type' => TType::STRING,
           ),
-        18 => array(
+        19 => array(
           'var' => 'requestCreationTime',
           'type' => TType::I64,
           ),
-        19 => array(
+        20 => array(
           'var' => 'requesterUsername',
           'type' => TType::STRING,
           ),
         );
     }
     if (is_array($vals)) {
+      if (isset($vals['airavataInternalGatewayId'])) {
+        $this->airavataInternalGatewayId = $vals['airavataInternalGatewayId'];
+      }
       if (isset($vals['gatewayId'])) {
         $this->gatewayId = $vals['gatewayId'];
       }
@@ -866,131 +877,138 @@ class Gateway {
       {
         case 1:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->gatewayId);
+            $xfer += $input->readString($this->airavataInternalGatewayId);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
         case 2:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->gatewayId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 3:
           if ($ftype == TType::I32) {
             $xfer += $input->readI32($this->gatewayApprovalStatus);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 3:
+        case 4:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayName);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 4:
+        case 5:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->domain);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 5:
+        case 6:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->emailAddress);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 6:
+        case 7:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayAcronym);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 7:
+        case 8:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayURL);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 8:
+        case 9:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayPublicAbstract);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 9:
+        case 10:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->reviewProposalDescription);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 10:
+        case 11:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayAdminFirstName);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 11:
+        case 12:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayAdminLastName);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 12:
+        case 13:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->gatewayAdminEmail);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 13:
+        case 14:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->identityServerUserName);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 14:
+        case 15:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->identityServerPasswordToken);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 15:
+        case 16:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->declinedReason);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 16:
+        case 17:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->oauthClientId);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 17:
+        case 18:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->oauthClientSecret);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 18:
+        case 19:
           if ($ftype == TType::I64) {
             $xfer += $input->readI64($this->requestCreationTime);
           } else {
             $xfer += $input->skip($ftype);
           }
           break;
-        case 19:
+        case 20:
           if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->requesterUsername);
           } else {
@@ -1010,98 +1028,103 @@ class Gateway {
   public function write($output) {
     $xfer = 0;
     $xfer += $output->writeStructBegin('Gateway');
+    if ($this->airavataInternalGatewayId !== null) {
+      $xfer += $output->writeFieldBegin('airavataInternalGatewayId', TType::STRING, 1);
+      $xfer += $output->writeString($this->airavataInternalGatewayId);
+      $xfer += $output->writeFieldEnd();
+    }
     if ($this->gatewayId !== null) {
-      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 1);
+      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
       $xfer += $output->writeString($this->gatewayId);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayApprovalStatus !== null) {
-      $xfer += $output->writeFieldBegin('gatewayApprovalStatus', TType::I32, 2);
+      $xfer += $output->writeFieldBegin('gatewayApprovalStatus', TType::I32, 3);
       $xfer += $output->writeI32($this->gatewayApprovalStatus);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayName !== null) {
-      $xfer += $output->writeFieldBegin('gatewayName', TType::STRING, 3);
+      $xfer += $output->writeFieldBegin('gatewayName', TType::STRING, 4);
       $xfer += $output->writeString($this->gatewayName);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->domain !== null) {
-      $xfer += $output->writeFieldBegin('domain', TType::STRING, 4);
+      $xfer += $output->writeFieldBegin('domain', TType::STRING, 5);
       $xfer += $output->writeString($this->domain);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->emailAddress !== null) {
-      $xfer += $output->writeFieldBegin('emailAddress', TType::STRING, 5);
+      $xfer += $output->writeFieldBegin('emailAddress', TType::STRING, 6);
       $xfer += $output->writeString($this->emailAddress);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayAcronym !== null) {
-      $xfer += $output->writeFieldBegin('gatewayAcronym', TType::STRING, 6);
+      $xfer += $output->writeFieldBegin('gatewayAcronym', TType::STRING, 7);
       $xfer += $output->writeString($this->gatewayAcronym);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayURL !== null) {
-      $xfer += $output->writeFieldBegin('gatewayURL', TType::STRING, 7);
+      $xfer += $output->writeFieldBegin('gatewayURL', TType::STRING, 8);
       $xfer += $output->writeString($this->gatewayURL);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayPublicAbstract !== null) {
-      $xfer += $output->writeFieldBegin('gatewayPublicAbstract', TType::STRING, 8);
+      $xfer += $output->writeFieldBegin('gatewayPublicAbstract', TType::STRING, 9);
       $xfer += $output->writeString($this->gatewayPublicAbstract);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->reviewProposalDescription !== null) {
-      $xfer += $output->writeFieldBegin('reviewProposalDescription', TType::STRING, 9);
+      $xfer += $output->writeFieldBegin('reviewProposalDescription', TType::STRING, 10);
       $xfer += $output->writeString($this->reviewProposalDescription);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayAdminFirstName !== null) {
-      $xfer += $output->writeFieldBegin('gatewayAdminFirstName', TType::STRING, 10);
+      $xfer += $output->writeFieldBegin('gatewayAdminFirstName', TType::STRING, 11);
       $xfer += $output->writeString($this->gatewayAdminFirstName);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayAdminLastName !== null) {
-      $xfer += $output->writeFieldBegin('gatewayAdminLastName', TType::STRING, 11);
+      $xfer += $output->writeFieldBegin('gatewayAdminLastName', TType::STRING, 12);
       $xfer += $output->writeString($this->gatewayAdminLastName);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->gatewayAdminEmail !== null) {
-      $xfer += $output->writeFieldBegin('gatewayAdminEmail', TType::STRING, 12);
+      $xfer += $output->writeFieldBegin('gatewayAdminEmail', TType::STRING, 13);
       $xfer += $output->writeString($this->gatewayAdminEmail);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->identityServerUserName !== null) {
-      $xfer += $output->writeFieldBegin('identityServerUserName', TType::STRING, 13);
+      $xfer += $output->writeFieldBegin('identityServerUserName', TType::STRING, 14);
       $xfer += $output->writeString($this->identityServerUserName);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->identityServerPasswordToken !== null) {
-      $xfer += $output->writeFieldBegin('identityServerPasswordToken', TType::STRING, 14);
+      $xfer += $output->writeFieldBegin('identityServerPasswordToken', TType::STRING, 15);
       $xfer += $output->writeString($this->identityServerPasswordToken);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->declinedReason !== null) {
-      $xfer += $output->writeFieldBegin('declinedReason', TType::STRING, 15);
+      $xfer += $output->writeFieldBegin('declinedReason', TType::STRING, 16);
       $xfer += $output->writeString($this->declinedReason);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->oauthClientId !== null) {
-      $xfer += $output->writeFieldBegin('oauthClientId', TType::STRING, 16);
+      $xfer += $output->writeFieldBegin('oauthClientId', TType::STRING, 17);
       $xfer += $output->writeString($this->oauthClientId);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->oauthClientSecret !== null) {
-      $xfer += $output->writeFieldBegin('oauthClientSecret', TType::STRING, 17);
+      $xfer += $output->writeFieldBegin('oauthClientSecret', TType::STRING, 18);
       $xfer += $output->writeString($this->oauthClientSecret);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->requestCreationTime !== null) {
-      $xfer += $output->writeFieldBegin('requestCreationTime', TType::I64, 18);
+      $xfer += $output->writeFieldBegin('requestCreationTime', TType::I64, 19);
       $xfer += $output->writeI64($this->requestCreationTime);
       $xfer += $output->writeFieldEnd();
     }
     if ($this->requesterUsername !== null) {
-      $xfer += $output->writeFieldBegin('requesterUsername', TType::STRING, 19);
+      $xfer += $output->writeFieldBegin('requesterUsername', TType::STRING, 20);
       $xfer += $output->writeString($this->requesterUsername);
       $xfer += $output->writeFieldEnd();
     }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3c17052f/app/libraries/Airavata/Service/Iam/Admin/Services/CPI/IamAdminServices.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Service/Iam/Admin/Services/CPI/IamAdminServices.php b/app/libraries/Airavata/Service/Iam/Admin/Services/CPI/IamAdminServices.php
index a6cb9ff..bda8df7 100644
--- a/app/libraries/Airavata/Service/Iam/Admin/Services/CPI/IamAdminServices.php
+++ b/app/libraries/Airavata/Service/Iam/Admin/Services/CPI/IamAdminServices.php
@@ -73,6 +73,13 @@ interface IamAdminServicesIf {
    * @throws \Airavata\API\Error\AuthorizationException
    */
   public function findUsers(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayID, $email, $userId, \Airavata\Model\Credential\Store\PasswordCredential $isRealmAdminCredentials);
+  /**
+   * @param \Airavata\Model\Security\AuthzToken $authzToken
+   * @param \Airavata\Model\User\UserProfile $userDetails
+   * @throws \Airavata\Service\Iam\Admin\Services\CPI\Error\IamAdminServicesException
+   * @throws \Airavata\API\Error\AuthorizationException
+   */
+  public function updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userDetails);
 }
 
 class IamAdminServicesClient implements \Airavata\Service\Iam\Admin\Services\CPI\IamAdminServicesIf {
@@ -442,6 +449,61 @@ class IamAdminServicesClient implements \Airavata\Service\Iam\Admin\Services\CPI
     throw new \Exception("findUsers failed: unknown result");
   }
 
+  public function updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userDetails)
+  {
+    $this->send_updateUserProfile($authzToken, $userDetails);
+    $this->recv_updateUserProfile();
+  }
+
+  public function send_updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userDetails)
+  {
+    $args = new \Airavata\Service\Iam\Admin\Services\CPI\IamAdminServices_updateUserProfile_args();
+    $args->authzToken = $authzToken;
+    $args->userDetails = $userDetails;
+    $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+    if ($bin_accel)
+    {
+      thrift_protocol_write_binary($this->output_, 'updateUserProfile', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+    }
+    else
+    {
+      $this->output_->writeMessageBegin('updateUserProfile', TMessageType::CALL, $this->seqid_);
+      $args->write($this->output_);
+      $this->output_->writeMessageEnd();
+      $this->output_->getTransport()->flush();
+    }
+  }
+
+  public function recv_updateUserProfile()
+  {
+    $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+    if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\Service\Iam\Admin\Services\CPI\IamAdminServices_updateUserProfile_result', $this->input_->isStrictRead());
+    else
+    {
+      $rseqid = 0;
+      $fname = null;
+      $mtype = 0;
+
+      $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+      if ($mtype == TMessageType::EXCEPTION) {
+        $x = new TApplicationException();
+        $x->read($this->input_);
+        $this->input_->readMessageEnd();
+        throw $x;
+      }
+      $result = new \Airavata\Service\Iam\Admin\Services\CPI\IamAdminServices_updateUserProfile_result();
+      $result->read($this->input_);
+      $this->input_->readMessageEnd();
+    }
+    if ($result->Idse !== null) {
+      throw $result->Idse;
+    }
+    if ($result->ae !== null) {
+      throw $result->ae;
+    }
+    return;
+  }
+
 }
 
 // HELPER FUNCTIONS AND STRUCTURES
@@ -2066,4 +2128,214 @@ class IamAdminServices_findUsers_result {
 
 }
 
+class IamAdminServices_updateUserProfile_args {
+  static $_TSPEC;
+
+  /**
+   * @var \Airavata\Model\Security\AuthzToken
+   */
+  public $authzToken = null;
+  /**
+   * @var \Airavata\Model\User\UserProfile
+   */
+  public $userDetails = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'authzToken',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\Security\AuthzToken',
+          ),
+        2 => array(
+          'var' => 'userDetails',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Model\User\UserProfile',
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['authzToken'])) {
+        $this->authzToken = $vals['authzToken'];
+      }
+      if (isset($vals['userDetails'])) {
+        $this->userDetails = $vals['userDetails'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'IamAdminServices_updateUserProfile_args';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRUCT) {
+            $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+            $xfer += $this->authzToken->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRUCT) {
+            $this->userDetails = new \Airavata\Model\User\UserProfile();
+            $xfer += $this->userDetails->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('IamAdminServices_updateUserProfile_args');
+    if ($this->authzToken !== null) {
+      if (!is_object($this->authzToken)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+      $xfer += $this->authzToken->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->userDetails !== null) {
+      if (!is_object($this->userDetails)) {
+        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+      }
+      $xfer += $output->writeFieldBegin('userDetails', TType::STRUCT, 2);
+      $xfer += $this->userDetails->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+class IamAdminServices_updateUserProfile_result {
+  static $_TSPEC;
+
+  /**
+   * @var \Airavata\Service\Iam\Admin\Services\CPI\Error\IamAdminServicesException
+   */
+  public $Idse = null;
+  /**
+   * @var \Airavata\API\Error\AuthorizationException
+   */
+  public $ae = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'Idse',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\Service\Iam\Admin\Services\CPI\Error\IamAdminServicesException',
+          ),
+        2 => array(
+          'var' => 'ae',
+          'type' => TType::STRUCT,
+          'class' => '\Airavata\API\Error\AuthorizationException',
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['Idse'])) {
+        $this->Idse = $vals['Idse'];
+      }
+      if (isset($vals['ae'])) {
+        $this->ae = $vals['ae'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'IamAdminServices_updateUserProfile_result';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRUCT) {
+            $this->Idse = new \Airavata\Service\Iam\Admin\Services\CPI\Error\IamAdminServicesException();
+            $xfer += $this->Idse->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
+          if ($ftype == TType::STRUCT) {
+            $this->ae = new \Airavata\API\Error\AuthorizationException();
+            $xfer += $this->ae->read($input);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('IamAdminServices_updateUserProfile_result');
+    if ($this->Idse !== null) {
+      $xfer += $output->writeFieldBegin('Idse', TType::STRUCT, 1);
+      $xfer += $this->Idse->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->ae !== null) {
+      $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 2);
+      $xfer += $this->ae->write($output);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3c17052f/app/libraries/Airavata/Service/Profile/Tenant/CPI/Error/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Service/Profile/Tenant/CPI/Error/Types.php b/app/libraries/Airavata/Service/Profile/Tenant/CPI/Error/Types.php
new file mode 100644
index 0000000..796dbf6
--- /dev/null
+++ b/app/libraries/Airavata/Service/Profile/Tenant/CPI/Error/Types.php
@@ -0,0 +1,95 @@
+<?php
+namespace Airavata\Service\Profile\Tenant\CPI\Error;
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+use Thrift\Base\TBase;
+use Thrift\Type\TType;
+use Thrift\Type\TMessageType;
+use Thrift\Exception\TException;
+use Thrift\Exception\TProtocolException;
+use Thrift\Protocol\TProtocol;
+use Thrift\Protocol\TBinaryProtocolAccelerated;
+use Thrift\Exception\TApplicationException;
+
+
+class TenantProfileServiceException extends TException {
+  static $_TSPEC;
+
+  /**
+   * @var string
+   */
+  public $message = null;
+
+  public function __construct($vals=null) {
+    if (!isset(self::$_TSPEC)) {
+      self::$_TSPEC = array(
+        1 => array(
+          'var' => 'message',
+          'type' => TType::STRING,
+          ),
+        );
+    }
+    if (is_array($vals)) {
+      if (isset($vals['message'])) {
+        $this->message = $vals['message'];
+      }
+    }
+  }
+
+  public function getName() {
+    return 'TenantProfileServiceException';
+  }
+
+  public function read($input)
+  {
+    $xfer = 0;
+    $fname = null;
+    $ftype = 0;
+    $fid = 0;
+    $xfer += $input->readStructBegin($fname);
+    while (true)
+    {
+      $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+      if ($ftype == TType::STOP) {
+        break;
+      }
+      switch ($fid)
+      {
+        case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->message);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        default:
+          $xfer += $input->skip($ftype);
+          break;
+      }
+      $xfer += $input->readFieldEnd();
+    }
+    $xfer += $input->readStructEnd();
+    return $xfer;
+  }
+
+  public function write($output) {
+    $xfer = 0;
+    $xfer += $output->writeStructBegin('TenantProfileServiceException');
+    if ($this->message !== null) {
+      $xfer += $output->writeFieldBegin('message', TType::STRING, 1);
+      $xfer += $output->writeString($this->message);
+      $xfer += $output->writeFieldEnd();
+    }
+    $xfer += $output->writeFieldStop();
+    $xfer += $output->writeStructEnd();
+    return $xfer;
+  }
+
+}
+
+