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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * An Application resource contains the top-level configuration of an App
 * Engine application.
 *
 * Generated from protobuf message <code>google.appengine.v1.Application</code>
 */
class Application extends \Google\Protobuf\Internal\Message
{
    /**
     * Full path to the Application resource in the API.
     * Example: `apps/myapp`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * Identifier of the Application resource. This identifier is equivalent
     * to the project ID of the Google Cloud Platform project where you want to
     * deploy your application.
     * Example: `myapp`.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     */
    protected $id = '';
    /**
     * HTTP path dispatch rules for requests to the application that do not
     * explicitly target a service or version. Rules are order-dependent.
     * Up to 20 dispatch rules can be supported.
     *
     * Generated from protobuf field <code>repeated .google.appengine.v1.UrlDispatchRule dispatch_rules = 3;</code>
     */
    private $dispatch_rules;
    /**
     * Google Apps authentication domain that controls which users can access
     * this application.
     * Defaults to open access for any Google Account.
     *
     * Generated from protobuf field <code>string auth_domain = 6;</code>
     */
    protected $auth_domain = '';
    /**
     * Location from which this application runs. Application instances
     * run out of the data centers in the specified location, which is also where
     * all of the application's end user content is stored.
     * Defaults to `us-central`.
     * View the list of
     * [supported locations](https://cloud.google.com/appengine/docs/locations).
     *
     * Generated from protobuf field <code>string location_id = 7;</code>
     */
    protected $location_id = '';
    /**
     * Google Cloud Storage bucket that can be used for storing files
     * associated with this application. This bucket is associated with the
     * application and can be used by the gcloud deployment commands.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string code_bucket = 8;</code>
     */
    protected $code_bucket = '';
    /**
     * Cookie expiration policy for this application.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration default_cookie_expiration = 9;</code>
     */
    protected $default_cookie_expiration = null;
    /**
     * Serving status of this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.ServingStatus serving_status = 10;</code>
     */
    protected $serving_status = 0;
    /**
     * Hostname used to reach this application, as resolved by App Engine.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_hostname = 11;</code>
     */
    protected $default_hostname = '';
    /**
     * Google Cloud Storage bucket that can be used by this application to store
     * content.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_bucket = 12;</code>
     */
    protected $default_bucket = '';
    /**
     * The service account associated with the application.
     * This is the app-level default identity. If no identity provided during
     * create version, Admin API will fallback to this one.
     *
     * Generated from protobuf field <code>string service_account = 13;</code>
     */
    protected $service_account = '';
    /**
     * Generated from protobuf field <code>.google.appengine.v1.Application.IdentityAwareProxy iap = 14;</code>
     */
    protected $iap = null;
    /**
     * The Google Container Registry domain used for storing managed build docker
     * images for this application.
     *
     * Generated from protobuf field <code>string gcr_domain = 16;</code>
     */
    protected $gcr_domain = '';
    /**
     * The type of the Cloud Firestore or Cloud Datastore database associated with
     * this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.DatabaseType database_type = 17;</code>
     */
    protected $database_type = 0;
    /**
     * The feature specific settings to be used in the application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.FeatureSettings feature_settings = 18;</code>
     */
    protected $feature_settings = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Full path to the Application resource in the API.
     *           Example: `apps/myapp`.
     *           &#64;OutputOnly
     *     @type string $id
     *           Identifier of the Application resource. This identifier is equivalent
     *           to the project ID of the Google Cloud Platform project where you want to
     *           deploy your application.
     *           Example: `myapp`.
     *     @type array<\Google\Cloud\AppEngine\V1\UrlDispatchRule>|\Google\Protobuf\Internal\RepeatedField $dispatch_rules
     *           HTTP path dispatch rules for requests to the application that do not
     *           explicitly target a service or version. Rules are order-dependent.
     *           Up to 20 dispatch rules can be supported.
     *     @type string $auth_domain
     *           Google Apps authentication domain that controls which users can access
     *           this application.
     *           Defaults to open access for any Google Account.
     *     @type string $location_id
     *           Location from which this application runs. Application instances
     *           run out of the data centers in the specified location, which is also where
     *           all of the application's end user content is stored.
     *           Defaults to `us-central`.
     *           View the list of
     *           [supported locations](https://cloud.google.com/appengine/docs/locations).
     *     @type string $code_bucket
     *           Google Cloud Storage bucket that can be used for storing files
     *           associated with this application. This bucket is associated with the
     *           application and can be used by the gcloud deployment commands.
     *           &#64;OutputOnly
     *     @type \Google\Protobuf\Duration $default_cookie_expiration
     *           Cookie expiration policy for this application.
     *     @type int $serving_status
     *           Serving status of this application.
     *     @type string $default_hostname
     *           Hostname used to reach this application, as resolved by App Engine.
     *           &#64;OutputOnly
     *     @type string $default_bucket
     *           Google Cloud Storage bucket that can be used by this application to store
     *           content.
     *           &#64;OutputOnly
     *     @type string $service_account
     *           The service account associated with the application.
     *           This is the app-level default identity. If no identity provided during
     *           create version, Admin API will fallback to this one.
     *     @type \Google\Cloud\AppEngine\V1\Application\IdentityAwareProxy $iap
     *     @type string $gcr_domain
     *           The Google Container Registry domain used for storing managed build docker
     *           images for this application.
     *     @type int $database_type
     *           The type of the Cloud Firestore or Cloud Datastore database associated with
     *           this application.
     *     @type \Google\Cloud\AppEngine\V1\Application\FeatureSettings $feature_settings
     *           The feature specific settings to be used in the application.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Application::initOnce();
        parent::__construct($data);
    }

    /**
     * Full path to the Application resource in the API.
     * Example: `apps/myapp`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Full path to the Application resource in the API.
     * Example: `apps/myapp`.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Identifier of the Application resource. This identifier is equivalent
     * to the project ID of the Google Cloud Platform project where you want to
     * deploy your application.
     * Example: `myapp`.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Identifier of the Application resource. This identifier is equivalent
     * to the project ID of the Google Cloud Platform project where you want to
     * deploy your application.
     * Example: `myapp`.
     *
     * Generated from protobuf field <code>string id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * HTTP path dispatch rules for requests to the application that do not
     * explicitly target a service or version. Rules are order-dependent.
     * Up to 20 dispatch rules can be supported.
     *
     * Generated from protobuf field <code>repeated .google.appengine.v1.UrlDispatchRule dispatch_rules = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDispatchRules()
    {
        return $this->dispatch_rules;
    }

    /**
     * HTTP path dispatch rules for requests to the application that do not
     * explicitly target a service or version. Rules are order-dependent.
     * Up to 20 dispatch rules can be supported.
     *
     * Generated from protobuf field <code>repeated .google.appengine.v1.UrlDispatchRule dispatch_rules = 3;</code>
     * @param array<\Google\Cloud\AppEngine\V1\UrlDispatchRule>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDispatchRules($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AppEngine\V1\UrlDispatchRule::class);
        $this->dispatch_rules = $arr;

        return $this;
    }

    /**
     * Google Apps authentication domain that controls which users can access
     * this application.
     * Defaults to open access for any Google Account.
     *
     * Generated from protobuf field <code>string auth_domain = 6;</code>
     * @return string
     */
    public function getAuthDomain()
    {
        return $this->auth_domain;
    }

    /**
     * Google Apps authentication domain that controls which users can access
     * this application.
     * Defaults to open access for any Google Account.
     *
     * Generated from protobuf field <code>string auth_domain = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setAuthDomain($var)
    {
        GPBUtil::checkString($var, True);
        $this->auth_domain = $var;

        return $this;
    }

    /**
     * Location from which this application runs. Application instances
     * run out of the data centers in the specified location, which is also where
     * all of the application's end user content is stored.
     * Defaults to `us-central`.
     * View the list of
     * [supported locations](https://cloud.google.com/appengine/docs/locations).
     *
     * Generated from protobuf field <code>string location_id = 7;</code>
     * @return string
     */
    public function getLocationId()
    {
        return $this->location_id;
    }

    /**
     * Location from which this application runs. Application instances
     * run out of the data centers in the specified location, which is also where
     * all of the application's end user content is stored.
     * Defaults to `us-central`.
     * View the list of
     * [supported locations](https://cloud.google.com/appengine/docs/locations).
     *
     * Generated from protobuf field <code>string location_id = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setLocationId($var)
    {
        GPBUtil::checkString($var, True);
        $this->location_id = $var;

        return $this;
    }

    /**
     * Google Cloud Storage bucket that can be used for storing files
     * associated with this application. This bucket is associated with the
     * application and can be used by the gcloud deployment commands.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string code_bucket = 8;</code>
     * @return string
     */
    public function getCodeBucket()
    {
        return $this->code_bucket;
    }

    /**
     * Google Cloud Storage bucket that can be used for storing files
     * associated with this application. This bucket is associated with the
     * application and can be used by the gcloud deployment commands.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string code_bucket = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setCodeBucket($var)
    {
        GPBUtil::checkString($var, True);
        $this->code_bucket = $var;

        return $this;
    }

    /**
     * Cookie expiration policy for this application.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration default_cookie_expiration = 9;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDefaultCookieExpiration()
    {
        return $this->default_cookie_expiration;
    }

    public function hasDefaultCookieExpiration()
    {
        return isset($this->default_cookie_expiration);
    }

    public function clearDefaultCookieExpiration()
    {
        unset($this->default_cookie_expiration);
    }

    /**
     * Cookie expiration policy for this application.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration default_cookie_expiration = 9;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDefaultCookieExpiration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->default_cookie_expiration = $var;

        return $this;
    }

    /**
     * Serving status of this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.ServingStatus serving_status = 10;</code>
     * @return int
     */
    public function getServingStatus()
    {
        return $this->serving_status;
    }

    /**
     * Serving status of this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.ServingStatus serving_status = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setServingStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AppEngine\V1\Application\ServingStatus::class);
        $this->serving_status = $var;

        return $this;
    }

    /**
     * Hostname used to reach this application, as resolved by App Engine.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_hostname = 11;</code>
     * @return string
     */
    public function getDefaultHostname()
    {
        return $this->default_hostname;
    }

    /**
     * Hostname used to reach this application, as resolved by App Engine.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_hostname = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultHostname($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_hostname = $var;

        return $this;
    }

    /**
     * Google Cloud Storage bucket that can be used by this application to store
     * content.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_bucket = 12;</code>
     * @return string
     */
    public function getDefaultBucket()
    {
        return $this->default_bucket;
    }

    /**
     * Google Cloud Storage bucket that can be used by this application to store
     * content.
     * &#64;OutputOnly
     *
     * Generated from protobuf field <code>string default_bucket = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultBucket($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_bucket = $var;

        return $this;
    }

    /**
     * The service account associated with the application.
     * This is the app-level default identity. If no identity provided during
     * create version, Admin API will fallback to this one.
     *
     * Generated from protobuf field <code>string service_account = 13;</code>
     * @return string
     */
    public function getServiceAccount()
    {
        return $this->service_account;
    }

    /**
     * The service account associated with the application.
     * This is the app-level default identity. If no identity provided during
     * create version, Admin API will fallback to this one.
     *
     * Generated from protobuf field <code>string service_account = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setServiceAccount($var)
    {
        GPBUtil::checkString($var, True);
        $this->service_account = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.appengine.v1.Application.IdentityAwareProxy iap = 14;</code>
     * @return \Google\Cloud\AppEngine\V1\Application\IdentityAwareProxy|null
     */
    public function getIap()
    {
        return $this->iap;
    }

    public function hasIap()
    {
        return isset($this->iap);
    }

    public function clearIap()
    {
        unset($this->iap);
    }

    /**
     * Generated from protobuf field <code>.google.appengine.v1.Application.IdentityAwareProxy iap = 14;</code>
     * @param \Google\Cloud\AppEngine\V1\Application\IdentityAwareProxy $var
     * @return $this
     */
    public function setIap($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AppEngine\V1\Application\IdentityAwareProxy::class);
        $this->iap = $var;

        return $this;
    }

    /**
     * The Google Container Registry domain used for storing managed build docker
     * images for this application.
     *
     * Generated from protobuf field <code>string gcr_domain = 16;</code>
     * @return string
     */
    public function getGcrDomain()
    {
        return $this->gcr_domain;
    }

    /**
     * The Google Container Registry domain used for storing managed build docker
     * images for this application.
     *
     * Generated from protobuf field <code>string gcr_domain = 16;</code>
     * @param string $var
     * @return $this
     */
    public function setGcrDomain($var)
    {
        GPBUtil::checkString($var, True);
        $this->gcr_domain = $var;

        return $this;
    }

    /**
     * The type of the Cloud Firestore or Cloud Datastore database associated with
     * this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.DatabaseType database_type = 17;</code>
     * @return int
     */
    public function getDatabaseType()
    {
        return $this->database_type;
    }

    /**
     * The type of the Cloud Firestore or Cloud Datastore database associated with
     * this application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.DatabaseType database_type = 17;</code>
     * @param int $var
     * @return $this
     */
    public function setDatabaseType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AppEngine\V1\Application\DatabaseType::class);
        $this->database_type = $var;

        return $this;
    }

    /**
     * The feature specific settings to be used in the application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.FeatureSettings feature_settings = 18;</code>
     * @return \Google\Cloud\AppEngine\V1\Application\FeatureSettings|null
     */
    public function getFeatureSettings()
    {
        return $this->feature_settings;
    }

    public function hasFeatureSettings()
    {
        return isset($this->feature_settings);
    }

    public function clearFeatureSettings()
    {
        unset($this->feature_settings);
    }

    /**
     * The feature specific settings to be used in the application.
     *
     * Generated from protobuf field <code>.google.appengine.v1.Application.FeatureSettings feature_settings = 18;</code>
     * @param \Google\Cloud\AppEngine\V1\Application\FeatureSettings $var
     * @return $this
     */
    public function setFeatureSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AppEngine\V1\Application\FeatureSettings::class);
        $this->feature_settings = $var;

        return $this;
    }

}

