adding missing Thrift User model types
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/16b4d1ba Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/16b4d1ba Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/16b4d1ba Branch: refs/heads/master Commit: 16b4d1ba94303e667709b036a5000863266fcc96 Parents: 83b5332 Author: scnakandala <[email protected]> Authored: Mon Jun 27 16:24:36 2016 -0400 Committer: scnakandala <[email protected]> Committed: Mon Jun 27 16:24:36 2016 -0400 ---------------------------------------------------------------------- app/libraries/Airavata/Model/User/Types.php | 1079 ++++++++++++++++++++++ 1 file changed, 1079 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/16b4d1ba/app/libraries/Airavata/Model/User/Types.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/Model/User/Types.php b/app/libraries/Airavata/Model/User/Types.php new file mode 100644 index 0000000..56e889b --- /dev/null +++ b/app/libraries/Airavata/Model/User/Types.php @@ -0,0 +1,1079 @@ +<?php +namespace Airavata\Model\User; + +/** + * 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; + + +final class Status { + const ACTIVE = 0; + const CONFIRMED = 1; + const APPROVED = 2; + const DELETED = 3; + const DUPLICATE = 4; + const GRACE_PERIOD = 5; + const INVITED = 6; + const DENIED = 7; + const PENDING = 8; + const PENDING_APPROVAL = 9; + const PENDING_CONFIRMATION = 10; + const SUSPENDED = 11; + const DECLINED = 12; + const EXPIRED = 13; + static public $__names = array( + 0 => 'ACTIVE', + 1 => 'CONFIRMED', + 2 => 'APPROVED', + 3 => 'DELETED', + 4 => 'DUPLICATE', + 5 => 'GRACE_PERIOD', + 6 => 'INVITED', + 7 => 'DENIED', + 8 => 'PENDING', + 9 => 'PENDING_APPROVAL', + 10 => 'PENDING_CONFIRMATION', + 11 => 'SUSPENDED', + 12 => 'DECLINED', + 13 => 'EXPIRED', + ); +} + +/** + * U.S. Citizen (see: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * + */ +final class USCitizenship { + const US_CITIZEN = 0; + const US_PERMANENT_RESIDENT = 1; + const OTHER_NON_US_CITIZEN = 2; + static public $__names = array( + 0 => 'US_CITIZEN', + 1 => 'US_PERMANENT_RESIDENT', + 2 => 'OTHER_NON_US_CITIZEN', + ); +} + +/** + * Hispanic or Latino - a person of Mexican, Puerto Rican, Cuban, South or + * Central American, or other Spanish culture or origin, regardless of race. + * + */ +final class ethnicity { + const HISPANIC_LATINO = 0; + const NOT_HISPANIC_LATINO = 1; + static public $__names = array( + 0 => 'HISPANIC_LATINO', + 1 => 'NOT_HISPANIC_LATINO', + ); +} + +/** + * * Asian - a person having origins in any of the original peoples of the Far East, + * * Southeast Asia, or the Indian subcontinent including, for example, Cambodia, + * * China, India, Japan, Korea, Malaysia, Pakistan, the Philippine Islands, + * * Thailand, and Vietnam. + * * American Indian or Alaskan Native - a person having origins in any of the original + * * peoples of North and South America (including Central America), and who maintains + * * tribal affiliation or community attachment. + * * Black or African American - a person having origins in any of the black racial groups + * * of Africa. + * * Native Hawaiian or Pacific Islander - a person having origins in any of the original + * * peoples of Hawaii, Guan, Samoa, or other Pacific Islands. + * * White - a person having origins in any of the original peoples of Europe, the Middle East, or North Africa. + * * + */ +final class race { + const ASIAN = 0; + const AMERICAN_INDIAN_OR_ALASKAN_NATIVE = 1; + const BLACK_OR_AFRICAN_AMERICAN = 2; + const NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = 3; + const WHITE = 4; + static public $__names = array( + 0 => 'ASIAN', + 1 => 'AMERICAN_INDIAN_OR_ALASKAN_NATIVE', + 2 => 'BLACK_OR_AFRICAN_AMERICAN', + 3 => 'NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER', + 4 => 'WHITE', + ); +} + +final class disability { + const HEARING_IMAPAIRED = 0; + const VISUAL_IMPAIRED = 1; + const MOBILITY_OR_ORTHOPEDIC_IMPAIRMENT = 2; + const OTHER_IMPAIRMENT = 3; + static public $__names = array( + 0 => 'HEARING_IMAPAIRED', + 1 => 'VISUAL_IMPAIRED', + 2 => 'MOBILITY_OR_ORTHOPEDIC_IMPAIRMENT', + 3 => 'OTHER_IMPAIRMENT', + ); +} + +/** + * A structure holding the NSF Demographic information. + * + * + */ +class NSFDemographics { + static $_TSPEC; + + /** + * @var string + */ + public $gender = null; + /** + * @var int + */ + public $usCitizenship = null; + /** + * @var int[] + */ + public $ethnicities = null; + /** + * @var int[] + */ + public $races = null; + /** + * @var int[] + */ + public $disabilities = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'gender', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'usCitizenship', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'ethnicities', + 'type' => TType::LST, + 'etype' => TType::I32, + 'elem' => array( + 'type' => TType::I32, + ), + ), + 4 => array( + 'var' => 'races', + 'type' => TType::LST, + 'etype' => TType::I32, + 'elem' => array( + 'type' => TType::I32, + ), + ), + 5 => array( + 'var' => 'disabilities', + 'type' => TType::LST, + 'etype' => TType::I32, + 'elem' => array( + 'type' => TType::I32, + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['gender'])) { + $this->gender = $vals['gender']; + } + if (isset($vals['usCitizenship'])) { + $this->usCitizenship = $vals['usCitizenship']; + } + if (isset($vals['ethnicities'])) { + $this->ethnicities = $vals['ethnicities']; + } + if (isset($vals['races'])) { + $this->races = $vals['races']; + } + if (isset($vals['disabilities'])) { + $this->disabilities = $vals['disabilities']; + } + } + } + + public function getName() { + return 'NSFDemographics'; + } + + 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->gender); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->usCitizenship); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->ethnicities = array(); + $_size0 = 0; + $_etype3 = 0; + $xfer += $input->readListBegin($_etype3, $_size0); + for ($_i4 = 0; $_i4 < $_size0; ++$_i4) + { + $elem5 = null; + $xfer += $input->readI32($elem5); + $this->ethnicities []= $elem5; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::LST) { + $this->races = array(); + $_size6 = 0; + $_etype9 = 0; + $xfer += $input->readListBegin($_etype9, $_size6); + for ($_i10 = 0; $_i10 < $_size6; ++$_i10) + { + $elem11 = null; + $xfer += $input->readI32($elem11); + $this->races []= $elem11; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::LST) { + $this->disabilities = array(); + $_size12 = 0; + $_etype15 = 0; + $xfer += $input->readListBegin($_etype15, $_size12); + for ($_i16 = 0; $_i16 < $_size12; ++$_i16) + { + $elem17 = null; + $xfer += $input->readI32($elem17); + $this->disabilities []= $elem17; + } + $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('NSFDemographics'); + if ($this->gender !== null) { + $xfer += $output->writeFieldBegin('gender', TType::STRING, 1); + $xfer += $output->writeString($this->gender); + $xfer += $output->writeFieldEnd(); + } + if ($this->usCitizenship !== null) { + $xfer += $output->writeFieldBegin('usCitizenship', TType::I32, 2); + $xfer += $output->writeI32($this->usCitizenship); + $xfer += $output->writeFieldEnd(); + } + if ($this->ethnicities !== null) { + if (!is_array($this->ethnicities)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('ethnicities', TType::LST, 3); + { + $output->writeListBegin(TType::I32, count($this->ethnicities)); + { + foreach ($this->ethnicities as $iter18) + { + $xfer += $output->writeI32($iter18); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->races !== null) { + if (!is_array($this->races)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('races', TType::LST, 4); + { + $output->writeListBegin(TType::I32, count($this->races)); + { + foreach ($this->races as $iter19) + { + $xfer += $output->writeI32($iter19); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->disabilities !== null) { + if (!is_array($this->disabilities)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('disabilities', TType::LST, 5); + { + $output->writeListBegin(TType::I32, count($this->disabilities)); + { + foreach ($this->disabilities as $iter20) + { + $xfer += $output->writeI32($iter20); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +/** + * * A structure holding the user profile and its child models. + * * + * * Notes: + * * The model does not include passwords as it is assumed an external identity provider is used to authenticate user. + * * References: + * * NSF Demographic Information - http://www.nsf.gov/pubs/2000/00form1225/00form1225.doc + * * LDAP Schema - https://tools.ietf.org/html/rfc4519 + * * SCIM 2.0 - https://tools.ietf.org/html/rfc7643 + * * + * * userModelVersion: + * * Version number of profile + * * + * * airavataInternalUserId: + * * internal to Airavata, not intended to be used outside of the Airavata platform or possibly by gateways + * * (that is, never shown to users), never reassigned, REQUIRED + * * + * * userId: + * * Externally assertable unique identifier. SAML (primarly in higher education, academic) tends to keep + * * user name less opaque. OpenID Connect maintains them to be opaque. + * * + * * emails: + * * Email identifier are Verified, REQUIRED and MULTIVALUED + * * + * * userName: + * * Name-based identifiers can be multivalues. To keep it simple, Airavata will make it a string. + * * In the future these can be enumerated as: + * * Official name (as asserted possibly by some external identity provider) + * * Prefered name (as asserted or suggested by user directly) + * * Components: + * * givenName + * * surname (familyName) + * * displayName (often asserted by user to handle things like middle names, suffix, prefix, and the like) + * * + * * orcidId: ORCID ID - http://orcid.org/about/what-is-orcid) + * * + * * phones: Telephone MULTIVALUED + * * + * * country: Country of Residance + * * + * * nationality Countries of citizenship + * * + * * comments: + * * Free-form information (treated as opaque by Airavata and simply passed to resource). + * * + * * labeledURI: + * * Google Scholar, Web of Science, ACS, e.t.c + * * + * * timeZone: + * * Userâs preferred timezone - IANA Timezone Databases - http://www.iana.org/time-zones. + * * + */ +class UserProfile { + static $_TSPEC; + + /** + * @var string + */ + public $userModelVersion = "1.0"; + /** + * @var string + */ + public $airavataInternalUserId = "DO_NOT_SET_AT_CLIENTS"; + /** + * @var string + */ + public $userId = null; + /** + * @var string[] + */ + public $emails = null; + /** + * @var string + */ + public $userName = null; + /** + * @var string + */ + public $gatewayId = null; + /** + * @var string + */ + public $orcidId = null; + /** + * @var string[] + */ + public $phones = null; + /** + * @var string + */ + public $country = null; + /** + * @var string[] + */ + public $nationality = null; + /** + * @var string + */ + public $homeOrganization = null; + /** + * @var string + */ + public $orginationAffiliation = null; + /** + * @var string + */ + public $creationTime = null; + /** + * @var string + */ + public $lastAccessTime = null; + /** + * @var string + */ + public $validUntil = null; + /** + * @var int + */ + public $State = null; + /** + * @var string + */ + public $comments = null; + /** + * @var string[] + */ + public $labeledURI = null; + /** + * @var string + */ + public $gpgKey = null; + /** + * @var string + */ + public $timeZone = null; + /** + * @var \Airavata\Model\User\NSFDemographics + */ + public $nsfDemographics = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'userModelVersion', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'airavataInternalUserId', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'userId', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'emails', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 5 => array( + 'var' => 'userName', + 'type' => TType::STRING, + ), + 6 => array( + 'var' => 'gatewayId', + 'type' => TType::STRING, + ), + 7 => array( + 'var' => 'orcidId', + 'type' => TType::STRING, + ), + 8 => array( + 'var' => 'phones', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 9 => array( + 'var' => 'country', + 'type' => TType::STRING, + ), + 10 => array( + 'var' => 'nationality', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 11 => array( + 'var' => 'homeOrganization', + 'type' => TType::STRING, + ), + 12 => array( + 'var' => 'orginationAffiliation', + 'type' => TType::STRING, + ), + 13 => array( + 'var' => 'creationTime', + 'type' => TType::STRING, + ), + 14 => array( + 'var' => 'lastAccessTime', + 'type' => TType::STRING, + ), + 15 => array( + 'var' => 'validUntil', + 'type' => TType::STRING, + ), + 16 => array( + 'var' => 'State', + 'type' => TType::I32, + ), + 17 => array( + 'var' => 'comments', + 'type' => TType::STRING, + ), + 18 => array( + 'var' => 'labeledURI', + 'type' => TType::LST, + 'etype' => TType::STRING, + 'elem' => array( + 'type' => TType::STRING, + ), + ), + 19 => array( + 'var' => 'gpgKey', + 'type' => TType::STRING, + ), + 20 => array( + 'var' => 'timeZone', + 'type' => TType::STRING, + ), + 21 => array( + 'var' => 'nsfDemographics', + 'type' => TType::STRUCT, + 'class' => '\Airavata\Model\User\NSFDemographics', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['userModelVersion'])) { + $this->userModelVersion = $vals['userModelVersion']; + } + if (isset($vals['airavataInternalUserId'])) { + $this->airavataInternalUserId = $vals['airavataInternalUserId']; + } + if (isset($vals['userId'])) { + $this->userId = $vals['userId']; + } + if (isset($vals['emails'])) { + $this->emails = $vals['emails']; + } + if (isset($vals['userName'])) { + $this->userName = $vals['userName']; + } + if (isset($vals['gatewayId'])) { + $this->gatewayId = $vals['gatewayId']; + } + if (isset($vals['orcidId'])) { + $this->orcidId = $vals['orcidId']; + } + if (isset($vals['phones'])) { + $this->phones = $vals['phones']; + } + if (isset($vals['country'])) { + $this->country = $vals['country']; + } + if (isset($vals['nationality'])) { + $this->nationality = $vals['nationality']; + } + if (isset($vals['homeOrganization'])) { + $this->homeOrganization = $vals['homeOrganization']; + } + if (isset($vals['orginationAffiliation'])) { + $this->orginationAffiliation = $vals['orginationAffiliation']; + } + if (isset($vals['creationTime'])) { + $this->creationTime = $vals['creationTime']; + } + if (isset($vals['lastAccessTime'])) { + $this->lastAccessTime = $vals['lastAccessTime']; + } + if (isset($vals['validUntil'])) { + $this->validUntil = $vals['validUntil']; + } + if (isset($vals['State'])) { + $this->State = $vals['State']; + } + if (isset($vals['comments'])) { + $this->comments = $vals['comments']; + } + if (isset($vals['labeledURI'])) { + $this->labeledURI = $vals['labeledURI']; + } + if (isset($vals['gpgKey'])) { + $this->gpgKey = $vals['gpgKey']; + } + if (isset($vals['timeZone'])) { + $this->timeZone = $vals['timeZone']; + } + if (isset($vals['nsfDemographics'])) { + $this->nsfDemographics = $vals['nsfDemographics']; + } + } + } + + public function getName() { + return 'UserProfile'; + } + + 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->userModelVersion); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->airavataInternalUserId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->userId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::LST) { + $this->emails = array(); + $_size21 = 0; + $_etype24 = 0; + $xfer += $input->readListBegin($_etype24, $_size21); + for ($_i25 = 0; $_i25 < $_size21; ++$_i25) + { + $elem26 = null; + $xfer += $input->readString($elem26); + $this->emails []= $elem26; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->userName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->gatewayId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 7: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->orcidId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 8: + if ($ftype == TType::LST) { + $this->phones = array(); + $_size27 = 0; + $_etype30 = 0; + $xfer += $input->readListBegin($_etype30, $_size27); + for ($_i31 = 0; $_i31 < $_size27; ++$_i31) + { + $elem32 = null; + $xfer += $input->readString($elem32); + $this->phones []= $elem32; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 9: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->country); + } else { + $xfer += $input->skip($ftype); + } + break; + case 10: + if ($ftype == TType::LST) { + $this->nationality = array(); + $_size33 = 0; + $_etype36 = 0; + $xfer += $input->readListBegin($_etype36, $_size33); + for ($_i37 = 0; $_i37 < $_size33; ++$_i37) + { + $elem38 = null; + $xfer += $input->readString($elem38); + $this->nationality []= $elem38; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 11: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->homeOrganization); + } else { + $xfer += $input->skip($ftype); + } + break; + case 12: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->orginationAffiliation); + } else { + $xfer += $input->skip($ftype); + } + break; + case 13: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->creationTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 14: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->lastAccessTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 15: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->validUntil); + } else { + $xfer += $input->skip($ftype); + } + break; + case 16: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->State); + } else { + $xfer += $input->skip($ftype); + } + break; + case 17: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->comments); + } else { + $xfer += $input->skip($ftype); + } + break; + case 18: + if ($ftype == TType::LST) { + $this->labeledURI = array(); + $_size39 = 0; + $_etype42 = 0; + $xfer += $input->readListBegin($_etype42, $_size39); + for ($_i43 = 0; $_i43 < $_size39; ++$_i43) + { + $elem44 = null; + $xfer += $input->readString($elem44); + $this->labeledURI []= $elem44; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 19: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->gpgKey); + } else { + $xfer += $input->skip($ftype); + } + break; + case 20: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->timeZone); + } else { + $xfer += $input->skip($ftype); + } + break; + case 21: + if ($ftype == TType::STRUCT) { + $this->nsfDemographics = new \Airavata\Model\User\NSFDemographics(); + $xfer += $this->nsfDemographics->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('UserProfile'); + if ($this->userModelVersion !== null) { + $xfer += $output->writeFieldBegin('userModelVersion', TType::STRING, 1); + $xfer += $output->writeString($this->userModelVersion); + $xfer += $output->writeFieldEnd(); + } + if ($this->airavataInternalUserId !== null) { + $xfer += $output->writeFieldBegin('airavataInternalUserId', TType::STRING, 2); + $xfer += $output->writeString($this->airavataInternalUserId); + $xfer += $output->writeFieldEnd(); + } + if ($this->userId !== null) { + $xfer += $output->writeFieldBegin('userId', TType::STRING, 3); + $xfer += $output->writeString($this->userId); + $xfer += $output->writeFieldEnd(); + } + if ($this->emails !== null) { + if (!is_array($this->emails)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('emails', TType::LST, 4); + { + $output->writeListBegin(TType::STRING, count($this->emails)); + { + foreach ($this->emails as $iter45) + { + $xfer += $output->writeString($iter45); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->userName !== null) { + $xfer += $output->writeFieldBegin('userName', TType::STRING, 5); + $xfer += $output->writeString($this->userName); + $xfer += $output->writeFieldEnd(); + } + if ($this->gatewayId !== null) { + $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 6); + $xfer += $output->writeString($this->gatewayId); + $xfer += $output->writeFieldEnd(); + } + if ($this->orcidId !== null) { + $xfer += $output->writeFieldBegin('orcidId', TType::STRING, 7); + $xfer += $output->writeString($this->orcidId); + $xfer += $output->writeFieldEnd(); + } + if ($this->phones !== null) { + if (!is_array($this->phones)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('phones', TType::LST, 8); + { + $output->writeListBegin(TType::STRING, count($this->phones)); + { + foreach ($this->phones as $iter46) + { + $xfer += $output->writeString($iter46); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->country !== null) { + $xfer += $output->writeFieldBegin('country', TType::STRING, 9); + $xfer += $output->writeString($this->country); + $xfer += $output->writeFieldEnd(); + } + if ($this->nationality !== null) { + if (!is_array($this->nationality)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('nationality', TType::LST, 10); + { + $output->writeListBegin(TType::STRING, count($this->nationality)); + { + foreach ($this->nationality as $iter47) + { + $xfer += $output->writeString($iter47); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->homeOrganization !== null) { + $xfer += $output->writeFieldBegin('homeOrganization', TType::STRING, 11); + $xfer += $output->writeString($this->homeOrganization); + $xfer += $output->writeFieldEnd(); + } + if ($this->orginationAffiliation !== null) { + $xfer += $output->writeFieldBegin('orginationAffiliation', TType::STRING, 12); + $xfer += $output->writeString($this->orginationAffiliation); + $xfer += $output->writeFieldEnd(); + } + if ($this->creationTime !== null) { + $xfer += $output->writeFieldBegin('creationTime', TType::STRING, 13); + $xfer += $output->writeString($this->creationTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->lastAccessTime !== null) { + $xfer += $output->writeFieldBegin('lastAccessTime', TType::STRING, 14); + $xfer += $output->writeString($this->lastAccessTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->validUntil !== null) { + $xfer += $output->writeFieldBegin('validUntil', TType::STRING, 15); + $xfer += $output->writeString($this->validUntil); + $xfer += $output->writeFieldEnd(); + } + if ($this->State !== null) { + $xfer += $output->writeFieldBegin('State', TType::I32, 16); + $xfer += $output->writeI32($this->State); + $xfer += $output->writeFieldEnd(); + } + if ($this->comments !== null) { + $xfer += $output->writeFieldBegin('comments', TType::STRING, 17); + $xfer += $output->writeString($this->comments); + $xfer += $output->writeFieldEnd(); + } + if ($this->labeledURI !== null) { + if (!is_array($this->labeledURI)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('labeledURI', TType::LST, 18); + { + $output->writeListBegin(TType::STRING, count($this->labeledURI)); + { + foreach ($this->labeledURI as $iter48) + { + $xfer += $output->writeString($iter48); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->gpgKey !== null) { + $xfer += $output->writeFieldBegin('gpgKey', TType::STRING, 19); + $xfer += $output->writeString($this->gpgKey); + $xfer += $output->writeFieldEnd(); + } + if ($this->timeZone !== null) { + $xfer += $output->writeFieldBegin('timeZone', TType::STRING, 20); + $xfer += $output->writeString($this->timeZone); + $xfer += $output->writeFieldEnd(); + } + if ($this->nsfDemographics !== null) { + if (!is_object($this->nsfDemographics)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('nsfDemographics', TType::STRUCT, 21); + $xfer += $this->nsfDemographics->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +final class Constant extends \Thrift\Type\TConstant { + static protected $USER_PROFILE_VERSION; + + static protected function init_USER_PROFILE_VERSION() { + return "1.0"; + } +} + +
