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

namespace Google\Cloud\Dataform\V1beta1\Repository;

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

/**
 * Controls Git remote configuration for a repository.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1beta1.Repository.GitRemoteSettings</code>
 */
class GitRemoteSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The Git remote's URL.
     *
     * Generated from protobuf field <code>string url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $url = '';
    /**
     * Required. The Git remote's default branch name.
     *
     * Generated from protobuf field <code>string default_branch = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $default_branch = '';
    /**
     * Optional. The name of the Secret Manager secret version to use as an
     * authentication token for Git operations. Must be in the format
     * `projects/{@*}secrets/{@*}versions/*`.
     *
     * Generated from protobuf field <code>string authentication_token_secret_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $authentication_token_secret_version = '';
    /**
     * Optional. Authentication fields for remote uris using SSH protocol.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.SshAuthenticationConfig ssh_authentication_config = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $ssh_authentication_config = null;
    /**
     * Output only. Deprecated: The field does not contain any token status
     * information. Instead use
     * https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.TokenStatus token_status = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @deprecated
     */
    protected $token_status = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $url
     *           Required. The Git remote's URL.
     *     @type string $default_branch
     *           Required. The Git remote's default branch name.
     *     @type string $authentication_token_secret_version
     *           Optional. The name of the Secret Manager secret version to use as an
     *           authentication token for Git operations. Must be in the format
     *           `projects/{@*}secrets/{@*}versions/*`.
     *     @type \Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings\SshAuthenticationConfig $ssh_authentication_config
     *           Optional. Authentication fields for remote uris using SSH protocol.
     *     @type int $token_status
     *           Output only. Deprecated: The field does not contain any token status
     *           information. Instead use
     *           https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1Beta1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The Git remote's URL.
     *
     * Generated from protobuf field <code>string url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * Required. The Git remote's URL.
     *
     * Generated from protobuf field <code>string url = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->url = $var;

        return $this;
    }

    /**
     * Required. The Git remote's default branch name.
     *
     * Generated from protobuf field <code>string default_branch = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDefaultBranch()
    {
        return $this->default_branch;
    }

    /**
     * Required. The Git remote's default branch name.
     *
     * Generated from protobuf field <code>string default_branch = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultBranch($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_branch = $var;

        return $this;
    }

    /**
     * Optional. The name of the Secret Manager secret version to use as an
     * authentication token for Git operations. Must be in the format
     * `projects/{@*}secrets/{@*}versions/*`.
     *
     * Generated from protobuf field <code>string authentication_token_secret_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getAuthenticationTokenSecretVersion()
    {
        return $this->authentication_token_secret_version;
    }

    /**
     * Optional. The name of the Secret Manager secret version to use as an
     * authentication token for Git operations. Must be in the format
     * `projects/{@*}secrets/{@*}versions/*`.
     *
     * Generated from protobuf field <code>string authentication_token_secret_version = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setAuthenticationTokenSecretVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->authentication_token_secret_version = $var;

        return $this;
    }

    /**
     * Optional. Authentication fields for remote uris using SSH protocol.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.SshAuthenticationConfig ssh_authentication_config = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings\SshAuthenticationConfig|null
     */
    public function getSshAuthenticationConfig()
    {
        return $this->ssh_authentication_config;
    }

    public function hasSshAuthenticationConfig()
    {
        return isset($this->ssh_authentication_config);
    }

    public function clearSshAuthenticationConfig()
    {
        unset($this->ssh_authentication_config);
    }

    /**
     * Optional. Authentication fields for remote uris using SSH protocol.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.SshAuthenticationConfig ssh_authentication_config = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings\SshAuthenticationConfig $var
     * @return $this
     */
    public function setSshAuthenticationConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings\SshAuthenticationConfig::class);
        $this->ssh_authentication_config = $var;

        return $this;
    }

    /**
     * Output only. Deprecated: The field does not contain any token status
     * information. Instead use
     * https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.TokenStatus token_status = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     * @deprecated
     */
    public function getTokenStatus()
    {
        if ($this->token_status !== 0) {
            @trigger_error('token_status is deprecated.', E_USER_DEPRECATED);
        }
        return $this->token_status;
    }

    /**
     * Output only. Deprecated: The field does not contain any token status
     * information. Instead use
     * https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1beta1.Repository.GitRemoteSettings.TokenStatus token_status = 4 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setTokenStatus($var)
    {
        @trigger_error('token_status is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkEnum($var, \Google\Cloud\Dataform\V1beta1\Repository\GitRemoteSettings\TokenStatus::class);
        $this->token_status = $var;

        return $this;
    }

}

