<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/grafeas.proto

namespace Grafeas\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Request to create a new occurrence.
 *
 * Generated from protobuf message <code>grafeas.v1.CreateOccurrenceRequest</code>
 */
class CreateOccurrenceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
     * the occurrence is to be created.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * The occurrence to create.
     *
     * Generated from protobuf field <code>.grafeas.v1.Occurrence occurrence = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $occurrence = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           The name of the project in the form of `projects/[PROJECT_ID]`, under which
     *           the occurrence is to be created.
     *     @type \Grafeas\V1\Occurrence $occurrence
     *           The occurrence to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Grafeas::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
     * the occurrence is to be created.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
     * the occurrence is to be created.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * The occurrence to create.
     *
     * Generated from protobuf field <code>.grafeas.v1.Occurrence occurrence = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Grafeas\V1\Occurrence|null
     */
    public function getOccurrence()
    {
        return $this->occurrence;
    }

    public function hasOccurrence()
    {
        return isset($this->occurrence);
    }

    public function clearOccurrence()
    {
        unset($this->occurrence);
    }

    /**
     * The occurrence to create.
     *
     * Generated from protobuf field <code>.grafeas.v1.Occurrence occurrence = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Grafeas\V1\Occurrence $var
     * @return $this
     */
    public function setOccurrence($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\Occurrence::class);
        $this->occurrence = $var;

        return $this;
    }

}

