<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/schedule/v1/message.proto

namespace Temporal\Api\Schedule\V1;

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

/**
 * Generated from protobuf message <code>temporal.api.schedule.v1.ScheduleAction</code>
 */
class ScheduleAction extends \Google\Protobuf\Internal\Message
{
    protected $action;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Workflow\V1\NewWorkflowExecutionInfo $start_workflow
     *           All fields of NewWorkflowExecutionInfo are valid except for:
     *           - workflow_id_reuse_policy
     *           - cron_schedule
     *           The workflow id of the started workflow may not match this exactly,
     *           it may have a timestamp appended for uniqueness.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Schedule\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * All fields of NewWorkflowExecutionInfo are valid except for:
     * - workflow_id_reuse_policy
     * - cron_schedule
     * The workflow id of the started workflow may not match this exactly,
     * it may have a timestamp appended for uniqueness.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.NewWorkflowExecutionInfo start_workflow = 1;</code>
     * @return \Temporal\Api\Workflow\V1\NewWorkflowExecutionInfo|null
     */
    public function getStartWorkflow()
    {
        return $this->readOneof(1);
    }

    public function hasStartWorkflow()
    {
        return $this->hasOneof(1);
    }

    /**
     * All fields of NewWorkflowExecutionInfo are valid except for:
     * - workflow_id_reuse_policy
     * - cron_schedule
     * The workflow id of the started workflow may not match this exactly,
     * it may have a timestamp appended for uniqueness.
     *
     * Generated from protobuf field <code>.temporal.api.workflow.v1.NewWorkflowExecutionInfo start_workflow = 1;</code>
     * @param \Temporal\Api\Workflow\V1\NewWorkflowExecutionInfo $var
     * @return $this
     */
    public function setStartWorkflow($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflow\V1\NewWorkflowExecutionInfo::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getAction()
    {
        return $this->whichOneof("action");
    }

}

