Skip to content

Commit 0fa827c

Browse files
1 parent d84147a commit 0fa827c

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

src/FirebaseAppHosting/Config.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,33 @@
2020
class Config extends \Google\Collection
2121
{
2222
protected $collection_key = 'env';
23+
protected $effectiveEnvType = EnvironmentVariable::class;
24+
protected $effectiveEnvDataType = 'array';
2325
protected $envType = EnvironmentVariable::class;
2426
protected $envDataType = 'array';
2527
protected $runConfigType = RunConfig::class;
2628
protected $runConfigDataType = '';
2729

30+
/**
31+
* Output only. [OUTPUT_ONLY] This field represents all environment variables
32+
* employed during both the build and runtime. This list reflects the result
33+
* of merging variables from all sources (Backend.override_env,
34+
* Build.Config.env, YAML, defaults, system). Each variable includes its
35+
* `origin`
36+
*
37+
* @param EnvironmentVariable[] $effectiveEnv
38+
*/
39+
public function setEffectiveEnv($effectiveEnv)
40+
{
41+
$this->effectiveEnv = $effectiveEnv;
42+
}
43+
/**
44+
* @return EnvironmentVariable[]
45+
*/
46+
public function getEffectiveEnv()
47+
{
48+
return $this->effectiveEnv;
49+
}
2850
/**
2951
* Optional. Supplied environment variables for a specific build. Provided at
3052
* Build creation time and immutable afterwards. This field is only applicable

src/FirebaseAppHosting/EnvironmentVariable.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@
1919

2020
class EnvironmentVariable extends \Google\Collection
2121
{
22+
/**
23+
* Source is unspecified.
24+
*/
25+
public const ORIGIN_ORIGIN_UNSPECIFIED = 'ORIGIN_UNSPECIFIED';
26+
/**
27+
* Variable was set on the backend resource (e.g. via API or Console).
28+
* Represents variables from `Backend.override_env`
29+
*/
30+
public const ORIGIN_BACKEND_OVERRIDES = 'BACKEND_OVERRIDES';
31+
/**
32+
* Variable was provided specifically for the build upon creation via the
33+
* `Build.Config.env` field. Only used for pre-built images.
34+
*/
35+
public const ORIGIN_BUILD_CONFIG = 'BUILD_CONFIG';
36+
/**
37+
* Variable is defined in apphosting.yaml file.
38+
*/
39+
public const ORIGIN_APPHOSTING_YAML = 'APPHOSTING_YAML';
40+
/**
41+
* Variable is defined provided by the firebase platform.
42+
*/
43+
public const ORIGIN_FIREBASE_SYSTEM = 'FIREBASE_SYSTEM';
2244
protected $collection_key = 'availability';
2345
/**
2446
* Optional. Where this variable should be made available. If left
@@ -27,6 +49,20 @@ class EnvironmentVariable extends \Google\Collection
2749
* @var string[]
2850
*/
2951
public $availability;
52+
/**
53+
* Output only. The high-level origin category of the environment variable.
54+
*
55+
* @var string
56+
*/
57+
public $origin;
58+
/**
59+
* Output only. Specific detail about the source. For APPHOSTING_YAML origins,
60+
* this will contain the exact filename, such as "apphosting.yaml" or
61+
* "apphosting.staging.yaml".
62+
*
63+
* @var string
64+
*/
65+
public $originFileName;
3066
/**
3167
* A fully qualified secret version. The value of the secret will be accessed
3268
* once while building the application and once per cold start of the
@@ -71,6 +107,43 @@ public function getAvailability()
71107
{
72108
return $this->availability;
73109
}
110+
/**
111+
* Output only. The high-level origin category of the environment variable.
112+
*
113+
* Accepted values: ORIGIN_UNSPECIFIED, BACKEND_OVERRIDES, BUILD_CONFIG,
114+
* APPHOSTING_YAML, FIREBASE_SYSTEM
115+
*
116+
* @param self::ORIGIN_* $origin
117+
*/
118+
public function setOrigin($origin)
119+
{
120+
$this->origin = $origin;
121+
}
122+
/**
123+
* @return self::ORIGIN_*
124+
*/
125+
public function getOrigin()
126+
{
127+
return $this->origin;
128+
}
129+
/**
130+
* Output only. Specific detail about the source. For APPHOSTING_YAML origins,
131+
* this will contain the exact filename, such as "apphosting.yaml" or
132+
* "apphosting.staging.yaml".
133+
*
134+
* @param string $originFileName
135+
*/
136+
public function setOriginFileName($originFileName)
137+
{
138+
$this->originFileName = $originFileName;
139+
}
140+
/**
141+
* @return string
142+
*/
143+
public function getOriginFileName()
144+
{
145+
return $this->originFileName;
146+
}
74147
/**
75148
* A fully qualified secret version. The value of the secret will be accessed
76149
* once while building the application and once per cold start of the

0 commit comments

Comments
 (0)