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

namespace Google\Cloud\DeveloperConnect\V1;

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

/**
 * Message for responding to finishing an OAuth flow.
 *
 * Generated from protobuf message <code>google.cloud.developerconnect.v1.FinishOAuthResponse</code>
 */
class FinishOAuthResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The error resulted from exchanging OAuth tokens from the service provider.
     *
     * Generated from protobuf field <code>.google.cloud.developerconnect.v1.ExchangeError exchange_error = 1;</code>
     */
    protected $exchange_error = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DeveloperConnect\V1\ExchangeError $exchange_error
     *           The error resulted from exchanging OAuth tokens from the service provider.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce();
        parent::__construct($data);
    }

    /**
     * The error resulted from exchanging OAuth tokens from the service provider.
     *
     * Generated from protobuf field <code>.google.cloud.developerconnect.v1.ExchangeError exchange_error = 1;</code>
     * @return \Google\Cloud\DeveloperConnect\V1\ExchangeError|null
     */
    public function getExchangeError()
    {
        return $this->exchange_error;
    }

    public function hasExchangeError()
    {
        return isset($this->exchange_error);
    }

    public function clearExchangeError()
    {
        unset($this->exchange_error);
    }

    /**
     * The error resulted from exchanging OAuth tokens from the service provider.
     *
     * Generated from protobuf field <code>.google.cloud.developerconnect.v1.ExchangeError exchange_error = 1;</code>
     * @param \Google\Cloud\DeveloperConnect\V1\ExchangeError $var
     * @return $this
     */
    public function setExchangeError($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\ExchangeError::class);
        $this->exchange_error = $var;

        return $this;
    }

}

