<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/fleetengine/delivery/v1/delivery_api.proto

namespace Google\Maps\FleetEngine\Delivery\V1;

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

/**
 * The `UpdateTask` request message.
 *
 * Generated from protobuf message <code>maps.fleetengine.delivery.v1.UpdateTaskRequest</code>
 */
class UpdateTaskRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The standard Delivery API request header.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $header = null;
    /**
     * Required. The Task associated with the update.
     * The following fields are maintained by Fleet Engine. Do not update
     * them using `Task.update`.
     *   * `last_location`.
     *   * `last_location_snappable`.
     *   * `name`.
     *   * `remaining_vehicle_journey_segments`.
     *   * `task_outcome_location_source`.
     * Note: You cannot change the value of `task_outcome` once you set it.
     * If the Task has been assigned to a delivery vehicle, then don't set the
     * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
     * that contains the Task from the delivery vehicle, which automatically sets
     * the Task state to CLOSED.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $task = null;
    /**
     * Required. The field mask that indicates which Task fields to update.
     * Note: The `update_mask` must contain at least one field.
     * This is a comma-separated list of fully qualified names of fields. Example:
     * `"task_outcome,task_outcome_time,task_outcome_location"`.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Maps\FleetEngine\Delivery\V1\Task $task       Required. The Task associated with the update.
     *                                                              The following fields are maintained by Fleet Engine. Do not update
     *                                                              them using `Task.update`.
     *
     *                                                              * `last_location`.
     *                                                              * `last_location_snappable`.
     *                                                              * `name`.
     *                                                              * `remaining_vehicle_journey_segments`.
     *                                                              * `task_outcome_location_source`.
     *
     *                                                              Note: You cannot change the value of `task_outcome` once you set it.
     *
     *                                                              If the Task has been assigned to a delivery vehicle, then don't set the
     *                                                              Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
     *                                                              that contains the Task from the delivery vehicle, which automatically sets
     *                                                              the Task state to CLOSED.
     * @param \Google\Protobuf\FieldMask                $updateMask Required. The field mask that indicates which Task fields to update.
     *                                                              Note: The `update_mask` must contain at least one field.
     *
     *                                                              This is a comma-separated list of fully qualified names of fields. Example:
     *                                                              `"task_outcome,task_outcome_time,task_outcome_location"`.
     *
     * @return \Google\Maps\FleetEngine\Delivery\V1\UpdateTaskRequest
     *
     * @experimental
     */
    public static function build(\Google\Maps\FleetEngine\Delivery\V1\Task $task, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setTask($task)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $header
     *           Optional. The standard Delivery API request header.
     *     @type \Google\Maps\FleetEngine\Delivery\V1\Task $task
     *           Required. The Task associated with the update.
     *           The following fields are maintained by Fleet Engine. Do not update
     *           them using `Task.update`.
     *             * `last_location`.
     *             * `last_location_snappable`.
     *             * `name`.
     *             * `remaining_vehicle_journey_segments`.
     *             * `task_outcome_location_source`.
     *           Note: You cannot change the value of `task_outcome` once you set it.
     *           If the Task has been assigned to a delivery vehicle, then don't set the
     *           Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
     *           that contains the Task from the delivery vehicle, which automatically sets
     *           the Task state to CLOSED.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. The field mask that indicates which Task fields to update.
     *           Note: The `update_mask` must contain at least one field.
     *           This is a comma-separated list of fully qualified names of fields. Example:
     *           `"task_outcome,task_outcome_time,task_outcome_location"`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Maps\Fleetengine\Delivery\V1\DeliveryApi::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The standard Delivery API request header.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader|null
     */
    public function getHeader()
    {
        return $this->header;
    }

    public function hasHeader()
    {
        return isset($this->header);
    }

    public function clearHeader()
    {
        unset($this->header);
    }

    /**
     * Optional. The standard Delivery API request header.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.DeliveryRequestHeader header = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader $var
     * @return $this
     */
    public function setHeader($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\DeliveryRequestHeader::class);
        $this->header = $var;

        return $this;
    }

    /**
     * Required. The Task associated with the update.
     * The following fields are maintained by Fleet Engine. Do not update
     * them using `Task.update`.
     *   * `last_location`.
     *   * `last_location_snappable`.
     *   * `name`.
     *   * `remaining_vehicle_journey_segments`.
     *   * `task_outcome_location_source`.
     * Note: You cannot change the value of `task_outcome` once you set it.
     * If the Task has been assigned to a delivery vehicle, then don't set the
     * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
     * that contains the Task from the delivery vehicle, which automatically sets
     * the Task state to CLOSED.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Maps\FleetEngine\Delivery\V1\Task|null
     */
    public function getTask()
    {
        return $this->task;
    }

    public function hasTask()
    {
        return isset($this->task);
    }

    public function clearTask()
    {
        unset($this->task);
    }

    /**
     * Required. The Task associated with the update.
     * The following fields are maintained by Fleet Engine. Do not update
     * them using `Task.update`.
     *   * `last_location`.
     *   * `last_location_snappable`.
     *   * `name`.
     *   * `remaining_vehicle_journey_segments`.
     *   * `task_outcome_location_source`.
     * Note: You cannot change the value of `task_outcome` once you set it.
     * If the Task has been assigned to a delivery vehicle, then don't set the
     * Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
     * that contains the Task from the delivery vehicle, which automatically sets
     * the Task state to CLOSED.
     *
     * Generated from protobuf field <code>.maps.fleetengine.delivery.v1.Task task = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Maps\FleetEngine\Delivery\V1\Task $var
     * @return $this
     */
    public function setTask($var)
    {
        GPBUtil::checkMessage($var, \Google\Maps\FleetEngine\Delivery\V1\Task::class);
        $this->task = $var;

        return $this;
    }

    /**
     * Required. The field mask that indicates which Task fields to update.
     * Note: The `update_mask` must contain at least one field.
     * This is a comma-separated list of fully qualified names of fields. Example:
     * `"task_outcome,task_outcome_time,task_outcome_location"`.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. The field mask that indicates which Task fields to update.
     * Note: The `update_mask` must contain at least one field.
     * This is a comma-separated list of fully qualified names of fields. Example:
     * `"task_outcome,task_outcome_time,task_outcome_location"`.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

