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

namespace Google\Cloud\Batch\V1;

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

/**
 * LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
 * preserved.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.LogsPolicy</code>
 */
class LogsPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Where logs should be saved.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.Destination destination = 1;</code>
     */
    protected $destination = 0;
    /**
     * The path to which logs are saved when the destination = PATH. This can be a
     * local file path on the VM, or under the mount point of a Persistent Disk or
     * Filestore, or a Cloud Storage path.
     *
     * Generated from protobuf field <code>string logs_path = 2;</code>
     */
    protected $logs_path = '';
    /**
     * Optional. Additional settings for Cloud Logging. It will only take effect
     * when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $cloud_logging_option = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $destination
     *           Where logs should be saved.
     *     @type string $logs_path
     *           The path to which logs are saved when the destination = PATH. This can be a
     *           local file path on the VM, or under the mount point of a Persistent Disk or
     *           Filestore, or a Cloud Storage path.
     *     @type \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption $cloud_logging_option
     *           Optional. Additional settings for Cloud Logging. It will only take effect
     *           when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * Where logs should be saved.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.Destination destination = 1;</code>
     * @return int
     */
    public function getDestination()
    {
        return $this->destination;
    }

    /**
     * Where logs should be saved.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.Destination destination = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setDestination($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Batch\V1\LogsPolicy\Destination::class);
        $this->destination = $var;

        return $this;
    }

    /**
     * The path to which logs are saved when the destination = PATH. This can be a
     * local file path on the VM, or under the mount point of a Persistent Disk or
     * Filestore, or a Cloud Storage path.
     *
     * Generated from protobuf field <code>string logs_path = 2;</code>
     * @return string
     */
    public function getLogsPath()
    {
        return $this->logs_path;
    }

    /**
     * The path to which logs are saved when the destination = PATH. This can be a
     * local file path on the VM, or under the mount point of a Persistent Disk or
     * Filestore, or a Cloud Storage path.
     *
     * Generated from protobuf field <code>string logs_path = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLogsPath($var)
    {
        GPBUtil::checkString($var, True);
        $this->logs_path = $var;

        return $this;
    }

    /**
     * Optional. Additional settings for Cloud Logging. It will only take effect
     * when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption|null
     */
    public function getCloudLoggingOption()
    {
        return $this->cloud_logging_option;
    }

    public function hasCloudLoggingOption()
    {
        return isset($this->cloud_logging_option);
    }

    public function clearCloudLoggingOption()
    {
        unset($this->cloud_logging_option);
    }

    /**
     * Optional. Additional settings for Cloud Logging. It will only take effect
     * when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption cloud_logging_option = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption $var
     * @return $this
     */
    public function setCloudLoggingOption($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\LogsPolicy\CloudLoggingOption::class);
        $this->cloud_logging_option = $var;

        return $this;
    }

}

