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

namespace Google\Cloud\StorageTransfer\V1;

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

/**
 * An AwsS3CompatibleData resource.
 *
 * Generated from protobuf message <code>google.storagetransfer.v1.AwsS3CompatibleData</code>
 */
class AwsS3CompatibleData extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Specifies the name of the bucket.
     *
     * Generated from protobuf field <code>string bucket_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $bucket_name = '';
    /**
     * Specifies the root path to transfer objects.
     * Must be an empty string or full path name that ends with a '/'. This
     * field is treated as an object prefix. As such, it should generally not
     * begin with a '/'.
     *
     * Generated from protobuf field <code>string path = 2;</code>
     */
    private $path = '';
    /**
     * Required. Specifies the endpoint of the storage service.
     *
     * Generated from protobuf field <code>string endpoint = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $endpoint = '';
    /**
     * Specifies the region to sign requests with. This can be left blank if
     * requests should be signed with an empty region.
     *
     * Generated from protobuf field <code>string region = 5;</code>
     */
    private $region = '';
    protected $data_provider;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $bucket_name
     *           Required. Specifies the name of the bucket.
     *     @type string $path
     *           Specifies the root path to transfer objects.
     *           Must be an empty string or full path name that ends with a '/'. This
     *           field is treated as an object prefix. As such, it should generally not
     *           begin with a '/'.
     *     @type string $endpoint
     *           Required. Specifies the endpoint of the storage service.
     *     @type string $region
     *           Specifies the region to sign requests with. This can be left blank if
     *           requests should be signed with an empty region.
     *     @type \Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata $s3_metadata
     *           A S3 compatible metadata.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Storagetransfer\V1\TransferTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Specifies the name of the bucket.
     *
     * Generated from protobuf field <code>string bucket_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getBucketName()
    {
        return $this->bucket_name;
    }

    /**
     * Required. Specifies the name of the bucket.
     *
     * Generated from protobuf field <code>string bucket_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setBucketName($var)
    {
        GPBUtil::checkString($var, True);
        $this->bucket_name = $var;

        return $this;
    }

    /**
     * Specifies the root path to transfer objects.
     * Must be an empty string or full path name that ends with a '/'. This
     * field is treated as an object prefix. As such, it should generally not
     * begin with a '/'.
     *
     * Generated from protobuf field <code>string path = 2;</code>
     * @return string
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * Specifies the root path to transfer objects.
     * Must be an empty string or full path name that ends with a '/'. This
     * field is treated as an object prefix. As such, it should generally not
     * begin with a '/'.
     *
     * Generated from protobuf field <code>string path = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPath($var)
    {
        GPBUtil::checkString($var, True);
        $this->path = $var;

        return $this;
    }

    /**
     * Required. Specifies the endpoint of the storage service.
     *
     * Generated from protobuf field <code>string endpoint = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getEndpoint()
    {
        return $this->endpoint;
    }

    /**
     * Required. Specifies the endpoint of the storage service.
     *
     * Generated from protobuf field <code>string endpoint = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setEndpoint($var)
    {
        GPBUtil::checkString($var, True);
        $this->endpoint = $var;

        return $this;
    }

    /**
     * Specifies the region to sign requests with. This can be left blank if
     * requests should be signed with an empty region.
     *
     * Generated from protobuf field <code>string region = 5;</code>
     * @return string
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * Specifies the region to sign requests with. This can be left blank if
     * requests should be signed with an empty region.
     *
     * Generated from protobuf field <code>string region = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setRegion($var)
    {
        GPBUtil::checkString($var, True);
        $this->region = $var;

        return $this;
    }

    /**
     * A S3 compatible metadata.
     *
     * Generated from protobuf field <code>.google.storagetransfer.v1.S3CompatibleMetadata s3_metadata = 4;</code>
     * @return \Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata|null
     */
    public function getS3Metadata()
    {
        return $this->readOneof(4);
    }

    public function hasS3Metadata()
    {
        return $this->hasOneof(4);
    }

    /**
     * A S3 compatible metadata.
     *
     * Generated from protobuf field <code>.google.storagetransfer.v1.S3CompatibleMetadata s3_metadata = 4;</code>
     * @param \Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata $var
     * @return $this
     */
    public function setS3Metadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

