From 3b7f251e0d73d9aa5c42a696a783f38087e3fbe1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 5 Oct 2024 00:49:38 +0000 Subject: [PATCH] feat: add Builds API(#7725) docs: fixed formatting of some documentation feat: add Service Mesh configuration to Services feat: add GPU configuration to Services feat: add INGRESS_TRAFFIC_NONE to Services feat: add ServiceScaling to Services PiperOrigin-RevId: 681696446 Source-Link: https://github.com/googleapis/googleapis/commit/4fe2139be5d934a40005c41b9dc132a143457ad0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb5e78c3c478f81a8c813af5887757dc692052f3 Copy-Tag: eyJwIjoiUnVuLy5Pd2xCb3QueWFtbCIsImgiOiJjYjVlNzhjM2M0NzhmODFhOGM4MTNhZjU4ODc3NTdkYzY5MjA1MmYzIn0= Co-authored-by: Brent Shaffer --- Run/metadata/V2/Build.php | Bin 0 -> 2450 bytes Run/metadata/V2/Job.php | Bin 6706 -> 6807 bytes Run/metadata/V2/Revision.php | 10 +- Run/metadata/V2/RevisionTemplate.php | 11 +- Run/metadata/V2/Service.php | 12 +- Run/metadata/V2/VendorSettings.php | Bin 1909 -> 2442 bytes Run/samples/V2/BuildsClient/submit_build.php | 94 +++++ Run/src/V2/BinaryAuthorization.php | 10 +- Run/src/V2/Client/BuildsClient.php | 237 ++++++++++++ Run/src/V2/Client/JobsClient.php | 48 +++ Run/src/V2/Client/ServicesClient.php | 68 ++++ Run/src/V2/IngressTraffic.php | 7 + Run/src/V2/NodeSelector.php | 67 ++++ Run/src/V2/Revision.php | 88 +++++ Run/src/V2/RevisionScaling.php | 16 +- Run/src/V2/RevisionTemplate.php | 100 ++++- Run/src/V2/Service.php | 172 ++++++--- Run/src/V2/ServiceMesh.php | 76 ++++ Run/src/V2/ServiceScaling.php | 42 ++- Run/src/V2/ServiceScaling/ScalingMode.php | 63 ++++ Run/src/V2/StorageSource.php | 155 ++++++++ Run/src/V2/SubmitBuildRequest.php | 356 ++++++++++++++++++ .../V2/SubmitBuildRequest/BuildpacksBuild.php | 271 +++++++++++++ Run/src/V2/SubmitBuildRequest/DockerBuild.php | 34 ++ Run/src/V2/SubmitBuildResponse.php | 149 ++++++++ Run/src/V2/VpcAccess.php | 16 +- Run/src/V2/gapic_metadata.json | 14 + .../V2/resources/builds_client_config.json | 27 ++ .../V2/resources/builds_descriptor_config.php | 43 +++ .../resources/builds_rest_client_config.php | 88 +++++ .../V2/resources/jobs_descriptor_config.php | 3 + .../resources/services_descriptor_config.php | 4 + Run/tests/Unit/V2/Client/BuildsClientTest.php | 197 ++++++++++ .../Unit/V2/Client/ServicesClientTest.php | 10 + 34 files changed, 2400 insertions(+), 88 deletions(-) create mode 100644 Run/metadata/V2/Build.php create mode 100644 Run/samples/V2/BuildsClient/submit_build.php create mode 100644 Run/src/V2/Client/BuildsClient.php create mode 100644 Run/src/V2/NodeSelector.php create mode 100644 Run/src/V2/ServiceMesh.php create mode 100644 Run/src/V2/ServiceScaling/ScalingMode.php create mode 100644 Run/src/V2/StorageSource.php create mode 100644 Run/src/V2/SubmitBuildRequest.php create mode 100644 Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php create mode 100644 Run/src/V2/SubmitBuildRequest/DockerBuild.php create mode 100644 Run/src/V2/SubmitBuildResponse.php create mode 100644 Run/src/V2/resources/builds_client_config.json create mode 100644 Run/src/V2/resources/builds_descriptor_config.php create mode 100644 Run/src/V2/resources/builds_rest_client_config.php create mode 100644 Run/tests/Unit/V2/Client/BuildsClientTest.php diff --git a/Run/metadata/V2/Build.php b/Run/metadata/V2/Build.php new file mode 100644 index 0000000000000000000000000000000000000000..d54649f835f7a54acab79d2e68ebac1315f85d5f GIT binary patch literal 2450 zcmb7G&u<$=6lR^qO~y$hHiEboh`|lSiP~M^N(DI$Xx$`jRUjd$ii9k!X4hkT$a-g) znROH*AK+i$#DzbFKY$}hoQuSX8&^)uk6nB7OHFfdRy*%~^WOK~_ufAIEEy!=4t$Jb z%#grc7@R;cz%XG{(2zzjNP9iZU`U4vi7;~@+}?v#{UT7636CVxFK7!^ivWFR(yeBv9wEcI!M+Zk>ZP?!0Jj0uV-s zbJ$ky;1odlm!v^NLdXRY^4}`qK8cASC?em>sJCDbMI1}di?+Qq4h5kxR1SM_h#TwB zU@F_ygvu?Z6N?a!0c^V7MVia|@F%KC@1ZDfuwAJckF`-MnX{=}0Dmc=E4HILl zbs@+tC|HV%w?oLVNLjq8<5mFU$y4VNn!JQ`yf~(c1sd~KYnsy(;wr~S5y7!|J)d2I zqi!1y(1=j>daegJYmI9M`8kdIvU6e*_d9!uYRIdT)OEY}Daoqjb-Rbkvln~k5ia^uPwH!_z^b|{ekkOPG+%9;sjEn5( zPIeSc6L#q&VPjPPxeV;XG#C=0b#Q>cOEDMrGAJjA$vCPOv>Nm6nU`M4_P{MJ8x-}i zZ%D6}*cP`1vIW(q+TDcnF$s6|DV4e&WK*~sUW(s`(mb8qea*urdRK20GKfWCM zLd1>^U%7Mr^u)5CfrTy&k1)#sXEosc>jG|T-yG~6u*5MNkr4YR3~4HvDd*u^l9|de zW$G#=^y*E0a`&ZY{pWoMR&}X$QrX?In%t4Y&iz_DDSg{-f*S($d36rX7{0CABB&IC zsQp<2OXsqbb-F2ANRT1U3RS9Fwv06&N4`KzjuKrcT}6EwqHuuyOA2AxD*yzDXNS55 znOh3p!tsbO8V_Y#_#?y!3L?y_vohdH^Q-I9dM*QJXA1fv$J~hpJ5eoT*&l!^j@3mz zN(CLNx$LKj9P09BRe(8dR@(%(uLQCyVCD#)7=r9YFgrp~iVY>L(kE7X4wOwlw-;pg zY909EB*FC`EUKGU})wfWb=aW+~$tFat@oGauSN-9SfBgMZ=|TM?wX9FgSlN>6TE)xV4L72pnZfSH z*erA2;#%M>YooUNn`f&jX+})0oZmfXAVk7ju6ulZeD2Vdtuip*2=|f*i5_Lc_OBLL zk&?SC>Ne19=%u`GeY0*-&u5yHX`kwE4SBiDKn9ZpoBH=3k6csT-X!1C>}g!c`!uIu q?3yv6CIWX)3o~ULl%=Df_tz#n=dM}wh3|qZzX`OZ+1+C>2H<}@%pJM_ literal 0 HcmV?d00001 diff --git a/Run/metadata/V2/Job.php b/Run/metadata/V2/Job.php index 086bf75692859de25f415a1a15b60f2b641e39a4..f04aa7b7517d80a67f221929ccd91e2fa22497c3 100644 GIT binary patch delta 68 zcmdmFGTn58AM@lRELxKrn0XhwGBdH9(&Unz+{h*}F`jdB8tX|$We`U&wIVgSv?Mb> UPp_aTza(Eu2PC@Lh3%a%0RF@lU;qFB delta 33 pcmbPky2)gNAM@ru=I@LwOEtM(3u*uW diff --git a/Run/metadata/V2/Revision.php b/Run/metadata/V2/Revision.php index 1ef84a040295..9d79c58305c9 100644 --- a/Run/metadata/V2/Revision.php +++ b/Run/metadata/V2/Revision.php @@ -29,7 +29,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -Â +´ "google/cloud/run/v2/revision.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto!google/cloud/run/v2/k8s.min.proto google/cloud/run/v2/status.proto)google/cloud/run/v2/vendor_settings.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.proto"G GetRevisionRequest1 name ( B#àAúA @@ -47,7 +47,7 @@ public static function initOnce() { name ( B#àAúA run.googleapis.com/Revision validate_only ( -etag ( "í +etag ( "ß Revision name ( BàA uid ( BàA @@ -74,7 +74,8 @@ public static function initOnce() { volumes ( 2.google.cloud.run.v2.VolumeH execution_environment (2).google.cloud.run.v2.ExecutionEnvironment> encryption_key ( B&úA# -!cloudkms.googleapis.com/CryptoKey\\ +!cloudkms.googleapis.com/CryptoKey6 + service_mesh ( 2 .google.cloud.run.v2.ServiceMesh\\ encryption_key_revocation_action (22.google.cloud.run.v2.EncryptionKeyRevocationActionC encryption_key_shutdown_duration ( 2.google.protobuf.Duration reconciling (BàA7 @@ -84,7 +85,8 @@ public static function initOnce() { log_uri! ( BàA satisfies_pzs% (BàA session_affinity& (G -scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusBàA +scaling_status\' ( 2*.google.cloud.run.v2.RevisionScalingStatusBàA8 + node_selector( ( 2!.google.cloud.run.v2.NodeSelector etagc ( BàA- LabelsEntry key (  diff --git a/Run/metadata/V2/RevisionTemplate.php b/Run/metadata/V2/RevisionTemplate.php index 55ab1ab45ba0..51eb821e6f7a 100644 --- a/Run/metadata/V2/RevisionTemplate.php +++ b/Run/metadata/V2/RevisionTemplate.php @@ -21,8 +21,9 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Duration::initOnce(); $pool->internalAddGeneratedFile( ' -§ -+google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"ò +£ + ++google/cloud/run/v2/revision_template.protogoogle.cloud.run.v2google/api/resource.proto!google/cloud/run/v2/k8s.min.proto)google/cloud/run/v2/vendor_settings.protogoogle/protobuf/duration.proto"î RevisionTemplate5 revision ( B#àAúA run.googleapis.com/RevisionF @@ -40,9 +41,11 @@ public static function initOnce() { execution_environment (2).google.cloud.run.v2.ExecutionEnvironmentBàA> encryption_key ( B&úA# !cloudkms.googleapis.com/CryptoKey- - max_instance_request_concurrency (BàA + max_instance_request_concurrency (BàA; + service_mesh ( 2 .google.cloud.run.v2.ServiceMeshBàA session_affinity (BàA" -health_check_disabled (BàA- +health_check_disabled (BàA= + node_selector ( 2!.google.cloud.run.v2.NodeSelectorBàA- LabelsEntry key (  value ( :82 diff --git a/Run/metadata/V2/Service.php b/Run/metadata/V2/Service.php index b5a84216ba3f..784370ba87dd 100644 --- a/Run/metadata/V2/Service.php +++ b/Run/metadata/V2/Service.php @@ -31,7 +31,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' -“% +É% !google/cloud/run/v2/service.protogoogle.cloud.run.v2google/api/client.protogoogle/api/field_behavior.protogoogle/api/launch_stage.protogoogle/api/resource.protogoogle/api/routing.proto#google/cloud/run/v2/condition.proto+google/cloud/run/v2/revision_template.proto(google/cloud/run/v2/traffic_target.proto)google/cloud/run/v2/vendor_settings.protogoogle/iam/v1/iam_policy.protogoogle/iam/v1/policy.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"® CreateServiceRequest2 parent ( B"àAúArun.googleapis.com/Service2 @@ -60,7 +60,7 @@ public static function initOnce() { name ( B"àAúA run.googleapis.com/Service validate_only ( -etag ( "Ê +etag ( "€ Service name (  description (  @@ -84,7 +84,10 @@ public static function initOnce() { template ( 2%.google.cloud.run.v2.RevisionTemplateBàA8 traffic ( 2".google.cloud.run.v2.TrafficTargetBàA9 scaling ( 2#.google.cloud.run.v2.ServiceScalingBàA! -default_uri_disabled (BàA +invoker_iam_disabled (BàA! +default_uri_disabled (BàA +urls ( BàA +custom_audiences% (  observed_generation (BàA? terminal_condition ( 2.google.cloud.run.v2.ConditionBàA7 @@ -94,8 +97,7 @@ public static function initOnce() { latest_created_revision" ( B#àAúA run.googleapis.com/RevisionG traffic_statuses# ( 2(.google.cloud.run.v2.TrafficTargetStatusBàA -uri$ ( BàA -custom_audiences% (  +uri$ ( BàA satisfies_pzs& (BàA reconcilingb (BàA etagc ( BàA- diff --git a/Run/metadata/V2/VendorSettings.php b/Run/metadata/V2/VendorSettings.php index 60b296955fad6e9eae3579b68a2fee50c825cd3f..c96bdb10ec7926db738b43f24ea381b84394ff92 100644 GIT binary patch delta 610 zcmey$*Co8cpNZ)c@8&?Jhm4FHCL6ODJ2`W)73Ak+CRa)@D==zsIvGB2Wc=l*&83-? znU`2pnOItqkzbTql~|IQpQo3epP!zSnpluote2dhs~-T?IJt^tlBX*dcW`P^S!Qyo zZ)$OdkQoYx%Tbj}IWM)OJijQr7^18g-7t_orK60Kd07qXg}k_Uijxy_ zGV{{obMsSD!EWO-(ueBNOU}tJP0=eV&C@G0(u3L?3{kHKrG0_goS1>0QE~%14I&2; z6O!SQ2zGY#@$_?#_w{#ijSuw;4sdn$bn|p|5nvGF<>GV0tlbT$TUnC^K#hsX(4CECh0=ZDX0dq+H#bk`ct3wXR{@sEw^%setBucket($storageSourceBucket) + ->setObject($storageSourceObject); + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + + // Call the API and handle any network failures. + try { + /** @var SubmitBuildResponse $response */ + $response = $buildsClient->submitBuild($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $parent = '[PARENT]'; + $storageSourceBucket = '[BUCKET]'; + $storageSourceObject = '[OBJECT]'; + $imageUri = '[IMAGE_URI]'; + + submit_build_sample($parent, $storageSourceBucket, $storageSourceObject, $imageUri); +} +// [END run_v2_generated_Builds_SubmitBuild_sync] diff --git a/Run/src/V2/BinaryAuthorization.php b/Run/src/V2/BinaryAuthorization.php index a5e1fdc009fb..c0169d3c5d71 100644 --- a/Run/src/V2/BinaryAuthorization.php +++ b/Run/src/V2/BinaryAuthorization.php @@ -37,7 +37,7 @@ class BinaryAuthorization extends \Google\Protobuf\Internal\Message * authorization policy. If False, binary authorization will be disabled. * @type string $policy * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * @type string $breakglass_justification * Optional. If present, indicates to use Breakglass using this justification. * If use_default is False, then it must be empty. @@ -85,9 +85,9 @@ public function setUseDefault($var) /** * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @return string */ public function getPolicy() @@ -102,9 +102,9 @@ public function hasPolicy() /** * Optional. The path to a binary authorization policy. - * Format: projects/{project}/platforms/cloudRun/{policy-name} + * Format: `projects/{project}/platforms/cloudRun/{policy-name}` * - * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * Generated from protobuf field string policy = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { * @param string $var * @return $this */ diff --git a/Run/src/V2/Client/BuildsClient.php b/Run/src/V2/Client/BuildsClient.php new file mode 100644 index 000000000000..f801387ac125 --- /dev/null +++ b/Run/src/V2/Client/BuildsClient.php @@ -0,0 +1,237 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/builds_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/builds_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/builds_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/builds_rest_client_config.php', + ], + ], + ]; + } + + /** + * Formats a string containing the fully-qualified path to represent a worker_pool + * resource. + * + * @param string $project + * @param string $location + * @param string $workerPool + * + * @return string The formatted worker_pool resource. + */ + public static function workerPoolName(string $project, string $location, string $workerPool): string + { + return self::getPathTemplate('workerPool')->render([ + 'project' => $project, + 'location' => $location, + 'worker_pool' => $workerPool, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'run.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Submits a build in a given project. + * + * The async variant is {@see BuildsClient::submitBuildAsync()} . + * + * @example samples/V2/BuildsClient/submit_build.php + * + * @param SubmitBuildRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SubmitBuildResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function submitBuild(SubmitBuildRequest $request, array $callOptions = []): SubmitBuildResponse + { + return $this->startApiCall('SubmitBuild', $request, $callOptions)->wait(); + } +} diff --git a/Run/src/V2/Client/JobsClient.php b/Run/src/V2/Client/JobsClient.php index 570ee809b563..8cd57be3122d 100644 --- a/Run/src/V2/Client/JobsClient.php +++ b/Run/src/V2/Client/JobsClient.php @@ -267,6 +267,51 @@ public static function locationName(string $project, string $location): string ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a secret * resource. @@ -312,6 +357,9 @@ public static function secretVersionName(string $project, string $secret, string * - execution: projects/{project}/locations/{location}/jobs/{job}/executions/{execution} * - job: projects/{project}/locations/{location}/jobs/{job} * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy * - secret: projects/{project}/secrets/{secret} * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} * diff --git a/Run/src/V2/Client/ServicesClient.php b/Run/src/V2/Client/ServicesClient.php index 794121b04e1c..d6e89a0c64dd 100644 --- a/Run/src/V2/Client/ServicesClient.php +++ b/Run/src/V2/Client/ServicesClient.php @@ -224,6 +224,70 @@ public static function locationName(string $project, string $location): string ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * location_policy resource. + * + * @param string $location + * + * @return string The formatted location_policy resource. + */ + public static function locationPolicyName(string $location): string + { + return self::getPathTemplate('locationPolicy')->render([ + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a mesh + * resource. + * + * @param string $project + * @param string $location + * @param string $mesh + * + * @return string The formatted mesh resource. + */ + public static function meshName(string $project, string $location, string $mesh): string + { + return self::getPathTemplate('mesh')->render([ + 'project' => $project, + 'location' => $location, + 'mesh' => $mesh, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a policy + * resource. + * + * @param string $project + * + * @return string The formatted policy resource. + */ + public static function policyName(string $project): string + { + return self::getPathTemplate('policy')->render([ + 'project' => $project, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * project_policy resource. + * + * @param string $project + * + * @return string The formatted project_policy resource. + */ + public static function projectPolicyName(string $project): string + { + return self::getPathTemplate('projectPolicy')->render([ + 'project' => $project, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a revision * resource. @@ -307,6 +371,10 @@ public static function serviceName(string $project, string $location, string $se * - connector: projects/{project}/locations/{location}/connectors/{connector} * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} * - location: projects/{project}/locations/{location} + * - locationPolicy: locations/{location}/policy + * - mesh: projects/{project}/locations/{location}/meshes/{mesh} + * - policy: projects/{project}/policy + * - projectPolicy: projects/{project}/policy * - revision: projects/{project}/locations/{location}/services/{service}/revisions/{revision} * - secret: projects/{project}/secrets/{secret} * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} diff --git a/Run/src/V2/IngressTraffic.php b/Run/src/V2/IngressTraffic.php index 4bcff9e224cb..c9e391f2e464 100644 --- a/Run/src/V2/IngressTraffic.php +++ b/Run/src/V2/IngressTraffic.php @@ -37,12 +37,19 @@ class IngressTraffic * Generated from protobuf enum INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; */ const INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER = 3; + /** + * No ingress traffic is allowed. + * + * Generated from protobuf enum INGRESS_TRAFFIC_NONE = 4; + */ + const INGRESS_TRAFFIC_NONE = 4; private static $valueToName = [ self::INGRESS_TRAFFIC_UNSPECIFIED => 'INGRESS_TRAFFIC_UNSPECIFIED', self::INGRESS_TRAFFIC_ALL => 'INGRESS_TRAFFIC_ALL', self::INGRESS_TRAFFIC_INTERNAL_ONLY => 'INGRESS_TRAFFIC_INTERNAL_ONLY', self::INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER => 'INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER', + self::INGRESS_TRAFFIC_NONE => 'INGRESS_TRAFFIC_NONE', ]; public static function name($value) diff --git a/Run/src/V2/NodeSelector.php b/Run/src/V2/NodeSelector.php new file mode 100644 index 000000000000..54fd94337d57 --- /dev/null +++ b/Run/src/V2/NodeSelector.php @@ -0,0 +1,67 @@ +google.cloud.run.v2.NodeSelector + */ +class NodeSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accelerator = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator + * Required. GPU accelerator type to attach to an instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccelerator() + { + return $this->accelerator; + } + + /** + * Required. GPU accelerator type to attach to an instance. + * + * Generated from protobuf field string accelerator = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccelerator($var) + { + GPBUtil::checkString($var, True); + $this->accelerator = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/Revision.php b/Run/src/V2/Revision.php index 18c074852e0b..f3bdf65355ab 100644 --- a/Run/src/V2/Revision.php +++ b/Run/src/V2/Revision.php @@ -164,6 +164,12 @@ class Revision extends \Google\Protobuf\Internal\Message * Generated from protobuf field string encryption_key = 21 [(.google.api.resource_reference) = { */ protected $encryption_key = ''; + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + */ + protected $service_mesh = null; /** * The action to take if the encryption key is revoked. * @@ -225,6 +231,12 @@ class Revision extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.run.v2.RevisionScalingStatus scaling_status = 39 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $scaling_status = null; + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + */ + protected $node_selector = null; /** * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. @@ -306,6 +318,8 @@ class Revision extends \Google\Protobuf\Internal\Message * A reference to a customer managed encryption key (CMEK) to use to encrypt * this container image. For more information, go to * https://cloud.google.com/run/docs/securing/using-cmek + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Enables service mesh connectivity. * @type int $encryption_key_revocation_action * The action to take if the encryption key is revoked. * @type \Google\Protobuf\Duration $encryption_key_shutdown_duration @@ -331,6 +345,8 @@ class Revision extends \Google\Protobuf\Internal\Message * Enable session affinity. * @type \Google\Cloud\Run\V2\RevisionScalingStatus $scaling_status * Output only. The current effective scaling settings for the revision. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * The node selector for the revision. * @type string $etag * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. @@ -985,6 +1001,42 @@ public function setEncryptionKey($var) return $this; } + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 22; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + /** * The action to take if the encryption key is revoked. * @@ -1253,6 +1305,42 @@ public function setScalingStatus($var) return $this; } + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * The node selector for the revision. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 40; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + /** * Output only. A system-generated fingerprint for this version of the * resource. May be used to detect modification conflict during updates. diff --git a/Run/src/V2/RevisionScaling.php b/Run/src/V2/RevisionScaling.php index 892c5df3338c..5536c70fe0a4 100644 --- a/Run/src/V2/RevisionScaling.php +++ b/Run/src/V2/RevisionScaling.php @@ -24,7 +24,9 @@ class RevisionScaling extends \Google\Protobuf\Internal\Message protected $min_instance_count = 0; /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -41,7 +43,9 @@ class RevisionScaling extends \Google\Protobuf\Internal\Message * have. * @type int $max_instance_count * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * } */ public function __construct($data = NULL) { @@ -79,7 +83,9 @@ public function setMinInstanceCount($var) /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -91,7 +97,9 @@ public function getMaxInstanceCount() /** * Optional. Maximum number of serving instances that this resource should - * have. + * have. When unspecified, the field is set to the server default value of + * 100. For more information see + * https://cloud.google.com/run/docs/configuring/max-instances * * Generated from protobuf field int32 max_instance_count = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var diff --git a/Run/src/V2/RevisionTemplate.php b/Run/src/V2/RevisionTemplate.php index 868e51c42159..4ba3f6a2eb08 100644 --- a/Run/src/V2/RevisionTemplate.php +++ b/Run/src/V2/RevisionTemplate.php @@ -110,11 +110,18 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message protected $encryption_key = ''; /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; */ protected $max_instance_request_concurrency = 0; + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_mesh = null; /** * Optional. Enable session affinity. * @@ -127,6 +134,12 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message * Generated from protobuf field bool health_check_disabled = 20 [(.google.api.field_behavior) = OPTIONAL]; */ protected $health_check_disabled = false; + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $node_selector = null; /** * Constructor. @@ -184,11 +197,16 @@ class RevisionTemplate extends \Google\Protobuf\Internal\Message * https://cloud.google.com/run/docs/securing/using-cmek * @type int $max_instance_request_concurrency * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. + * @type \Google\Cloud\Run\V2\ServiceMesh $service_mesh + * Optional. Enables service mesh connectivity. * @type bool $session_affinity * Optional. Enable session affinity. * @type bool $health_check_disabled * Optional. Disables health checking containers during deployment. + * @type \Google\Cloud\Run\V2\NodeSelector $node_selector + * Optional. The node selector for the revision template. * } */ public function __construct($data = NULL) { @@ -566,7 +584,8 @@ public function setEncryptionKey($var) /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -578,7 +597,8 @@ public function getMaxInstanceRequestConcurrency() /** * Optional. Sets the maximum number of requests that each serving instance - * can receive. + * can receive. If not specified or 0, defaults to 80 when requested + * `CPU >= 1` and defaults to 1 when requested `CPU < 1`. * * Generated from protobuf field int32 max_instance_request_concurrency = 15 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -592,6 +612,42 @@ public function setMaxInstanceRequestConcurrency($var) return $this; } + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\ServiceMesh|null + */ + public function getServiceMesh() + { + return $this->service_mesh; + } + + public function hasServiceMesh() + { + return isset($this->service_mesh); + } + + public function clearServiceMesh() + { + unset($this->service_mesh); + } + + /** + * Optional. Enables service mesh connectivity. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceMesh service_mesh = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\ServiceMesh $var + * @return $this + */ + public function setServiceMesh($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\ServiceMesh::class); + $this->service_mesh = $var; + + return $this; + } + /** * Optional. Enable session affinity. * @@ -644,5 +700,41 @@ public function setHealthCheckDisabled($var) return $this; } + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Run\V2\NodeSelector|null + */ + public function getNodeSelector() + { + return $this->node_selector; + } + + public function hasNodeSelector() + { + return isset($this->node_selector); + } + + public function clearNodeSelector() + { + unset($this->node_selector); + } + + /** + * Optional. The node selector for the revision template. + * + * Generated from protobuf field .google.cloud.run.v2.NodeSelector node_selector = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Run\V2\NodeSelector $var + * @return $this + */ + public function setNodeSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\NodeSelector::class); + $this->node_selector = $var; + + return $this; + } + } diff --git a/Run/src/V2/Service.php b/Run/src/V2/Service.php index 379f89b04695..ad7d6330dc2a 100644 --- a/Run/src/V2/Service.php +++ b/Run/src/V2/Service.php @@ -181,12 +181,35 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.run.v2.ServiceScaling scaling = 20 [(.google.api.field_behavior) = OPTIONAL]; */ protected $scaling = null; + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $invoker_iam_disabled = false; /** * Optional. Disables public resolution of the default URI of this service. * * Generated from protobuf field bool default_uri_disabled = 22 [(.google.api.field_behavior) = OPTIONAL]; */ protected $default_uri_disabled = false; + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $urls; + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + */ + private $custom_audiences; /** * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -245,16 +268,6 @@ class Service extends \Google\Protobuf\Internal\Message * Generated from protobuf field string uri = 36 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $uri = ''; - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - */ - private $custom_audiences; /** * Output only. Reserved for future use. * @@ -381,8 +394,19 @@ class Service extends \Google\Protobuf\Internal\Message * defaults to 100% traffic to the latest `Ready` Revision. * @type \Google\Cloud\Run\V2\ServiceScaling $scaling * Optional. Specifies service-level scaling settings + * @type bool $invoker_iam_disabled + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. * @type bool $default_uri_disabled * Optional. Disables public resolution of the default URI of this service. + * @type array|\Google\Protobuf\Internal\RepeatedField $urls + * Output only. All URLs serving traffic for this Service. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. * @type int|string $observed_generation * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -413,12 +437,6 @@ class Service extends \Google\Protobuf\Internal\Message * process in Cloud Run. * @type string $uri * Output only. The main URI in which this Service is serving traffic. - * @type array|\Google\Protobuf\Internal\RepeatedField $custom_audiences - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. * @type bool $satisfies_pzs * Output only. Reserved for future use. * @type bool $reconciling @@ -1125,6 +1143,34 @@ public function setScaling($var) return $this; } + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getInvokerIamDisabled() + { + return $this->invoker_iam_disabled; + } + + /** + * Optional. Disables IAM permission check for run.routes.invoke for callers + * of this service. This setting should not be used with external ingress. + * + * Generated from protobuf field bool invoker_iam_disabled = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setInvokerIamDisabled($var) + { + GPBUtil::checkBool($var); + $this->invoker_iam_disabled = $var; + + return $this; + } + /** * Optional. Disables public resolution of the default URI of this service. * @@ -1151,6 +1197,66 @@ public function setDefaultUriDisabled($var) return $this; } + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUrls() + { + return $this->urls; + } + + /** + * Output only. All URLs serving traffic for this Service. + * + * Generated from protobuf field repeated string urls = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUrls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->urls = $arr; + + return $this; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomAudiences() + { + return $this->custom_audiences; + } + + /** + * One or more custom audiences that you want this service to support. Specify + * each custom audience as the full URL in a string. The custom audiences are + * encoded in the token and used to authenticate requests. For more + * information, see + * https://cloud.google.com/run/docs/configuring/custom-audiences. + * + * Generated from protobuf field repeated string custom_audiences = 37; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomAudiences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_audiences = $arr; + + return $this; + } + /** * Output only. The generation of this Service currently serving traffic. See * comments in `reconciling` for additional information on reconciliation @@ -1375,40 +1481,6 @@ public function setUri($var) return $this; } - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getCustomAudiences() - { - return $this->custom_audiences; - } - - /** - * One or more custom audiences that you want this service to support. Specify - * each custom audience as the full URL in a string. The custom audiences are - * encoded in the token and used to authenticate requests. For more - * information, see - * https://cloud.google.com/run/docs/configuring/custom-audiences. - * - * Generated from protobuf field repeated string custom_audiences = 37; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setCustomAudiences($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->custom_audiences = $arr; - - return $this; - } - /** * Output only. Reserved for future use. * diff --git a/Run/src/V2/ServiceMesh.php b/Run/src/V2/ServiceMesh.php new file mode 100644 index 000000000000..19cd1b0263c1 --- /dev/null +++ b/Run/src/V2/ServiceMesh.php @@ -0,0 +1,76 @@ +google.cloud.run.v2.ServiceMesh + */ +class ServiceMesh extends \Google\Protobuf\Internal\Message +{ + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + */ + protected $mesh = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mesh + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\VendorSettings::initOnce(); + parent::__construct($data); + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getMesh() + { + return $this->mesh; + } + + /** + * The Mesh resource name. Format: + * `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can + * be project id or number. + * + * Generated from protobuf field string mesh = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMesh($var) + { + GPBUtil::checkString($var, True); + $this->mesh = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/ServiceScaling.php b/Run/src/V2/ServiceScaling.php index e8bad225cc66..eff3cf1badc1 100644 --- a/Run/src/V2/ServiceScaling.php +++ b/Run/src/V2/ServiceScaling.php @@ -19,11 +19,17 @@ class ServiceScaling extends \Google\Protobuf\Internal\Message /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; */ protected $min_instance_count = 0; + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $scaling_mode = 0; /** * Constructor. @@ -34,7 +40,9 @@ class ServiceScaling extends \Google\Protobuf\Internal\Message * @type int $min_instance_count * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. + * @type int $scaling_mode + * Optional. The scaling mode for the service. * } */ public function __construct($data = NULL) { @@ -45,7 +53,7 @@ public function __construct($data = NULL) { /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return int @@ -58,7 +66,7 @@ public function getMinInstanceCount() /** * Optional. total min instances for the service. This number of instances is * divided among all revisions with specified traffic based on the percent - * of traffic they are receiving. (BETA) + * of traffic they are receiving. * * Generated from protobuf field int32 min_instance_count = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param int $var @@ -72,5 +80,31 @@ public function setMinInstanceCount($var) return $this; } + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getScalingMode() + { + return $this->scaling_mode; + } + + /** + * Optional. The scaling mode for the service. + * + * Generated from protobuf field .google.cloud.run.v2.ServiceScaling.ScalingMode scaling_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setScalingMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Run\V2\ServiceScaling\ScalingMode::class); + $this->scaling_mode = $var; + + return $this; + } + } diff --git a/Run/src/V2/ServiceScaling/ScalingMode.php b/Run/src/V2/ServiceScaling/ScalingMode.php new file mode 100644 index 000000000000..3df73f6e4af0 --- /dev/null +++ b/Run/src/V2/ServiceScaling/ScalingMode.php @@ -0,0 +1,63 @@ +google.cloud.run.v2.ServiceScaling.ScalingMode + */ +class ScalingMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum SCALING_MODE_UNSPECIFIED = 0; + */ + const SCALING_MODE_UNSPECIFIED = 0; + /** + * Scale based on traffic between min and max instances. + * + * Generated from protobuf enum AUTOMATIC = 1; + */ + const AUTOMATIC = 1; + /** + * Scale to exactly min instances and ignore max instances. + * + * Generated from protobuf enum MANUAL = 2; + */ + const MANUAL = 2; + + private static $valueToName = [ + self::SCALING_MODE_UNSPECIFIED => 'SCALING_MODE_UNSPECIFIED', + self::AUTOMATIC => 'AUTOMATIC', + self::MANUAL => 'MANUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Run/src/V2/StorageSource.php b/Run/src/V2/StorageSource.php new file mode 100644 index 000000000000..a577d719f1a5 --- /dev/null +++ b/Run/src/V2/StorageSource.php @@ -0,0 +1,155 @@ +google.cloud.run.v2.StorageSource + */ +class StorageSource extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bucket = ''; + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $object = ''; + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generation = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * @type string $object + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * @type int|string $generation + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Required. Google Cloud Storage bucket containing the source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * + * Generated from protobuf field string bucket = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getObject() + { + return $this->object; + } + + /** + * Required. Google Cloud Storage object containing the source. + * This object must be a gzipped archive file (`.tar.gz`) containing source to + * build. + * + * Generated from protobuf field string object = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setObject($var) + { + GPBUtil::checkString($var, True); + $this->object = $var; + + return $this; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getGeneration() + { + return $this->generation; + } + + /** + * Optional. Google Cloud Storage generation for the object. If the generation + * is omitted, the latest generation will be used. + * + * Generated from protobuf field int64 generation = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setGeneration($var) + { + GPBUtil::checkInt64($var); + $this->generation = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/SubmitBuildRequest.php b/Run/src/V2/SubmitBuildRequest.php new file mode 100644 index 000000000000..cb260e21eed3 --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest.php @@ -0,0 +1,356 @@ +google.cloud.run.v2.SubmitBuildRequest + */ +class SubmitBuildRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $parent = ''; + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_uri = ''; + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $worker_pool = ''; + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + protected $source; + protected $build_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * @type \Google\Cloud\Run\V2\StorageSource $storage_source + * Required. Source for the build. + * @type string $image_uri + * Required. Artifact Registry URI to store the built image. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $buildpack_build + * Build the source using Buildpacks. + * @type \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $docker_build + * Build the source using Docker. This means the source has a Dockerfile. + * @type string $service_account + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * @type string $worker_pool + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. Additional tags to annotate the build. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The project and location to build in. Location must be a region, + * e.g., 'us-central1' or 'global' if the global builder is to be used. + * Format: + * `projects/{project}/locations/{location}` + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Run\V2\StorageSource|null + */ + public function getStorageSource() + { + return $this->readOneof(2); + } + + public function hasStorageSource() + { + return $this->hasOneof(2); + } + + /** + * Required. Source for the build. + * + * Generated from protobuf field .google.cloud.run.v2.StorageSource storage_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Run\V2\StorageSource $var + * @return $this + */ + public function setStorageSource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\StorageSource::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageUri() + { + return $this->image_uri; + } + + /** + * Required. Artifact Registry URI to store the built image. + * + * Generated from protobuf field string image_uri = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageUri($var) + { + GPBUtil::checkString($var, True); + $this->image_uri = $var; + + return $this; + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild|null + */ + public function getBuildpackBuild() + { + return $this->readOneof(4); + } + + public function hasBuildpackBuild() + { + return $this->hasOneof(4); + } + + /** + * Build the source using Buildpacks. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild buildpack_build = 4; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild $var + * @return $this + */ + public function setBuildpackBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\BuildpacksBuild::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @return \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild|null + */ + public function getDockerBuild() + { + return $this->readOneof(5); + } + + public function hasDockerBuild() + { + return $this->hasOneof(5); + } + + /** + * Build the source using Docker. This means the source has a Dockerfile. + * + * Generated from protobuf field .google.cloud.run.v2.SubmitBuildRequest.DockerBuild docker_build = 5; + * @param \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild $var + * @return $this + */ + public function setDockerBuild($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Run\V2\SubmitBuildRequest\DockerBuild::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The service account to use for the build. If not set, the default + * Cloud Build service account for the project will be used. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWorkerPool() + { + return $this->worker_pool; + } + + /** + * Optional. Name of the Cloud Build Custom Worker Pool that should be used to + * build the function. The format of this field is + * `projects/{project}/locations/{region}/workerPools/{workerPool}` where + * `{project}` and `{region}` are the project id and region respectively where + * the worker pool is defined and `{workerPool}` is the short name of the + * worker pool. + * + * Generated from protobuf field string worker_pool = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWorkerPool($var) + { + GPBUtil::checkString($var, True); + $this->worker_pool = $var; + + return $this; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Additional tags to annotate the build. + * + * Generated from protobuf field repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getBuildType() + { + return $this->whichOneof("build_type"); + } + +} + diff --git a/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php b/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php new file mode 100644 index 000000000000..b7256e54523a --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest/BuildpacksBuild.php @@ -0,0 +1,271 @@ +google.cloud.run.v2.SubmitBuildRequest.BuildpacksBuild + */ +class BuildpacksBuild extends \Google\Protobuf\Internal\Message +{ + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @deprecated + */ + protected $runtime = ''; + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $function_target = ''; + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $cache_image_uri = ''; + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $base_image = ''; + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $environment_variables; + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_automatic_updates = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $runtime + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * @type string $function_target + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * @type string $cache_image_uri + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * @type string $base_image + * Optional. The base image used to opt into automatic base image updates. + * @type array|\Google\Protobuf\Internal\MapField $environment_variables + * Optional. User-provided build-time environment variables. + * @type bool $enable_automatic_updates + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @return string + * @deprecated + */ + public function getRuntime() + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + return $this->runtime; + } + + /** + * The runtime name, e.g. 'go113'. Leave blank for generic builds. + * + * Generated from protobuf field string runtime = 1 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setRuntime($var) + { + @trigger_error('runtime is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->runtime = $var; + + return $this; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFunctionTarget() + { + return $this->function_target; + } + + /** + * Optional. Name of the function target if the source is a function source. + * Required for function builds. + * + * Generated from protobuf field string function_target = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFunctionTarget($var) + { + GPBUtil::checkString($var, True); + $this->function_target = $var; + + return $this; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getCacheImageUri() + { + return $this->cache_image_uri; + } + + /** + * Optional. cache_image_uri is the GCR/AR URL where the cache image will be + * stored. cache_image_uri is optional and omitting it will disable caching. + * This URL must be stable across builds. It is used to derive a + * build-specific temporary URL by substituting the tag with the build ID. + * The build will clean up the temporary image on a best-effort basis. + * + * Generated from protobuf field string cache_image_uri = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setCacheImageUri($var) + { + GPBUtil::checkString($var, True); + $this->cache_image_uri = $var; + + return $this; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBaseImage() + { + return $this->base_image; + } + + /** + * Optional. The base image used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBaseImage($var) + { + GPBUtil::checkString($var, True); + $this->base_image = $var; + + return $this; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getEnvironmentVariables() + { + return $this->environment_variables; + } + + /** + * Optional. User-provided build-time environment variables. + * + * Generated from protobuf field map environment_variables = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setEnvironmentVariables($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->environment_variables = $arr; + + return $this; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutomaticUpdates() + { + return $this->enable_automatic_updates; + } + + /** + * Optional. Whether or not the application container will be enrolled in + * automatic base image updates. When true, the application will be built on + * a scratch base image, so the base layers can be appended at run time. + * + * Generated from protobuf field bool enable_automatic_updates = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticUpdates($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_updates = $var; + + return $this; + } + +} + + diff --git a/Run/src/V2/SubmitBuildRequest/DockerBuild.php b/Run/src/V2/SubmitBuildRequest/DockerBuild.php new file mode 100644 index 000000000000..5b8a06980739 --- /dev/null +++ b/Run/src/V2/SubmitBuildRequest/DockerBuild.php @@ -0,0 +1,34 @@ +google.cloud.run.v2.SubmitBuildRequest.DockerBuild + */ +class DockerBuild extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/Run/src/V2/SubmitBuildResponse.php b/Run/src/V2/SubmitBuildResponse.php new file mode 100644 index 000000000000..42440dbfebd4 --- /dev/null +++ b/Run/src/V2/SubmitBuildResponse.php @@ -0,0 +1,149 @@ +google.cloud.run.v2.SubmitBuildResponse + */ +class SubmitBuildResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + */ + protected $build_operation = null; + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + */ + protected $base_image_uri = ''; + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + */ + protected $base_image_warning = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\LongRunning\Operation $build_operation + * Cloud Build operation to be polled via CloudBuild API. + * @type string $base_image_uri + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * @type string $base_image_warning + * Warning message for the base image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Run\V2\Build::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @return \Google\LongRunning\Operation|null + */ + public function getBuildOperation() + { + return $this->build_operation; + } + + public function hasBuildOperation() + { + return isset($this->build_operation); + } + + public function clearBuildOperation() + { + unset($this->build_operation); + } + + /** + * Cloud Build operation to be polled via CloudBuild API. + * + * Generated from protobuf field .google.longrunning.Operation build_operation = 1; + * @param \Google\LongRunning\Operation $var + * @return $this + */ + public function setBuildOperation($var) + { + GPBUtil::checkMessage($var, \Google\LongRunning\Operation::class); + $this->build_operation = $var; + + return $this; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @return string + */ + public function getBaseImageUri() + { + return $this->base_image_uri; + } + + /** + * URI of the base builder image in Artifact Registry being used in the build. + * Used to opt into automatic base image updates. + * + * Generated from protobuf field string base_image_uri = 2; + * @param string $var + * @return $this + */ + public function setBaseImageUri($var) + { + GPBUtil::checkString($var, True); + $this->base_image_uri = $var; + + return $this; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @return string + */ + public function getBaseImageWarning() + { + return $this->base_image_warning; + } + + /** + * Warning message for the base image. + * + * Generated from protobuf field string base_image_warning = 3; + * @param string $var + * @return $this + */ + public function setBaseImageWarning($var) + { + GPBUtil::checkString($var, True); + $this->base_image_warning = $var; + + return $this; + } + +} + diff --git a/Run/src/V2/VpcAccess.php b/Run/src/V2/VpcAccess.php index f38ecdf80556..2edc5d9e89bc 100644 --- a/Run/src/V2/VpcAccess.php +++ b/Run/src/V2/VpcAccess.php @@ -18,8 +18,8 @@ class VpcAccess extends \Google\Protobuf\Internal\Message { /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @@ -49,8 +49,8 @@ class VpcAccess extends \Google\Protobuf\Internal\Message * * @type string $connector * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @type int $egress @@ -68,8 +68,8 @@ public function __construct($data = NULL) { /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * @@ -83,8 +83,8 @@ public function getConnector() /** * VPC Access connector name. - * Format: projects/{project}/locations/{location}/connectors/{connector}, - * where {project} can be project id or number. + * Format: `projects/{project}/locations/{location}/connectors/{connector}`, + * where `{project}` can be project id or number. * For more information on sending traffic to a VPC network via a connector, * visit https://cloud.google.com/run/docs/configuring/vpc-connectors. * diff --git a/Run/src/V2/gapic_metadata.json b/Run/src/V2/gapic_metadata.json index 300fbd7d62bd..2bf7b36f81c0 100644 --- a/Run/src/V2/gapic_metadata.json +++ b/Run/src/V2/gapic_metadata.json @@ -5,6 +5,20 @@ "protoPackage": "google.cloud.run.v2", "libraryPackage": "Google\\Cloud\\Run\\V2", "services": { + "Builds": { + "clients": { + "grpc": { + "libraryClient": "BuildsGapicClient", + "rpcs": { + "SubmitBuild": { + "methods": [ + "submitBuild" + ] + } + } + } + } + }, "Executions": { "clients": { "grpc": { diff --git a/Run/src/V2/resources/builds_client_config.json b/Run/src/V2/resources/builds_client_config.json new file mode 100644 index 000000000000..b09e6e721847 --- /dev/null +++ b/Run/src/V2/resources/builds_client_config.json @@ -0,0 +1,27 @@ +{ + "interfaces": { + "google.cloud.run.v2.Builds": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "SubmitBuild": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/Run/src/V2/resources/builds_descriptor_config.php b/Run/src/V2/resources/builds_descriptor_config.php new file mode 100644 index 000000000000..5cb8ed8624cb --- /dev/null +++ b/Run/src/V2/resources/builds_descriptor_config.php @@ -0,0 +1,43 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Run\V2\SubmitBuildResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'templateMap' => [ + 'workerPool' => 'projects/{project}/locations/{location}/workerPools/{worker_pool}', + ], + ], + ], +]; diff --git a/Run/src/V2/resources/builds_rest_client_config.php b/Run/src/V2/resources/builds_rest_client_config.php new file mode 100644 index 000000000000..5654061ec5f6 --- /dev/null +++ b/Run/src/V2/resources/builds_rest_client_config.php @@ -0,0 +1,88 @@ + [ + 'google.cloud.run.v2.Builds' => [ + 'SubmitBuild' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{parent=projects/*/locations/*}/builds:submit', + 'body' => '*', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'WaitOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=projects/*/locations/*/operations/*}:wait', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/Run/src/V2/resources/jobs_descriptor_config.php b/Run/src/V2/resources/jobs_descriptor_config.php index 33bd0d89d3f4..dabd773405ac 100644 --- a/Run/src/V2/resources/jobs_descriptor_config.php +++ b/Run/src/V2/resources/jobs_descriptor_config.php @@ -180,6 +180,9 @@ 'execution' => 'projects/{project}/locations/{location}/jobs/{job}/executions/{execution}', 'job' => 'projects/{project}/locations/{location}/jobs/{job}', 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', 'secret' => 'projects/{project}/secrets/{secret}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', ], diff --git a/Run/src/V2/resources/services_descriptor_config.php b/Run/src/V2/resources/services_descriptor_config.php index 82c5c01c31d6..3264c3a5d624 100644 --- a/Run/src/V2/resources/services_descriptor_config.php +++ b/Run/src/V2/resources/services_descriptor_config.php @@ -158,6 +158,10 @@ 'connector' => 'projects/{project}/locations/{location}/connectors/{connector}', 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', 'location' => 'projects/{project}/locations/{location}', + 'locationPolicy' => 'locations/{location}/policy', + 'mesh' => 'projects/{project}/locations/{location}/meshes/{mesh}', + 'policy' => 'projects/{project}/policy', + 'projectPolicy' => 'projects/{project}/policy', 'revision' => 'projects/{project}/locations/{location}/services/{service}/revisions/{revision}', 'secret' => 'projects/{project}/secrets/{secret}', 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{version}', diff --git a/Run/tests/Unit/V2/Client/BuildsClientTest.php b/Run/tests/Unit/V2/Client/BuildsClientTest.php new file mode 100644 index 000000000000..dbea8b8c64b4 --- /dev/null +++ b/Run/tests/Unit/V2/Client/BuildsClientTest.php @@ -0,0 +1,197 @@ +getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); + } + + /** @return BuildsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BuildsClient($options); + } + + /** @test */ + public function submitBuildTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuild($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + try { + $gapicClient->submitBuild($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function submitBuildAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseImageUri = 'baseImageUri2088954010'; + $baseImageWarning = 'baseImageWarning-2033873974'; + $expectedResponse = new SubmitBuildResponse(); + $expectedResponse->setBaseImageUri($baseImageUri); + $expectedResponse->setBaseImageWarning($baseImageWarning); + $transport->addResponse($expectedResponse); + // Mock request + $parent = 'parent-995424086'; + $storageSource = new StorageSource(); + $storageSourceBucket = 'storageSourceBucket608605184'; + $storageSource->setBucket($storageSourceBucket); + $storageSourceObject = 'storageSourceObject963439957'; + $storageSource->setObject($storageSourceObject); + $imageUri = 'imageUri-877823864'; + $request = (new SubmitBuildRequest()) + ->setParent($parent) + ->setStorageSource($storageSource) + ->setImageUri($imageUri); + $response = $gapicClient->submitBuildAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.run.v2.Builds/SubmitBuild', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($parent, $actualValue); + $actualValue = $actualRequestObject->getStorageSource(); + $this->assertProtobufEquals($storageSource, $actualValue); + $actualValue = $actualRequestObject->getImageUri(); + $this->assertProtobufEquals($imageUri, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/Run/tests/Unit/V2/Client/ServicesClientTest.php b/Run/tests/Unit/V2/Client/ServicesClientTest.php index e9f9c5834b8e..68727e2c70f0 100644 --- a/Run/tests/Unit/V2/Client/ServicesClientTest.php +++ b/Run/tests/Unit/V2/Client/ServicesClientTest.php @@ -106,6 +106,7 @@ public function createServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -123,6 +124,7 @@ public function createServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -278,6 +280,7 @@ public function deleteServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -295,6 +298,7 @@ public function deleteServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -487,6 +491,7 @@ public function getServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -504,6 +509,7 @@ public function getServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -803,6 +809,7 @@ public function updateServiceTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -820,6 +827,7 @@ public function updateServiceTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision); @@ -961,6 +969,7 @@ public function createServiceAsyncTest() $lastModifier = 'lastModifier-28366240'; $client = 'client-1357712437'; $clientVersion = 'clientVersion-1506231196'; + $invokerIamDisabled = false; $defaultUriDisabled = false; $observedGeneration = 900833007; $latestReadyRevision = 'latestReadyRevision-853854545'; @@ -978,6 +987,7 @@ public function createServiceAsyncTest() $expectedResponse->setLastModifier($lastModifier); $expectedResponse->setClient($client); $expectedResponse->setClientVersion($clientVersion); + $expectedResponse->setInvokerIamDisabled($invokerIamDisabled); $expectedResponse->setDefaultUriDisabled($defaultUriDisabled); $expectedResponse->setObservedGeneration($observedGeneration); $expectedResponse->setLatestReadyRevision($latestReadyRevision);