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

namespace Google\Cloud\Iap\V1;

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

/**
 * Configuration for OAuth login&consent flow behavior as well as for OAuth
 * Credentials.
 *
 * Generated from protobuf message <code>google.cloud.iap.v1.OAuthSettings</code>
 */
class OAuthSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Domain hint to send as hd=? parameter in OAuth request flow. Enables
     * redirect to primary IDP by skipping Google's login screen.
     * https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     * Note: IAP does not verify that the id token's hd claim matches this value
     * since access behavior is managed by IAM policies.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login_hint = 2;</code>
     */
    protected $login_hint = null;
    /**
     * Optional. OAuth 2.0 client ID used in the OAuth flow.
     * This allows for client sharing. The risks of client sharing
     * are outlined here:
     * https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $client_id = null;
    /**
     * Optional. Input only. OAuth secret paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $client_secret = null;
    /**
     * Output only. OAuth secret SHA256 paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret_sha256 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $client_secret_sha256 = null;
    /**
     * Optional. List of client ids allowed to use IAP programmatically.
     *
     * Generated from protobuf field <code>repeated string programmatic_clients = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $programmatic_clients;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\StringValue $login_hint
     *           Domain hint to send as hd=? parameter in OAuth request flow. Enables
     *           redirect to primary IDP by skipping Google's login screen.
     *           https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     *           Note: IAP does not verify that the id token's hd claim matches this value
     *           since access behavior is managed by IAM policies.
     *     @type \Google\Protobuf\StringValue $client_id
     *           Optional. OAuth 2.0 client ID used in the OAuth flow.
     *           This allows for client sharing. The risks of client sharing
     *           are outlined here:
     *           https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *     @type \Google\Protobuf\StringValue $client_secret
     *           Optional. Input only. OAuth secret paired with client ID.
     *     @type \Google\Protobuf\StringValue $client_secret_sha256
     *           Output only. OAuth secret SHA256 paired with client ID.
     *     @type string[] $programmatic_clients
     *           Optional. List of client ids allowed to use IAP programmatically.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iap\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Domain hint to send as hd=? parameter in OAuth request flow. Enables
     * redirect to primary IDP by skipping Google's login screen.
     * https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     * Note: IAP does not verify that the id token's hd claim matches this value
     * since access behavior is managed by IAM policies.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login_hint = 2;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getLoginHint()
    {
        return $this->login_hint;
    }

    public function hasLoginHint()
    {
        return isset($this->login_hint);
    }

    public function clearLoginHint()
    {
        unset($this->login_hint);
    }

    /**
     * Returns the unboxed value from <code>getLoginHint()</code>

     * Domain hint to send as hd=? parameter in OAuth request flow. Enables
     * redirect to primary IDP by skipping Google's login screen.
     * https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     * Note: IAP does not verify that the id token's hd claim matches this value
     * since access behavior is managed by IAM policies.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login_hint = 2;</code>
     * @return string|null
     */
    public function getLoginHintUnwrapped()
    {
        return $this->readWrapperValue("login_hint");
    }

    /**
     * Domain hint to send as hd=? parameter in OAuth request flow. Enables
     * redirect to primary IDP by skipping Google's login screen.
     * https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     * Note: IAP does not verify that the id token's hd claim matches this value
     * since access behavior is managed by IAM policies.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login_hint = 2;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setLoginHint($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->login_hint = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Domain hint to send as hd=? parameter in OAuth request flow. Enables
     * redirect to primary IDP by skipping Google's login screen.
     * https://developers.google.com/identity/protocols/OpenIDConnect#hd-param
     * Note: IAP does not verify that the id token's hd claim matches this value
     * since access behavior is managed by IAM policies.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue login_hint = 2;</code>
     * @param string|null $var
     * @return $this
     */
    public function setLoginHintUnwrapped($var)
    {
        $this->writeWrapperValue("login_hint", $var);
        return $this;}

    /**
     * Optional. OAuth 2.0 client ID used in the OAuth flow.
     * This allows for client sharing. The risks of client sharing
     * are outlined here:
     * https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getClientId()
    {
        return $this->client_id;
    }

    public function hasClientId()
    {
        return isset($this->client_id);
    }

    public function clearClientId()
    {
        unset($this->client_id);
    }

    /**
     * Returns the unboxed value from <code>getClientId()</code>

     * Optional. OAuth 2.0 client ID used in the OAuth flow.
     * This allows for client sharing. The risks of client sharing
     * are outlined here:
     * https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string|null
     */
    public function getClientIdUnwrapped()
    {
        return $this->readWrapperValue("client_id");
    }

    /**
     * Optional. OAuth 2.0 client ID used in the OAuth flow.
     * This allows for client sharing. The risks of client sharing
     * are outlined here:
     * https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setClientId($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->client_id = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Optional. OAuth 2.0 client ID used in the OAuth flow.
     * This allows for client sharing. The risks of client sharing
     * are outlined here:
     * https://cloud.google.com/iap/docs/sharing-oauth-clients#risks.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string|null $var
     * @return $this
     */
    public function setClientIdUnwrapped($var)
    {
        $this->writeWrapperValue("client_id", $var);
        return $this;}

    /**
     * Optional. Input only. OAuth secret paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getClientSecret()
    {
        return $this->client_secret;
    }

    public function hasClientSecret()
    {
        return isset($this->client_secret);
    }

    public function clearClientSecret()
    {
        unset($this->client_secret);
    }

    /**
     * Returns the unboxed value from <code>getClientSecret()</code>

     * Optional. Input only. OAuth secret paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return string|null
     */
    public function getClientSecretUnwrapped()
    {
        return $this->readWrapperValue("client_secret");
    }

    /**
     * Optional. Input only. OAuth secret paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setClientSecret($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->client_secret = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Optional. Input only. OAuth secret paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param string|null $var
     * @return $this
     */
    public function setClientSecretUnwrapped($var)
    {
        $this->writeWrapperValue("client_secret", $var);
        return $this;}

    /**
     * Output only. OAuth secret SHA256 paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret_sha256 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getClientSecretSha256()
    {
        return $this->client_secret_sha256;
    }

    public function hasClientSecretSha256()
    {
        return isset($this->client_secret_sha256);
    }

    public function clearClientSecretSha256()
    {
        unset($this->client_secret_sha256);
    }

    /**
     * Returns the unboxed value from <code>getClientSecretSha256()</code>

     * Output only. OAuth secret SHA256 paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret_sha256 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string|null
     */
    public function getClientSecretSha256Unwrapped()
    {
        return $this->readWrapperValue("client_secret_sha256");
    }

    /**
     * Output only. OAuth secret SHA256 paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret_sha256 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setClientSecretSha256($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->client_secret_sha256 = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Output only. OAuth secret SHA256 paired with client ID.
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue client_secret_sha256 = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string|null $var
     * @return $this
     */
    public function setClientSecretSha256Unwrapped($var)
    {
        $this->writeWrapperValue("client_secret_sha256", $var);
        return $this;}

    /**
     * Optional. List of client ids allowed to use IAP programmatically.
     *
     * Generated from protobuf field <code>repeated string programmatic_clients = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getProgrammaticClients()
    {
        return $this->programmatic_clients;
    }

    /**
     * Optional. List of client ids allowed to use IAP programmatically.
     *
     * Generated from protobuf field <code>repeated string programmatic_clients = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setProgrammaticClients($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->programmatic_clients = $arr;

        return $this;
    }

}

