pet.v1.Pet
*/
class Pet extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field .pet.v1.PetType pet_type = 1 [json_name = "petType"];
*/
protected $pet_type = 0;
/**
* Generated from protobuf field string pet_id = 2 [json_name = "petId"];
*/
protected $pet_id = '';
/**
* Generated from protobuf field string name = 3 [json_name = "name"];
*/
protected $name = '';
/**
* Generated from protobuf field .google.type.DateTime created_at = 4 [json_name = "createdAt"];
*/
protected $created_at = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int $pet_type
* @type string $pet_id
* @type string $name
* @type \Google\Type\DateTime $created_at
* }
*/
public function __construct($data = NULL) {
\Pet\V1\GPBMetadata\Pet::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field .pet.v1.PetType pet_type = 1 [json_name = "petType"];
* @return int
*/
public function getPetType()
{
return $this->pet_type;
}
/**
* Generated from protobuf field .pet.v1.PetType pet_type = 1 [json_name = "petType"];
* @param int $var
* @return $this
*/
public function setPetType($var)
{
GPBUtil::checkEnum($var, \Pet\V1\PetType::class);
$this->pet_type = $var;
return $this;
}
/**
* Generated from protobuf field string pet_id = 2 [json_name = "petId"];
* @return string
*/
public function getPetId()
{
return $this->pet_id;
}
/**
* Generated from protobuf field string pet_id = 2 [json_name = "petId"];
* @param string $var
* @return $this
*/
public function setPetId($var)
{
GPBUtil::checkString($var, True);
$this->pet_id = $var;
return $this;
}
/**
* Generated from protobuf field string name = 3 [json_name = "name"];
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Generated from protobuf field string name = 3 [json_name = "name"];
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* Generated from protobuf field .google.type.DateTime created_at = 4 [json_name = "createdAt"];
* @return \Google\Type\DateTime|null
*/
public function getCreatedAt()
{
return $this->created_at;
}
public function hasCreatedAt()
{
return isset($this->created_at);
}
public function clearCreatedAt()
{
unset($this->created_at);
}
/**
* Generated from protobuf field .google.type.DateTime created_at = 4 [json_name = "createdAt"];
* @param \Google\Type\DateTime $var
* @return $this
*/
public function setCreatedAt($var)
{
GPBUtil::checkMessage($var, \Google\Type\DateTime::class);
$this->created_at = $var;
return $this;
}
}