<?php
namespace Airavata\Model\Workspace;

/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * 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;


final class GatewayApprovalStatus {
  const REQUESTED = 0;
  const APPROVED = 1;
  const ACTIVE = 2;
  const DEACTIVATED = 3;
  const CANCELLED = 4;
  const DENIED = 5;
  const CREATED = 6;
  const DEPLOYED = 7;
  static public $__names = array(
    0 => 'REQUESTED',
    1 => 'APPROVED',
    2 => 'ACTIVE',
    3 => 'DEACTIVATED',
    4 => 'CANCELLED',
    5 => 'DENIED',
    6 => 'CREATED',
    7 => 'DEPLOYED',
  );
}

final class NotificationPriority {
  const LOW = 0;
  const NORMAL = 1;
  const HIGH = 2;
  static public $__names = array(
    0 => 'LOW',
    1 => 'NORMAL',
    2 => 'HIGH',
  );
}

class Group {
  static $_TSPEC;

  /**
   * @var string
   */
  public $groupName = null;
  /**
   * @var string
   */
  public $description = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'groupName',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'description',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['groupName'])) {
        $this->groupName = $vals['groupName'];
      }
      if (isset($vals['description'])) {
        $this->description = $vals['description'];
      }
    }
  }

  public function getName() {
    return 'Group';
  }

  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->groupName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->description);
          } 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('Group');
    if ($this->groupName !== null) {
      $xfer += $output->writeFieldBegin('groupName', TType::STRING, 1);
      $xfer += $output->writeString($this->groupName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->description !== null) {
      $xfer += $output->writeFieldBegin('description', TType::STRING, 2);
      $xfer += $output->writeString($this->description);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Project {
  static $_TSPEC;

  /**
   * @var string
   */
  public $projectID = "DO_NOT_SET_AT_CLIENTS";
  /**
   * @var string
   */
  public $owner = null;
  /**
   * @var string
   */
  public $gatewayId = null;
  /**
   * @var string
   */
  public $name = null;
  /**
   * @var string
   */
  public $description = null;
  /**
   * @var int
   */
  public $creationTime = null;
  /**
   * @var string[]
   */
  public $sharedUsers = null;
  /**
   * @var string[]
   */
  public $sharedGroups = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'projectID',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'owner',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'gatewayId',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'name',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'description',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'creationTime',
          'type' => TType::I64,
          ),
        7 => array(
          'var' => 'sharedUsers',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        8 => array(
          'var' => 'sharedGroups',
          'type' => TType::LST,
          'etype' => TType::STRING,
          'elem' => array(
            'type' => TType::STRING,
            ),
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['projectID'])) {
        $this->projectID = $vals['projectID'];
      }
      if (isset($vals['owner'])) {
        $this->owner = $vals['owner'];
      }
      if (isset($vals['gatewayId'])) {
        $this->gatewayId = $vals['gatewayId'];
      }
      if (isset($vals['name'])) {
        $this->name = $vals['name'];
      }
      if (isset($vals['description'])) {
        $this->description = $vals['description'];
      }
      if (isset($vals['creationTime'])) {
        $this->creationTime = $vals['creationTime'];
      }
      if (isset($vals['sharedUsers'])) {
        $this->sharedUsers = $vals['sharedUsers'];
      }
      if (isset($vals['sharedGroups'])) {
        $this->sharedGroups = $vals['sharedGroups'];
      }
    }
  }

  public function getName() {
    return 'Project';
  }

  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->projectID);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->owner);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->name);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->description);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->creationTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::LST) {
            $this->sharedUsers = array();
            $_size0 = 0;
            $_etype3 = 0;
            $xfer += $input->readListBegin($_etype3, $_size0);
            for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
            {
              $elem5 = null;
              $xfer += $input->readString($elem5);
              $this->sharedUsers []= $elem5;
            }
            $xfer += $input->readListEnd();
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::LST) {
            $this->sharedGroups = array();
            $_size6 = 0;
            $_etype9 = 0;
            $xfer += $input->readListBegin($_etype9, $_size6);
            for ($_i10 = 0; $_i10 < $_size6; ++$_i10)
            {
              $elem11 = null;
              $xfer += $input->readString($elem11);
              $this->sharedGroups []= $elem11;
            }
            $xfer += $input->readListEnd();
          } 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('Project');
    if ($this->projectID !== null) {
      $xfer += $output->writeFieldBegin('projectID', TType::STRING, 1);
      $xfer += $output->writeString($this->projectID);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->owner !== null) {
      $xfer += $output->writeFieldBegin('owner', TType::STRING, 2);
      $xfer += $output->writeString($this->owner);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayId !== null) {
      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
      $xfer += $output->writeString($this->gatewayId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->name !== null) {
      $xfer += $output->writeFieldBegin('name', TType::STRING, 4);
      $xfer += $output->writeString($this->name);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->description !== null) {
      $xfer += $output->writeFieldBegin('description', TType::STRING, 5);
      $xfer += $output->writeString($this->description);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->creationTime !== null) {
      $xfer += $output->writeFieldBegin('creationTime', TType::I64, 6);
      $xfer += $output->writeI64($this->creationTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sharedUsers !== null) {
      if (!is_array($this->sharedUsers)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sharedUsers', TType::LST, 7);
      {
        $output->writeListBegin(TType::STRING, count($this->sharedUsers));
        {
          foreach ($this->sharedUsers as $iter12)
          {
            $xfer += $output->writeString($iter12);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    if ($this->sharedGroups !== null) {
      if (!is_array($this->sharedGroups)) {
        throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
      }
      $xfer += $output->writeFieldBegin('sharedGroups', TType::LST, 8);
      {
        $output->writeListBegin(TType::STRING, count($this->sharedGroups));
        {
          foreach ($this->sharedGroups as $iter13)
          {
            $xfer += $output->writeString($iter13);
          }
        }
        $output->writeListEnd();
      }
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class User {
  static $_TSPEC;

  /**
   * @var string
   */
  public $airavataInternalUserId = "DO_NOT_SET_AT_CLIENTS";
  /**
   * @var string
   */
  public $userName = null;
  /**
   * @var string
   */
  public $gatewayId = null;
  /**
   * @var string
   */
  public $firstName = null;
  /**
   * @var string
   */
  public $lastName = null;
  /**
   * @var string
   */
  public $email = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'airavataInternalUserId',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'userName',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'gatewayId',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'firstName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'lastName',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'email',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['airavataInternalUserId'])) {
        $this->airavataInternalUserId = $vals['airavataInternalUserId'];
      }
      if (isset($vals['userName'])) {
        $this->userName = $vals['userName'];
      }
      if (isset($vals['gatewayId'])) {
        $this->gatewayId = $vals['gatewayId'];
      }
      if (isset($vals['firstName'])) {
        $this->firstName = $vals['firstName'];
      }
      if (isset($vals['lastName'])) {
        $this->lastName = $vals['lastName'];
      }
      if (isset($vals['email'])) {
        $this->email = $vals['email'];
      }
    }
  }

  public function getName() {
    return 'User';
  }

  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->airavataInternalUserId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->userName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->firstName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->lastName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->email);
          } 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('User');
    if ($this->airavataInternalUserId !== null) {
      $xfer += $output->writeFieldBegin('airavataInternalUserId', TType::STRING, 1);
      $xfer += $output->writeString($this->airavataInternalUserId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->userName !== null) {
      $xfer += $output->writeFieldBegin('userName', TType::STRING, 2);
      $xfer += $output->writeString($this->userName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayId !== null) {
      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
      $xfer += $output->writeString($this->gatewayId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->firstName !== null) {
      $xfer += $output->writeFieldBegin('firstName', TType::STRING, 4);
      $xfer += $output->writeString($this->firstName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->lastName !== null) {
      $xfer += $output->writeFieldBegin('lastName', TType::STRING, 5);
      $xfer += $output->writeString($this->lastName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->email !== null) {
      $xfer += $output->writeFieldBegin('email', TType::STRING, 6);
      $xfer += $output->writeString($this->email);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Gateway {
  static $_TSPEC;

  /**
   * @var string
   */
  public $airavataInternalGatewayId = null;
  /**
   * @var string
   */
  public $gatewayId = null;
  /**
   * @var int
   */
  public $gatewayApprovalStatus = null;
  /**
   * @var string
   */
  public $gatewayName = null;
  /**
   * @var string
   */
  public $domain = null;
  /**
   * @var string
   */
  public $emailAddress = null;
  /**
   * @var string
   */
  public $gatewayAcronym = null;
  /**
   * @var string
   */
  public $gatewayURL = null;
  /**
   * @var string
   */
  public $gatewayPublicAbstract = null;
  /**
   * @var string
   */
  public $reviewProposalDescription = null;
  /**
   * @var string
   */
  public $gatewayAdminFirstName = null;
  /**
   * @var string
   */
  public $gatewayAdminLastName = null;
  /**
   * @var string
   */
  public $gatewayAdminEmail = null;
  /**
   * @var string
   */
  public $identityServerUserName = null;
  /**
   * @var string
   */
  public $identityServerPasswordToken = null;
  /**
   * @var string
   */
  public $declinedReason = null;
  /**
   * @var string
   */
  public $oauthClientId = null;
  /**
   * @var string
   */
  public $oauthClientSecret = null;
  /**
   * @var int
   */
  public $requestCreationTime = null;
  /**
   * @var string
   */
  public $requesterUsername = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'airavataInternalGatewayId',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'gatewayId',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'gatewayApprovalStatus',
          'type' => TType::I32,
          ),
        4 => array(
          'var' => 'gatewayName',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'domain',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'emailAddress',
          'type' => TType::STRING,
          ),
        7 => array(
          'var' => 'gatewayAcronym',
          'type' => TType::STRING,
          ),
        8 => array(
          'var' => 'gatewayURL',
          'type' => TType::STRING,
          ),
        9 => array(
          'var' => 'gatewayPublicAbstract',
          'type' => TType::STRING,
          ),
        10 => array(
          'var' => 'reviewProposalDescription',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'gatewayAdminFirstName',
          'type' => TType::STRING,
          ),
        12 => array(
          'var' => 'gatewayAdminLastName',
          'type' => TType::STRING,
          ),
        13 => array(
          'var' => 'gatewayAdminEmail',
          'type' => TType::STRING,
          ),
        14 => array(
          'var' => 'identityServerUserName',
          'type' => TType::STRING,
          ),
        15 => array(
          'var' => 'identityServerPasswordToken',
          'type' => TType::STRING,
          ),
        16 => array(
          'var' => 'declinedReason',
          'type' => TType::STRING,
          ),
        17 => array(
          'var' => 'oauthClientId',
          'type' => TType::STRING,
          ),
        18 => array(
          'var' => 'oauthClientSecret',
          'type' => TType::STRING,
          ),
        19 => array(
          'var' => 'requestCreationTime',
          'type' => TType::I64,
          ),
        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'];
      }
      if (isset($vals['gatewayApprovalStatus'])) {
        $this->gatewayApprovalStatus = $vals['gatewayApprovalStatus'];
      }
      if (isset($vals['gatewayName'])) {
        $this->gatewayName = $vals['gatewayName'];
      }
      if (isset($vals['domain'])) {
        $this->domain = $vals['domain'];
      }
      if (isset($vals['emailAddress'])) {
        $this->emailAddress = $vals['emailAddress'];
      }
      if (isset($vals['gatewayAcronym'])) {
        $this->gatewayAcronym = $vals['gatewayAcronym'];
      }
      if (isset($vals['gatewayURL'])) {
        $this->gatewayURL = $vals['gatewayURL'];
      }
      if (isset($vals['gatewayPublicAbstract'])) {
        $this->gatewayPublicAbstract = $vals['gatewayPublicAbstract'];
      }
      if (isset($vals['reviewProposalDescription'])) {
        $this->reviewProposalDescription = $vals['reviewProposalDescription'];
      }
      if (isset($vals['gatewayAdminFirstName'])) {
        $this->gatewayAdminFirstName = $vals['gatewayAdminFirstName'];
      }
      if (isset($vals['gatewayAdminLastName'])) {
        $this->gatewayAdminLastName = $vals['gatewayAdminLastName'];
      }
      if (isset($vals['gatewayAdminEmail'])) {
        $this->gatewayAdminEmail = $vals['gatewayAdminEmail'];
      }
      if (isset($vals['identityServerUserName'])) {
        $this->identityServerUserName = $vals['identityServerUserName'];
      }
      if (isset($vals['identityServerPasswordToken'])) {
        $this->identityServerPasswordToken = $vals['identityServerPasswordToken'];
      }
      if (isset($vals['declinedReason'])) {
        $this->declinedReason = $vals['declinedReason'];
      }
      if (isset($vals['oauthClientId'])) {
        $this->oauthClientId = $vals['oauthClientId'];
      }
      if (isset($vals['oauthClientSecret'])) {
        $this->oauthClientSecret = $vals['oauthClientSecret'];
      }
      if (isset($vals['requestCreationTime'])) {
        $this->requestCreationTime = $vals['requestCreationTime'];
      }
      if (isset($vals['requesterUsername'])) {
        $this->requesterUsername = $vals['requesterUsername'];
      }
    }
  }

  public function getName() {
    return 'Gateway';
  }

  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->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 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->domain);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->emailAddress);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayAcronym);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayURL);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayPublicAbstract);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->reviewProposalDescription);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayAdminFirstName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayAdminLastName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->gatewayAdminEmail);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 14:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->identityServerUserName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 15:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->identityServerPasswordToken);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 16:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->declinedReason);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 17:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->oauthClientId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 18:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->oauthClientSecret);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 19:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->requestCreationTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 20:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->requesterUsername);
          } 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('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, 2);
      $xfer += $output->writeString($this->gatewayId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayApprovalStatus !== null) {
      $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, 4);
      $xfer += $output->writeString($this->gatewayName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->domain !== null) {
      $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, 6);
      $xfer += $output->writeString($this->emailAddress);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayAcronym !== null) {
      $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, 8);
      $xfer += $output->writeString($this->gatewayURL);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayPublicAbstract !== null) {
      $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, 10);
      $xfer += $output->writeString($this->reviewProposalDescription);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayAdminFirstName !== null) {
      $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, 12);
      $xfer += $output->writeString($this->gatewayAdminLastName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayAdminEmail !== null) {
      $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, 14);
      $xfer += $output->writeString($this->identityServerUserName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->identityServerPasswordToken !== null) {
      $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, 16);
      $xfer += $output->writeString($this->declinedReason);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->oauthClientId !== null) {
      $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, 18);
      $xfer += $output->writeString($this->oauthClientSecret);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->requestCreationTime !== null) {
      $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, 20);
      $xfer += $output->writeString($this->requesterUsername);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class GatewayUsageReportingCommand {
  static $_TSPEC;

  /**
   * @var string
   */
  public $gatewayId = null;
  /**
   * @var string
   */
  public $computeResourceId = null;
  /**
   * @var string
   */
  public $command = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'gatewayId',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'computeResourceId',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'command',
          'type' => TType::STRING,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['gatewayId'])) {
        $this->gatewayId = $vals['gatewayId'];
      }
      if (isset($vals['computeResourceId'])) {
        $this->computeResourceId = $vals['computeResourceId'];
      }
      if (isset($vals['command'])) {
        $this->command = $vals['command'];
      }
    }
  }

  public function getName() {
    return 'GatewayUsageReportingCommand';
  }

  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->gatewayId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->computeResourceId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->command);
          } 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('GatewayUsageReportingCommand');
    if ($this->gatewayId !== null) {
      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 1);
      $xfer += $output->writeString($this->gatewayId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->computeResourceId !== null) {
      $xfer += $output->writeFieldBegin('computeResourceId', TType::STRING, 2);
      $xfer += $output->writeString($this->computeResourceId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->command !== null) {
      $xfer += $output->writeFieldBegin('command', TType::STRING, 3);
      $xfer += $output->writeString($this->command);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Notification {
  static $_TSPEC;

  /**
   * @var string
   */
  public $notificationId = null;
  /**
   * @var string
   */
  public $gatewayId = null;
  /**
   * @var string
   */
  public $title = null;
  /**
   * @var string
   */
  public $notificationMessage = null;
  /**
   * @var int
   */
  public $creationTime = null;
  /**
   * @var int
   */
  public $publishedTime = null;
  /**
   * @var int
   */
  public $expirationTime = null;
  /**
   * @var int
   */
  public $priority = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'notificationId',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'gatewayId',
          'type' => TType::STRING,
          ),
        3 => array(
          'var' => 'title',
          'type' => TType::STRING,
          ),
        4 => array(
          'var' => 'notificationMessage',
          'type' => TType::STRING,
          ),
        5 => array(
          'var' => 'creationTime',
          'type' => TType::I64,
          ),
        6 => array(
          'var' => 'publishedTime',
          'type' => TType::I64,
          ),
        7 => array(
          'var' => 'expirationTime',
          'type' => TType::I64,
          ),
        8 => array(
          'var' => 'priority',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['notificationId'])) {
        $this->notificationId = $vals['notificationId'];
      }
      if (isset($vals['gatewayId'])) {
        $this->gatewayId = $vals['gatewayId'];
      }
      if (isset($vals['title'])) {
        $this->title = $vals['title'];
      }
      if (isset($vals['notificationMessage'])) {
        $this->notificationMessage = $vals['notificationMessage'];
      }
      if (isset($vals['creationTime'])) {
        $this->creationTime = $vals['creationTime'];
      }
      if (isset($vals['publishedTime'])) {
        $this->publishedTime = $vals['publishedTime'];
      }
      if (isset($vals['expirationTime'])) {
        $this->expirationTime = $vals['expirationTime'];
      }
      if (isset($vals['priority'])) {
        $this->priority = $vals['priority'];
      }
    }
  }

  public function getName() {
    return 'Notification';
  }

  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->notificationId);
          } 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::STRING) {
            $xfer += $input->readString($this->title);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->notificationMessage);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->creationTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->publishedTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I64) {
            $xfer += $input->readI64($this->expirationTime);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->priority);
          } 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('Notification');
    if ($this->notificationId !== null) {
      $xfer += $output->writeFieldBegin('notificationId', TType::STRING, 1);
      $xfer += $output->writeString($this->notificationId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->gatewayId !== null) {
      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
      $xfer += $output->writeString($this->gatewayId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->title !== null) {
      $xfer += $output->writeFieldBegin('title', TType::STRING, 3);
      $xfer += $output->writeString($this->title);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->notificationMessage !== null) {
      $xfer += $output->writeFieldBegin('notificationMessage', TType::STRING, 4);
      $xfer += $output->writeString($this->notificationMessage);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->creationTime !== null) {
      $xfer += $output->writeFieldBegin('creationTime', TType::I64, 5);
      $xfer += $output->writeI64($this->creationTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->publishedTime !== null) {
      $xfer += $output->writeFieldBegin('publishedTime', TType::I64, 6);
      $xfer += $output->writeI64($this->publishedTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->expirationTime !== null) {
      $xfer += $output->writeFieldBegin('expirationTime', TType::I64, 7);
      $xfer += $output->writeI64($this->expirationTime);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->priority !== null) {
      $xfer += $output->writeFieldBegin('priority', TType::I32, 8);
      $xfer += $output->writeI32($this->priority);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}


