<?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;

/**
 * ProviderOAuthConfig is the OAuth config for a provider.
 *
 * Generated from protobuf message <code>google.cloud.developerconnect.v1.ProviderOAuthConfig</code>
 */
class ProviderOAuthConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. User selected scopes to apply to the Oauth config
     * In the event of changing scopes, user records under AccountConnector will
     * be deleted and users will re-auth again.
     *
     * Generated from protobuf field <code>repeated string scopes = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $scopes;
    protected $oauth_provider_id;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $system_provider_id
     *           Optional. Immutable. Developer Connect provided OAuth.
     *     @type string[] $scopes
     *           Required. User selected scopes to apply to the Oauth config
     *           In the event of changing scopes, user records under AccountConnector will
     *           be deleted and users will re-auth again.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Immutable. Developer Connect provided OAuth.
     *
     * Generated from protobuf field <code>.google.cloud.developerconnect.v1.SystemProvider system_provider_id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getSystemProviderId()
    {
        return $this->readOneof(1);
    }

    public function hasSystemProviderId()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. Immutable. Developer Connect provided OAuth.
     *
     * Generated from protobuf field <code>.google.cloud.developerconnect.v1.SystemProvider system_provider_id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setSystemProviderId($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\SystemProvider::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Required. User selected scopes to apply to the Oauth config
     * In the event of changing scopes, user records under AccountConnector will
     * be deleted and users will re-auth again.
     *
     * Generated from protobuf field <code>repeated string scopes = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<string>
     */
    public function getScopes()
    {
        return $this->scopes;
    }

    /**
     * Required. User selected scopes to apply to the Oauth config
     * In the event of changing scopes, user records under AccountConnector will
     * be deleted and users will re-auth again.
     *
     * Generated from protobuf field <code>repeated string scopes = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string[] $var
     * @return $this
     */
    public function setScopes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->scopes = $arr;

        return $this;
    }

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

}

