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

namespace Google\Cloud\CloudDms\V1;

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

/**
 * SSL configuration information.
 *
 * Generated from protobuf message <code>google.cloud.clouddms.v1.SslConfig</code>
 */
class SslConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The ssl config type according to 'client_key', 'client_certificate' and
     * 'ca_certificate'.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.SslConfig.SslType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $type = 0;
    /**
     * Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with
     * the Client Certificate. If this field is used then the 'client_certificate'
     * field is mandatory.
     *
     * Generated from protobuf field <code>string client_key = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $client_key = '';
    /**
     * Input only. The x509 PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server.If this field is used then
     * the 'client_key' field is mandatory.
     *
     * Generated from protobuf field <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     */
    private $client_certificate = '';
    /**
     * Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database
     * server's certificate. The replica will use this certificate to verify
     * it's connecting to the right host.
     *
     * Generated from protobuf field <code>string ca_certificate = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = REQUIRED];</code>
     */
    private $ca_certificate = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Output only. The ssl config type according to 'client_key', 'client_certificate' and
     *           'ca_certificate'.
     *     @type string $client_key
     *           Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with
     *           the Client Certificate. If this field is used then the 'client_certificate'
     *           field is mandatory.
     *     @type string $client_certificate
     *           Input only. The x509 PEM-encoded certificate that will be used by the replica to
     *           authenticate against the source database server.If this field is used then
     *           the 'client_key' field is mandatory.
     *     @type string $ca_certificate
     *           Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database
     *           server's certificate. The replica will use this certificate to verify
     *           it's connecting to the right host.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Clouddms\V1\ClouddmsResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The ssl config type according to 'client_key', 'client_certificate' and
     * 'ca_certificate'.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.SslConfig.SslType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Output only. The ssl config type according to 'client_key', 'client_certificate' and
     * 'ca_certificate'.
     *
     * Generated from protobuf field <code>.google.cloud.clouddms.v1.SslConfig.SslType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\CloudDms\V1\SslConfig\SslType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with
     * the Client Certificate. If this field is used then the 'client_certificate'
     * field is mandatory.
     *
     * Generated from protobuf field <code>string client_key = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return string
     */
    public function getClientKey()
    {
        return $this->client_key;
    }

    /**
     * Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with
     * the Client Certificate. If this field is used then the 'client_certificate'
     * field is mandatory.
     *
     * Generated from protobuf field <code>string client_key = 2 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setClientKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->client_key = $var;

        return $this;
    }

    /**
     * Input only. The x509 PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server.If this field is used then
     * the 'client_key' field is mandatory.
     *
     * Generated from protobuf field <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @return string
     */
    public function getClientCertificate()
    {
        return $this->client_certificate;
    }

    /**
     * Input only. The x509 PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server.If this field is used then
     * the 'client_key' field is mandatory.
     *
     * Generated from protobuf field <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setClientCertificate($var)
    {
        GPBUtil::checkString($var, True);
        $this->client_certificate = $var;

        return $this;
    }

    /**
     * Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database
     * server's certificate. The replica will use this certificate to verify
     * it's connecting to the right host.
     *
     * Generated from protobuf field <code>string ca_certificate = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getCaCertificate()
    {
        return $this->ca_certificate;
    }

    /**
     * Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database
     * server's certificate. The replica will use this certificate to verify
     * it's connecting to the right host.
     *
     * Generated from protobuf field <code>string ca_certificate = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setCaCertificate($var)
    {
        GPBUtil::checkString($var, True);
        $this->ca_certificate = $var;

        return $this;
    }

}

