<?php
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
require_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';


final class City {
  const NYC = 0;
  const MPK = 1;
  const SEA = 2;
  const LON = 3;
  static public $__names = array(
    0 => 'NYC',
    1 => 'MPK',
    2 => 'SEA',
    3 => 'LON',
  );
  static public $__values = array(
    'NYC' => 0,
    'MPK' => 1,
    'SEA' => 2,
    'LON' => 3,
  );
}

$GLOBALS['E_City'] = City::$__values;

final class Company {
  const FACEBOOK = 0;
  const WHATSAPP = 1;
  const OCULUS = 2;
  const INSTAGRAM = 3;
  static public $__names = array(
    0 => 'FACEBOOK',
    1 => 'WHATSAPP',
    2 => 'OCULUS',
    3 => 'INSTAGRAM',
  );
  static public $__values = array(
    'FACEBOOK' => 0,
    'WHATSAPP' => 1,
    'OCULUS' => 2,
    'INSTAGRAM' => 3,
  );
}

$GLOBALS['E_Company'] = Company::$__values;

class Internship implements IThriftStruct {
  static $_TSPEC = array(
    1 => array(
      'var' => 'weeks',
      'type' => TType::I32,
      ),
    2 => array(
      'var' => 'title',
      'type' => TType::STRING,
      ),
    3 => array(
      'var' => 'employer',
      'type' => TType::I32,
      'enum' => 'Company',
      ),
    );
  public static $_TFIELDMAP = array(
    'weeks' => 1,
    'title' => 2,
    'employer' => 3,
  );
  const STRUCTURAL_ID = 749038867953722654;
  public $weeks = null;
  public $title = null;
  public $employer = null;

  public function __construct($vals=null) {
    if (is_array($vals)) {
      if (isset($vals['weeks'])) {
        $this->weeks = $vals['weeks'];
      }
      if (isset($vals['title'])) {
        $this->title = $vals['title'];
      }
      if (isset($vals['employer'])) {
        $this->employer = $vals['employer'];
      }
    } else if ($vals) {
      throw new TProtocolException(
        'Internship constructor must be passed array or null'
      );
    }
  }

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

  public static function __set_state($vals) {
    return new Internship($vals);
  }

  public function read(TProtocol $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;
      }
      if (!$fid && $fname !== null) {
        if (isset(self::$_TFIELDMAP[$fname])) {
          $fid = self::$_TFIELDMAP[$fname];
          $ftype = self::$_TSPEC[$fid]['type'];
        }
      }
      switch ($fid)
      {
        case 1:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->weeks);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->title);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->employer);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    if (!isset($this->weeks)) {
      throw new TProtocolException("Required field 'weeks' was not found in serialized data! Struct: Internship", TProtocolException::MISSING_REQUIRED_FIELD);
    }
    return $xfer;
  }

  public function write(TProtocol $output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('Internship');
    if ($this->weeks !== null) {
      $xfer += $output->writeFieldBegin('weeks', TType::I32, 1);
      $xfer += $output->writeI32($this->weeks);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->title !== null) {
      $xfer += $output->writeFieldBegin('title', TType::STRING, 2);
      $xfer += $output->writeString($this->title);
      $xfer += $output->writeFieldEnd();
    }
    if (isset($this->employer) && $this->employer !== null) {
      $xfer += $output->writeFieldBegin('employer', TType::I32, 3);
      $xfer += $output->writeI32($this->employer);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

class Range implements IThriftStruct {
  static $_TSPEC = array(
    1 => array(
      'var' => 'min',
      'type' => TType::I32,
      ),
    2 => array(
      'var' => 'max',
      'type' => TType::I32,
      ),
    );
  public static $_TFIELDMAP = array(
    'min' => 1,
    'max' => 2,
  );
  const STRUCTURAL_ID = 6850388386457434767;
  public $min = null;
  public $max = null;

  public function __construct($vals=null) {
    if (is_array($vals)) {
      if (isset($vals['min'])) {
        $this->min = $vals['min'];
      }
      if (isset($vals['max'])) {
        $this->max = $vals['max'];
      }
    } else if ($vals) {
      throw new TProtocolException(
        'Range constructor must be passed array or null'
      );
    }
  }

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

  public static function __set_state($vals) {
    return new Range($vals);
  }

  public function read(TProtocol $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;
      }
      if (!$fid && $fname !== null) {
        if (isset(self::$_TFIELDMAP[$fname])) {
          $fid = self::$_TFIELDMAP[$fname];
          $ftype = self::$_TSPEC[$fid]['type'];
        }
      }
      switch ($fid)
      {
        case 1:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->min);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->max);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        default:
          $xfer += $input->skip($ftype);
          break;
      }
      $xfer += $input->readFieldEnd();
    }
    $xfer += $input->readStructEnd();
    if (!isset($this->min)) {
      throw new TProtocolException("Required field 'min' was not found in serialized data! Struct: Range", TProtocolException::MISSING_REQUIRED_FIELD);
    }
    if (!isset($this->max)) {
      throw new TProtocolException("Required field 'max' was not found in serialized data! Struct: Range", TProtocolException::MISSING_REQUIRED_FIELD);
    }
    return $xfer;
  }

  public function write(TProtocol $output) {
    $xfer = 0;
    $xfer += $output->writeStructBegin('Range');
    if ($this->min !== null) {
      $xfer += $output->writeFieldBegin('min', TType::I32, 1);
      $xfer += $output->writeI32($this->min);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->max !== null) {
      $xfer += $output->writeFieldBegin('max', TType::I32, 2);
      $xfer += $output->writeI32($this->max);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}

?>
