<?php
namespace Airavata\Model\Scheduling;

/**
 * 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;


/**
 * ComputationalResourceSchedulingModel:
 * 
 * 
 */
class ComputationalResourceSchedulingModel {
  static $_TSPEC;

  /**
   * @var string
   */
  public $resourceHostId = null;
  /**
   * @var int
   */
  public $totalCPUCount = null;
  /**
   * @var int
   */
  public $nodeCount = null;
  /**
   * @var int
   */
  public $numberOfThreads = null;
  /**
   * @var string
   */
  public $queueName = null;
  /**
   * @var int
   */
  public $wallTimeLimit = null;
  /**
   * @var int
   */
  public $totalPhysicalMemory = null;
  /**
   * @var string
   */
  public $chessisNumber = null;
  /**
   * @var string
   */
  public $staticWorkingDir = null;
  /**
   * @var string
   */
  public $overrideLoginUserName = null;
  /**
   * @var string
   */
  public $overrideScratchLocation = null;
  /**
   * @var string
   */
  public $overrideAllocationProjectNumber = null;
  /**
   * @var int
   */
  public $mGroupCount = null;

  public function __construct($vals=null) {
    if (!isset(self::$_TSPEC)) {
      self::$_TSPEC = array(
        1 => array(
          'var' => 'resourceHostId',
          'type' => TType::STRING,
          ),
        2 => array(
          'var' => 'totalCPUCount',
          'type' => TType::I32,
          ),
        3 => array(
          'var' => 'nodeCount',
          'type' => TType::I32,
          ),
        4 => array(
          'var' => 'numberOfThreads',
          'type' => TType::I32,
          ),
        5 => array(
          'var' => 'queueName',
          'type' => TType::STRING,
          ),
        6 => array(
          'var' => 'wallTimeLimit',
          'type' => TType::I32,
          ),
        7 => array(
          'var' => 'totalPhysicalMemory',
          'type' => TType::I32,
          ),
        8 => array(
          'var' => 'chessisNumber',
          'type' => TType::STRING,
          ),
        9 => array(
          'var' => 'staticWorkingDir',
          'type' => TType::STRING,
          ),
        10 => array(
          'var' => 'overrideLoginUserName',
          'type' => TType::STRING,
          ),
        11 => array(
          'var' => 'overrideScratchLocation',
          'type' => TType::STRING,
          ),
        12 => array(
          'var' => 'overrideAllocationProjectNumber',
          'type' => TType::STRING,
          ),
        13 => array(
          'var' => 'mGroupCount',
          'type' => TType::I32,
          ),
        );
    }
    if (is_array($vals)) {
      if (isset($vals['resourceHostId'])) {
        $this->resourceHostId = $vals['resourceHostId'];
      }
      if (isset($vals['totalCPUCount'])) {
        $this->totalCPUCount = $vals['totalCPUCount'];
      }
      if (isset($vals['nodeCount'])) {
        $this->nodeCount = $vals['nodeCount'];
      }
      if (isset($vals['numberOfThreads'])) {
        $this->numberOfThreads = $vals['numberOfThreads'];
      }
      if (isset($vals['queueName'])) {
        $this->queueName = $vals['queueName'];
      }
      if (isset($vals['wallTimeLimit'])) {
        $this->wallTimeLimit = $vals['wallTimeLimit'];
      }
      if (isset($vals['totalPhysicalMemory'])) {
        $this->totalPhysicalMemory = $vals['totalPhysicalMemory'];
      }
      if (isset($vals['chessisNumber'])) {
        $this->chessisNumber = $vals['chessisNumber'];
      }
      if (isset($vals['staticWorkingDir'])) {
        $this->staticWorkingDir = $vals['staticWorkingDir'];
      }
      if (isset($vals['overrideLoginUserName'])) {
        $this->overrideLoginUserName = $vals['overrideLoginUserName'];
      }
      if (isset($vals['overrideScratchLocation'])) {
        $this->overrideScratchLocation = $vals['overrideScratchLocation'];
      }
      if (isset($vals['overrideAllocationProjectNumber'])) {
        $this->overrideAllocationProjectNumber = $vals['overrideAllocationProjectNumber'];
      }
      if (isset($vals['mGroupCount'])) {
        $this->mGroupCount = $vals['mGroupCount'];
      }
    }
  }

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

  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->resourceHostId);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 2:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->totalCPUCount);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 3:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->nodeCount);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 4:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->numberOfThreads);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 5:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->queueName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 6:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->wallTimeLimit);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 7:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->totalPhysicalMemory);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 8:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->chessisNumber);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 9:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->staticWorkingDir);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 10:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->overrideLoginUserName);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 11:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->overrideScratchLocation);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 12:
          if ($ftype == TType::STRING) {
            $xfer += $input->readString($this->overrideAllocationProjectNumber);
          } else {
            $xfer += $input->skip($ftype);
          }
          break;
        case 13:
          if ($ftype == TType::I32) {
            $xfer += $input->readI32($this->mGroupCount);
          } 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('ComputationalResourceSchedulingModel');
    if ($this->resourceHostId !== null) {
      $xfer += $output->writeFieldBegin('resourceHostId', TType::STRING, 1);
      $xfer += $output->writeString($this->resourceHostId);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->totalCPUCount !== null) {
      $xfer += $output->writeFieldBegin('totalCPUCount', TType::I32, 2);
      $xfer += $output->writeI32($this->totalCPUCount);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->nodeCount !== null) {
      $xfer += $output->writeFieldBegin('nodeCount', TType::I32, 3);
      $xfer += $output->writeI32($this->nodeCount);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->numberOfThreads !== null) {
      $xfer += $output->writeFieldBegin('numberOfThreads', TType::I32, 4);
      $xfer += $output->writeI32($this->numberOfThreads);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->queueName !== null) {
      $xfer += $output->writeFieldBegin('queueName', TType::STRING, 5);
      $xfer += $output->writeString($this->queueName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->wallTimeLimit !== null) {
      $xfer += $output->writeFieldBegin('wallTimeLimit', TType::I32, 6);
      $xfer += $output->writeI32($this->wallTimeLimit);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->totalPhysicalMemory !== null) {
      $xfer += $output->writeFieldBegin('totalPhysicalMemory', TType::I32, 7);
      $xfer += $output->writeI32($this->totalPhysicalMemory);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->chessisNumber !== null) {
      $xfer += $output->writeFieldBegin('chessisNumber', TType::STRING, 8);
      $xfer += $output->writeString($this->chessisNumber);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->staticWorkingDir !== null) {
      $xfer += $output->writeFieldBegin('staticWorkingDir', TType::STRING, 9);
      $xfer += $output->writeString($this->staticWorkingDir);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->overrideLoginUserName !== null) {
      $xfer += $output->writeFieldBegin('overrideLoginUserName', TType::STRING, 10);
      $xfer += $output->writeString($this->overrideLoginUserName);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->overrideScratchLocation !== null) {
      $xfer += $output->writeFieldBegin('overrideScratchLocation', TType::STRING, 11);
      $xfer += $output->writeString($this->overrideScratchLocation);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->overrideAllocationProjectNumber !== null) {
      $xfer += $output->writeFieldBegin('overrideAllocationProjectNumber', TType::STRING, 12);
      $xfer += $output->writeString($this->overrideAllocationProjectNumber);
      $xfer += $output->writeFieldEnd();
    }
    if ($this->mGroupCount !== null) {
      $xfer += $output->writeFieldBegin('mGroupCount', TType::I32, 13);
      $xfer += $output->writeI32($this->mGroupCount);
      $xfer += $output->writeFieldEnd();
    }
    $xfer += $output->writeFieldStop();
    $xfer += $output->writeStructEnd();
    return $xfer;
  }

}


