Skip to content

Commit b458452

Browse files
1 parent 10bf22a commit b458452

2 files changed

Lines changed: 163 additions & 0 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\CloudFunctions;
19+
20+
class DirectVpcNetworkInterface extends \Google\Collection
21+
{
22+
protected $collection_key = 'tags';
23+
/**
24+
* Optional. The name of the VPC network to which the function will be
25+
* connected. Specify either a VPC network or a subnet, or both. If you
26+
* specify only a network, the subnet uses the same name as the network.
27+
*
28+
* @var string
29+
*/
30+
public $network;
31+
/**
32+
* Optional. The name of the VPC subnetwork that the Cloud Function resource
33+
* will get IPs from. Specify either a VPC network or a subnet, or both. If
34+
* both network and subnetwork are specified, the given VPC subnetwork must
35+
* belong to the given VPC network. If subnetwork is not specified, the
36+
* subnetwork with the same name with the network will be used.
37+
*
38+
* @var string
39+
*/
40+
public $subnetwork;
41+
/**
42+
* Optional. Network tags applied to this Cloud Function resource.
43+
*
44+
* @var string[]
45+
*/
46+
public $tags;
47+
48+
/**
49+
* Optional. The name of the VPC network to which the function will be
50+
* connected. Specify either a VPC network or a subnet, or both. If you
51+
* specify only a network, the subnet uses the same name as the network.
52+
*
53+
* @param string $network
54+
*/
55+
public function setNetwork($network)
56+
{
57+
$this->network = $network;
58+
}
59+
/**
60+
* @return string
61+
*/
62+
public function getNetwork()
63+
{
64+
return $this->network;
65+
}
66+
/**
67+
* Optional. The name of the VPC subnetwork that the Cloud Function resource
68+
* will get IPs from. Specify either a VPC network or a subnet, or both. If
69+
* both network and subnetwork are specified, the given VPC subnetwork must
70+
* belong to the given VPC network. If subnetwork is not specified, the
71+
* subnetwork with the same name with the network will be used.
72+
*
73+
* @param string $subnetwork
74+
*/
75+
public function setSubnetwork($subnetwork)
76+
{
77+
$this->subnetwork = $subnetwork;
78+
}
79+
/**
80+
* @return string
81+
*/
82+
public function getSubnetwork()
83+
{
84+
return $this->subnetwork;
85+
}
86+
/**
87+
* Optional. Network tags applied to this Cloud Function resource.
88+
*
89+
* @param string[] $tags
90+
*/
91+
public function setTags($tags)
92+
{
93+
$this->tags = $tags;
94+
}
95+
/**
96+
* @return string[]
97+
*/
98+
public function getTags()
99+
{
100+
return $this->tags;
101+
}
102+
}
103+
104+
// Adding a class alias for backwards compatibility with the previous class name.
105+
class_alias(DirectVpcNetworkInterface::class, 'Google_Service_CloudFunctions_DirectVpcNetworkInterface');

src/CloudFunctions/ServiceConfig.php

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

2020
class ServiceConfig extends \Google\Collection
2121
{
22+
/**
23+
* Unspecified.
24+
*/
25+
public const DIRECT_VPC_EGRESS_DIRECT_VPC_EGRESS_UNSPECIFIED = 'DIRECT_VPC_EGRESS_UNSPECIFIED';
26+
/**
27+
* Sends only traffic to internal addresses through the VPC network.
28+
*/
29+
public const DIRECT_VPC_EGRESS_VPC_EGRESS_PRIVATE_RANGES_ONLY = 'VPC_EGRESS_PRIVATE_RANGES_ONLY';
30+
/**
31+
* Sends all outbound traffic through the VPC network.
32+
*/
33+
public const DIRECT_VPC_EGRESS_VPC_EGRESS_ALL_TRAFFIC = 'VPC_EGRESS_ALL_TRAFFIC';
2234
/**
2335
* Unspecified.
2436
*/
@@ -100,6 +112,15 @@ class ServiceConfig extends \Google\Collection
100112
* @var string
101113
*/
102114
public $binaryAuthorizationPolicy;
115+
/**
116+
* Optional. Egress settings for direct VPC. If not provided, it defaults to
117+
* VPC_EGRESS_PRIVATE_RANGES_ONLY.
118+
*
119+
* @var string
120+
*/
121+
public $directVpcEgress;
122+
protected $directVpcNetworkInterfaceType = DirectVpcNetworkInterface::class;
123+
protected $directVpcNetworkInterfaceDataType = 'array';
103124
/**
104125
* Environment variables that shall be available during function execution.
105126
*
@@ -282,6 +303,43 @@ public function getBinaryAuthorizationPolicy()
282303
{
283304
return $this->binaryAuthorizationPolicy;
284305
}
306+
/**
307+
* Optional. Egress settings for direct VPC. If not provided, it defaults to
308+
* VPC_EGRESS_PRIVATE_RANGES_ONLY.
309+
*
310+
* Accepted values: DIRECT_VPC_EGRESS_UNSPECIFIED,
311+
* VPC_EGRESS_PRIVATE_RANGES_ONLY, VPC_EGRESS_ALL_TRAFFIC
312+
*
313+
* @param self::DIRECT_VPC_EGRESS_* $directVpcEgress
314+
*/
315+
public function setDirectVpcEgress($directVpcEgress)
316+
{
317+
$this->directVpcEgress = $directVpcEgress;
318+
}
319+
/**
320+
* @return self::DIRECT_VPC_EGRESS_*
321+
*/
322+
public function getDirectVpcEgress()
323+
{
324+
return $this->directVpcEgress;
325+
}
326+
/**
327+
* Optional. The Direct VPC network interface for the Cloud Function.
328+
* Currently only a single Direct VPC is supported.
329+
*
330+
* @param DirectVpcNetworkInterface[] $directVpcNetworkInterface
331+
*/
332+
public function setDirectVpcNetworkInterface($directVpcNetworkInterface)
333+
{
334+
$this->directVpcNetworkInterface = $directVpcNetworkInterface;
335+
}
336+
/**
337+
* @return DirectVpcNetworkInterface[]
338+
*/
339+
public function getDirectVpcNetworkInterface()
340+
{
341+
return $this->directVpcNetworkInterface;
342+
}
285343
/**
286344
* Environment variables that shall be available during function execution.
287345
*

0 commit comments

Comments
 (0)